Many Undefined index errors on cronjob execution

Help for integrating the Laravel package
Forum rules
Always add your Laravel, Aimeos and PHP version as well as your environment (Linux/Mac/Win)
Spam and unrelated posts will be removed immediately!
worl_d_ev_elopers
Posts: 2
Joined: 18 Oct 2018, 12:34

Many Undefined index errors on cronjob execution

Post by worl_d_ev_elopers » 18 Oct 2018, 12:42

Hi

Is there any configuration required after having run: composer require

Because I get a flood of undefined index errors when calling via cron.
e.g.

Code: Select all

Undefined index: locale.id#0 /srv/hamag_laravel/vendor/aimeos/aimeos-core/lib/mshoplib/src/MShop/Locale/Manager/Standard.php(793): Illuminate\Foundation\Bootstrap\HandleExceptions->handleError(8, 'Undefined index...', '/srv/hamag_lara...', 793, Array)
#1 /srv/hamag_laravel/vendor/aimeos/aimeos-core/lib/mshoplib/src/MShop/Locale/Manager/Standard.php(206): Aimeos\MShop\Locale\Manager\Standard->search(Object(Aimeos\MW\Criteria\SQL), Array, NULL)
#2 /srv/hamag_laravel/ext/ai-client-html/controller/jobs/src/Controller/Jobs/Customer/Email/Watch/Standard.php(64): Aimeos\MShop\Locale\Manager\Standard->searchItems(Object(Aimeos\MW\Criteria\SQL))
#3 /srv/hamag_laravel/vendor/aimeos/aimeos-laravel/src/Aimeos/Shop/Command/JobsCommand.php(69): Aimeos\Controller\Jobs\Customer\Email\Watch\Standard->run()
#4 [internal function]: Aimeos\Shop\Command\JobsCommand->Aimeos\Shop\Command\{closure}(Object(Aimeos\MShop\Context\Item\Standard), Object(Aimeos\Bootstrap), 'customer/email/...')
#5 /srv/hamag_laravel/vendor/aimeos/aimeos-core/lib/mwlib/src/MW/Process/Pcntl.php(171): call_user_func_array(Object(Closure), Array)
#6 /srv/hamag_laravel/vendor/aimeos/aimeos-core/lib/mwlib/src/MW/Process/Pcntl.php(111): Aimeos\MW\Process\Pcntl->exec(Object(Closure), Array)
#7 /srv/hamag_laravel/vendor/aimeos/aimeos-core/lib/mwlib/src/MW/Process/Decorator/Check.php(61): Aimeos\MW\Process\Pcntl->start(Object(Closure), Array, true)
#8 /srv/hamag_laravel/vendor/aimeos/aimeos-laravel/src/Aimeos/Shop/Command/JobsCommand.php(72): Aimeos\MW\Process\Decorator\Check->start(Object(Closure), Array, true)
#9 [internal function]: Aimeos\Shop\Command\JobsCommand->handle()
#10 /srv/hamag_laravel/vendor/laravel/framework/src/Illuminate/Container/BoundMethod.php(29): call_user_func_array(Array, Array)
#11 /srv/hamag_laravel/vendor/laravel/framework/src/Illuminate/Container/BoundMethod.php(87): Illuminate\Container\BoundMethod::Illuminate\Container\{closure}()
#12 /srv/hamag_laravel/vendor/laravel/framework/src/Illuminate/Container/BoundMethod.php(31): Illuminate\Container\BoundMethod::callBoundMethod(Object(Illuminate\Foundation\Application), Array, Object(Closure))
#13 /srv/hamag_laravel/vendor/laravel/framework/src/Illuminate/Container/Container.php(564): Illuminate\Container\BoundMethod::call(Object(Illuminate\Foundation\Application), Array, Array, NULL)
#14 /srv/hamag_laravel/vendor/laravel/framework/src/Illuminate/Console/Command.php(183): Illuminate\Container\Container->call(Array)
#15 /srv/hamag_laravel/vendor/symfony/console/Command/Command.php(252): Illuminate\Console\Command->execute(Object(Symfony\Component\Console\Input\ArgvInput), Object(Illuminate\Console\OutputStyle))
#16 /srv/hamag_laravel/vendor/laravel/framework/src/Illuminate/Console/Command.php(170): Symfony\Component\Console\Command\Command->run(Object(Symfony\Component\Console\Input\ArgvInput), Object(Illuminate\Console\OutputStyle))
#17 /srv/hamag_laravel/vendor/symfony/console/Application.php(865): Illuminate\Console\Command->run(Object(Symfony\Component\Console\Input\ArgvInput), Object(Symfony\Component\Console\Output\ConsoleOutput))
#18 /srv/hamag_laravel/vendor/symfony/console/Application.php(241): Symfony\Component\Console\Application->doRunCommand(Object(Aimeos\Shop\Command\JobsCommand), Object(Symfony\Component\Console\Input\ArgvInput), Object(Symfony\Component\Console\Output\ConsoleOutput))
#19 /srv/hamag_laravel/vendor/symfony/console/Application.php(143): Symfony\Component\Console\Application->doRun(Object(Symfony\Component\Console\Input\ArgvInput), Object(Symfony\Component\Console\Output\ConsoleOutput))
#20 /srv/hamag_laravel/vendor/laravel/framework/src/Illuminate/Console/Application.php(89): Symfony\Component\Console\Application->run(Object(Symfony\Component\Console\Input\ArgvInput), Object(Symfony\Component\Console\Output\ConsoleOutput))
#21 /srv/hamag_laravel/vendor/laravel/framework/src/Illuminate/Foundation/Console/Kernel.php(122): Illuminate\Console\Application->run(Object(Symfony\Component\Console\Input\ArgvInput), Object(Symfony\Component\Console\Output\ConsoleOutput))
#22 /srv/hamag_laravel/artisan(37): Illuminate\Foundation\Console\Kernel->handle(Object(Symfony\Component\Console\Input\ArgvInput), Object(Symfony\Component\Console\Output\ConsoleOutput))
#23 {main}Undefined index: service.type.id#0 /srv/hamag_laravel/vendor/aimeos/aimeos-core/lib/mshoplib/src/MShop/Common/Manager/Type/Base.php(234): Illuminate\Foundation\Bootstrap\HandleExceptions->handleError(8, 'Undefined index...', '/srv/hamag_lara...', 234, Array)
#1 /srv/hamag_laravel/vendor/aimeos/aimeos-core/lib/mshoplib/src/MShop/Service/Manager/Standard.php(638): Aimeos\MShop\Common\Manager\Type\Base->searchItems(Object(Aimeos\MW\Criteria\SQL))
#2 /srv/hamag_laravel/ext/ai-controller-jobs/controller/jobs/src/Controller/Jobs/Order/Service/Async/Standard.php(62): Aimeos\MShop\Service\Manager\Standard->searchItems(Object(Aimeos\MW\Criteria\SQL))
#3 /srv/hamag_laravel/vendor/aimeos/aimeos-laravel/src/Aimeos/Shop/Command/JobsCommand.php(69): Aimeos\Controller\Jobs\Order\Service\Async\Standard->run()
#4 [internal function]: Aimeos\Shop\Command\JobsCommand->Aimeos\Shop\Command\{closure}(Object(Aimeos\MShop\Context\Item\Standard), Object(Aimeos\Bootstrap), 'order/service/a...')
#5 /srv/hamag_laravel/vendor/aimeos/aimeos-core/lib/mwlib/src/MW/Process/Pcntl.php(171): call_user_func_array(Object(Closure), Array)
#6 /srv/hamag_laravel/vendor/aimeos/aimeos-core/lib/mwlib/src/MW/Process/Pcntl.php(111): Aimeos\MW\Process\Pcntl->exec(Object(Closure), Array)
#7 /srv/hamag_laravel/vendor/aimeos/aimeos-core/lib/mwlib/src/MW/Process/Decorator/Check.php(61): Aimeos\MW\Process\Pcntl->start(Object(Closure), Array, true)
#8 /srv/hamag_laravel/vendor/aimeos/aimeos-laravel/src/Aimeos/Shop/Command/JobsCommand.php(72): Aimeos\MW\Process\Decorator\Check->start(Object(Closure), Array, true)
#9 [internal function]: Aimeos\Shop\Command\JobsCommand->handle()
#10 /srv/hamag_laravel/vendor/laravel/framework/src/Illuminate/Container/BoundMethod.php(29): call_user_func_array(Array, Array)
#11 /srv/hamag_laravel/vendor/laravel/framework/src/Illuminate/Container/BoundMethod.php(87): Illuminate\Container\BoundMethod::Illuminate\Container\{closure}()
#12 /srv/hamag_laravel/vendor/laravel/framework/src/Illuminate/Container/BoundMethod.php(31): Illuminate\Container\BoundMethod::callBoundMethod(Object(Illuminate\Foundation\Application), Array, Object(Closure))
#13 /srv/hamag_laravel/vendor/laravel/framework/src/Illuminate/Container/Container.php(564): Illuminate\Container\BoundMethod::call(Object(Illuminate\Foundation\Application), Array, Array, NULL)
#14 /srv/hamag_laravel/vendor/laravel/framework/src/Illuminate/Console/Command.php(183): Illuminate\Container\Container->call(Array)
#15 /srv/hamag_laravel/vendor/symfony/console/Command/Command.php(252): Illuminate\Console\Command->execute(Object(Symfony\Component\Console\Input\ArgvInput), Object(Illuminate\Console\OutputStyle))
#16 /srv/hamag_laravel/vendor/laravel/framework/src/Illuminate/Console/Command.php(170): Symfony\Component\Console\Command\Command->run(Object(Symfony\Component\Console\Input\ArgvInput), Object(Illuminate\Console\OutputStyle))
#17 /srv/hamag_laravel/vendor/symfony/console/Application.php(865): Illuminate\Console\Command->run(Object(Symfony\Component\Console\Input\ArgvInput), Object(Symfony\Component\Console\Output\ConsoleOutput))
#18 /srv/hamag_laravel/vendor/symfony/console/Application.php(241): Symfony\Component\Console\Application->doRunCommand(Object(Aimeos\Shop\Command\JobsCommand), Object(Symfony\Component\Console\Input\ArgvInput), Object(Symfony\Component\Console\Output\ConsoleOutput))
#19 /srv/hamag_laravel/vendor/symfony/console/Application.php(143): Symfony\Component\Console\Application->doRun(Object(Symfony\Component\Console\Input\ArgvInput), Object(Symfony\Component\Console\Output\ConsoleOutput))
#20 /srv/hamag_laravel/vendor/laravel/framework/src/Illuminate/Console/Application.php(89): Symfony\Component\Console\Application->run(Object(Symfony\Component\Console\Input\ArgvInput), Object(Symfony\Component\Console\Output\ConsoleOutput))
#21 /srv/hamag_laravel/vendor/laravel/framework/src/Illuminate/Foundation/Console/Kernel.php(122): Illuminate\Console\Application->run(Object(Symfony\Component\Console\Input\ArgvInput), Object(Symfony\Component\Console\Output\ConsoleOutput))
#22 /srv/hamag_laravel/artisan(37): Illuminate\Foundation\Console\Kernel->handle(Object(Symfony\Component\Console\Input\ArgvInput), Object(Symfony\Component\Console\Output\ConsoleOutput))
#23 {main}
Any advice appreciated.

