# \[GELÖST\] CronJob: ParameterMissingException

**URL:** <https://forum.shopware.com/t/gelost-cronjob-parametermissingexception/56707>\
**Category:** Programmierung\
**Created:** [27. November 2018 um 09:30 UTC](https://forum.shopware.com/t/gelost-cronjob-parametermissingexception/56707 "2018-11-27T09:30:07Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![ent\_dev](https://avatars.discourse-cdn.com/v4/letter/e/45deac/32.png) [@ent\_dev](https://forum.shopware.com/u/ent_dev)\
**Post date:** [27. November 2018 um 09:30 UTC](https://forum.shopware.com/t/gelost-cronjob-parametermissingexception/56707/1 "2018-11-27T09:30:07Z")

</div>

Hallo zusammen,

wir lassen täglich einen Produktimport-CronJob laufen, er lief bis dato immer durch.

Jedoch wirft er seit heute morgen einen Fehler:

![](https://europe1.discourse-cdn.com/flex013/uploads/shopware/original/2X/8/80aba62e3c55692385a5eb98ed5915394d8d80e6.png)

Im Backend bekommen wir folgende Meldung:

```
array (
  'error' => '',
)

```

Kann ich irgendwo mehr zu dem Fehler finden?

&nbsp;

&nbsp;

EDIT Lösung:

Exception mit Try-Catch-Block behandelt

---

<div class="post-metadata">

**Author:** ![shyim](https://dub1.discourse-cdn.com/flex013/user_avatar/forum.shopware.com/shyim/32/7681_2.png) [@shyim](https://forum.shopware.com/u/shyim)\
**Post date:** [27. November 2018 um 09:51 UTC](https://forum.shopware.com/t/gelost-cronjob-parametermissingexception/56707/2 "2018-11-27T09:51:45Z")

</div>

mach mal php bin/console sw:cron:run -vvv

---

<div class="post-metadata">

**Author:** ![ent\_dev](https://avatars.discourse-cdn.com/v4/letter/e/45deac/32.png) [@ent\_dev](https://forum.shopware.com/u/ent_dev)\
**Post date:** [27. November 2018 um 10:02 UTC](https://forum.shopware.com/t/gelost-cronjob-parametermissingexception/56707/3 "2018-11-27T10:02:59Z")

</div>

> [@Shyim schrieb:](https://forum.shopware.com/profile/20792/Shyim "Shyim")
> 
> mach mal php bin/console sw:cron:run -vvv

Hier der Exception trace:

```
 () at /fakepath/engine/Shopware/Components/Api/Resource/Article.php:97
 Shopware\Components\Api\Resource\Article->getIdFromNumber() at /fakepath/engine/Shopware/Components/Api/Resource/Article.php:120
 Shopware\Components\Api\Resource\Article->getOneByNumber() at /fakepath/engine/Shopware/Plugins/Community/Frontend/Import/Models/ImportProducts.php:554
 Shopware_Plugins_Frontend_Import_Models_ImportProducts->declareResourcen() at /fakepath/engine/Shopware/Plugins/Community/Frontend/Import/Models/ImportProducts.php:53
 Shopware_Plugins_Frontend_Import_Models_ImportProducts->start() at /fakepath/engine/Shopware/Plugins/Community/Frontend/Import/Bootstrap.php:141
 Shopware_Plugins_Frontend_Import_Bootstrap->onImportProducts() at /fakepath/engine/Library/Enlight/Event/Handler/Plugin.php:149
 Enlight_Event_Handler_Plugin->execute() at /fakepath/master/engine/Library/Enlight/Event/EventManager.php:251
 Enlight_Event_EventManager->notifyUntil() at /fakepath/engine/Library/Enlight/Components/Cron/Manager.php:243
 Enlight_Components_Cron_Manager->runJob() at /fakepath/engine/Shopware/Commands/CronRunCommand.php:75
 Shopware\Commands\CronRunCommand->execute() at /fakepath/vendor/symfony/console/Command/Command.php:259
 Symfony\Component\Console\Command\Command->run() at /fakepath/vendor/symfony/console/Application.php:878
 Symfony\Component\Console\Application->doRunCommand() at /fakepath/vendor/symfony/console/Application.php:195
 Symfony\Component\Console\Application->doRun() at /fakepath/engine/Shopware/Components/Console/Application.php:120
 Shopware\Components\Console\Application->doRun() at /fakepath/vendor/symfony/console/Application.php:126
 Symfony\Component\Console\Application->run() at /fakepath/bin/console:38

```

Dann ist das die entsprechende Stelle warum die Exception geworfen wird: (/fakpath/engine/Shopware/Components/Api/Resource/Article.php)

```
 public function getIdFromNumber($number)
    {
        if (empty($number)) {
            throw new ApiException\ParameterMissingException();
        }

[...]

```

&nbsp;

---

<div class="post-metadata">

**Author:** ![shyim](https://dub1.discourse-cdn.com/flex013/user_avatar/forum.shopware.com/shyim/32/7681_2.png) [@shyim](https://forum.shopware.com/u/shyim)\
**Post date:** [27. November 2018 um 10:21 UTC](https://forum.shopware.com/t/gelost-cronjob-parametermissingexception/56707/4 "2018-11-27T10:21:03Z")

</div>

Da wird die Exception der API nicht abgefangen vom Plugin, wenn ein gefordertes Artikel nicht da ist.

---

<div class="post-metadata">

**Author:** ![ent\_dev](https://avatars.discourse-cdn.com/v4/letter/e/45deac/32.png) [@ent\_dev](https://forum.shopware.com/u/ent_dev)\
**Post date:** [27. November 2018 um 12:12 UTC](https://forum.shopware.com/t/gelost-cronjob-parametermissingexception/56707/5 "2018-11-27T12:12:03Z")

</div>

> [@Shyim schrieb:](https://forum.shopware.com/profile/20792/Shyim "Shyim")
> 
> Da wird die Exception der API nicht abgefangen vom Plugin, wenn ein gefordertes Artikel nicht da ist.

Komischerweise kam dieses Fehlerbild sonst nie
