1

I am trying to run the command php bin/module cron:run but getting error in CLI. Here is my crontab.xml

<?xml version="1.0"?>
    <config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:module:Magento_Cron:etc/crontab.xsd">
        <group id="default">
            <job name="emarsys_catalog_bulk_export" instance="Emarsys\Emarsys\Cron\ProductBulkExport" method="execute">
            <schedule>0 0 30 2 3</schedule>
            </job>
        </group>
     </config>

ERROR :

[Magento\Framework\Exception\LocalizedException]
  Invalid Document
  Element 'job': The attribute 'instance' is required but missing.
  Line: 4

 Element 'job': The attribute 'method' is required but missing.
  Line: 4

 Element 'schedule': Element content is not allowed, because the type definition is simple.
  Line: 5

 Element 'schedule': [facet 'minLength'] The value has a length of '0'; this underruns the allowed minimum length of '5'.
  Line: 5

  Element 'schedule': '' is not a valid value of the list type 'scheduleDeclaration'.
  Line: 5

 Element 'run': This element is not expected. Expected is ( config_path ).
  Line: 8


cron:run [--group GROUP] [--bootstrap BOOTSTRAP]
5
  • I don't think XML code has the issue.
    – Amit Bera
    Dec 17, 2018 at 7:30
  • Can u tell me what is the issue?
    – Unknown
    Dec 17, 2018 at 7:31
  • use * instedad of 0 in <schedule> in crontab xml Dec 17, 2018 at 8:18
  • @IdhamChoudry i tried * instead of 0 still same error
    – Unknown
    Dec 17, 2018 at 8:39
  • @Parthavi try to put instance first then name in <job> tag Dec 17, 2018 at 8:55

2 Answers 2

0

For the above error check if in any chrontab.xml file u have not use instance and method as attribute

0

I Think XML Code has the Issue :-

crontab.xml

<?xml version="1.0" ?>
<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:module:Magento_Cron:etc/crontab.xsd">
    <group id="default">
        <job instance="Emarsys\Emarsys\Cron\ProductBulkExport" method="execute" name="emarsys_catalog_bulk_export">
            <schedule>0 0 30 2 3</schedule>
        </job>
    </group>
</config>

Try this

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.