I tried many ways to make sure the configuration is included, e.g.

Code: Select all

Cron <root@archlinux> php -c /etc/php/php.ini /srv/hamag_laravel/artisan --env=production aimeos:jobs "customer/email/watch order/cleanup/unfinished order/service/async order/service/payment"
Aimeos stable

Code: Select all

"aimeos/aimeos-laravel": "~2017.10"
Laravel

Code: Select all

Laravel Framework 5.6.18
PHP

Code: Select all

PHP 7.2.2 (cli) (built: Jan 30 2018 19:18:38) ( NTS )
Copyright (c) 1997-2018 The PHP Group
Zend Engine v3.2.0, Copyright (c) 1998-2018 Zend Technologies

User avatar
aimeos
Administrator
Posts: 7873
Joined: 01 Jan 1970, 00:00

Re: Many Undefined index errors on cronjob execution

Post by aimeos » 21 Oct 2018, 12:09

2017.10 is the old LTS version of last year. If you want to use it for longer, you should think about buying extended LTS support from the Aimeos company.

As your problems occur in this line
https://github.com/aimeos/aimeos-core/b ... d.php#L793
I think your SQL statements doesn't match the 2017.10 code. A problem might be the APCu cache which stores the old configuration until you clear it on all web servers (which can be done by writing a script that is executed on each server instance of if you restart the web servers).
Professional support and custom implementation are available at Aimeos.com
If you like Aimeos, Image give us a star

worl_d_ev_elopers
Posts: 2
Joined: 18 Oct 2018, 12:34

Re: Many Undefined index errors on cronjob execution

Post by worl_d_ev_elopers » 22 Oct 2018, 16:17

Thank you for answering.

True, I have this issue for almost a year now since I bought the VAT extension.
In parallel to the TYPO3 setup I decided to switch to Laravel due to T3 update from 7.6 destroying Aimeos entirely (tried multiple times over the last couple of years, no luck). And as a bonus the VAT extension can be installed easily via composer (though newer T3 also use it but I personally like Neos a lot better and truth be told, few website owners really use the CMS anyway but rather let me do it, thus why not use vanilla Laravel, it's speedy symfony ;-)).

Thus I created a new site using Laravel for HAMAG earlier this year when 2017 was still the stable version. The only thing not working was the cron.artisan and thus the mails got not sent and this prevented me to put the new site online. Ever since I tried to fix but other things with higher importance needed my attention.

Finally I gave up and wanted to ask you for help.
I will set up a new version with the new stable LTS, follow the docs once again and hope it will work this time.
Now I will be smarter and only migrate the database export to be compatible (manually) _after_ everything works.

One lives and learns. ;-)
Thanks again for taking time

LG
Jan
aka faerietree
club board
worlddevelopment n.e.V.

Post Reply