aimeos / ai-controller-jobs

Aimeos e-commerce job controllers
https://aimeos.org
GNU Lesser General Public License v3.0
138 stars 17 forks source link

Duplicate entry for key 'unq_msproli_pid_dm_ty_rid_sid' INTO "mshop_product_list" #44

Closed vdbin closed 2 years ago

vdbin commented 2 years ago

Hello. I get an error when I try to run a command through the console. I'm not sure, but before the last update, this error did not occur. Maybe I'm wrong and something else caused this error.

"aimeos/aimeos-laravel": "~2022.07"
"php": "^8.0.10"
"laravel/framework": "^9.2"
Ubuntu 18.04.6 LTS
php artisan aimeos:jobs "product/bought"
SQLSTATE[23000]: Integrity constraint violation: 1062 Duplicate entry '1-product-default-6-1.' for key 'unq_msproli_pid_dm_ty_rid_sid': 
                                        INSERT INTO "mshop_product_list" ( 
                                                "parentid", "key", "type", "domain", "refid", "start", "end",
                                                "config", "pos", "status", "mtime", "editor", "siteid", "ctime"
                                        ) VALUES ( 
                                                ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?
                                        )
                                ["1","product|default|6","default","product","6",null,null,"[]",0,1,"2022-10-24 14:25:29","aimeos:jobs","1.","2022-10-24 14:25:29"]
#0 /var/www/shop/shop/vendor/aimeos/aimeos-core/src/MShop/Common/Manager/Lists/Base.php(237): Aimeos\Base\DB\Statement\DBAL\Prepared->execute()
#1 /var/www/shop/shop/vendor/aimeos/aimeos-core/src/MShop/Common/Manager/Base.php(154): Aimeos\MShop\Common\Manager\Lists\Base->saveItem()
#2 /var/www/shop/shop/vendor/aimeos/aimeos-core/src/MShop/Common/Manager/Decorator/Base.php(224): Aimeos\MShop\Common\Manager\Base->save()
#3 /var/www/shop/shop/vendor/aimeos/aimeos-core/src/MShop/Common/Manager/Decorator/Base.php(224): Aimeos\MShop\Common\Manager\Decorator\Base->save()
#4 /var/www/shop/shop/vendor/aimeos/aimeos-core/src/MShop/Common/Manager/ListsRef/Traits.php(300): Aimeos\MShop\Common\Manager\Decorator\Base->save()
#5 /var/www/shop/shop/vendor/aimeos/aimeos-core/src/MShop/Product/Manager/Standard.php(880): Aimeos\MShop\Product\Manager\Standard->saveListItems()
#6 /var/www/shop/shop/vendor/aimeos/aimeos-core/src/MShop/Common/Manager/Base.php(149): Aimeos\MShop\Product\Manager\Standard->saveItem()
#7 /var/www/shop/shop/vendor/aimeos/aimeos-core/src/MShop/Common/Manager/Decorator/Base.php(224): Aimeos\MShop\Common\Manager\Base->save()
#8 /var/www/shop/shop/vendor/aimeos/aimeos-core/src/MShop/Common/Manager/Decorator/Base.php(224): Aimeos\MShop\Common\Manager\Decorator\Base->save()
#9 /var/www/shop/shop/vendor/aimeos/ai-controller-jobs/src/Controller/Jobs/Product/Bought/Standard.php(317): Aimeos\MShop\Common\Manager\Decorator\Base->save()
#10 /var/www/shop/shop/vendor/aimeos/aimeos-laravel/src/Aimeos/Shop/Command/JobsCommand.php(54): Aimeos\Controller\Jobs\Product\Bought\Standard->run()
#11 [internal function]: Aimeos\Shop\Command\JobsCommand->Aimeos\Shop\Command\{closure}()
#12 /var/www/shop/shop/vendor/aimeos/aimeos-base/src/Process/Pcntl.php(181): call_user_func_array()
#13 /var/www/shop/shop/vendor/aimeos/aimeos-base/src/Process/Pcntl.php(116): Aimeos\Base\Process\Pcntl->exec()
#14 /var/www/shop/shop/vendor/aimeos/aimeos-base/src/Process/Decorator/Check.php(61): Aimeos\Base\Process\Pcntl->start()
#15 /var/www/shop/shop/vendor/aimeos/aimeos-laravel/src/Aimeos/Shop/Command/JobsCommand.php(63): Aimeos\Base\Process\Decorator\Check->start()
#16 [internal function]: Aimeos\Shop\Command\JobsCommand->Aimeos\Shop\Command\{closure}()
#17 /var/www/shop/shop/vendor/aimeos/aimeos-base/src/Process/Pcntl.php(181): call_user_func_array()
#18 /var/www/shop/shop/vendor/aimeos/aimeos-base/src/Process/Pcntl.php(116): Aimeos\Base\Process\Pcntl->exec()
#19 /var/www/shop/shop/vendor/aimeos/aimeos-base/src/Process/Decorator/Check.php(61): Aimeos\Base\Process\Pcntl->start()
#20 /var/www/shop/shop/vendor/aimeos/aimeos-laravel/src/Aimeos/Shop/Command/AbstractCommand.php(67): Aimeos\Base\Process\Decorator\Check->start()
#21 /var/www/shop/shop/vendor/aimeos/aimeos-laravel/src/Aimeos/Shop/Command/JobsCommand.php(69): Aimeos\Shop\Command\AbstractCommand->exec()
#22 /var/www/shop/shop/vendor/laravel/framework/src/Illuminate/Container/BoundMethod.php(36): Aimeos\Shop\Command\JobsCommand->handle()
#23 /var/www/shop/shop/vendor/laravel/framework/src/Illuminate/Container/Util.php(41): Illuminate\Container\BoundMethod::Illuminate\Container\{closure}()
#24 /var/www/shop/shop/vendor/laravel/framework/src/Illuminate/Container/BoundMethod.php(93): Illuminate\Container\Util::unwrapIfClosure()
#25 /var/www/shop/shop/vendor/laravel/framework/src/Illuminate/Container/BoundMethod.php(37): Illuminate\Container\BoundMethod::callBoundMethod()
#26 /var/www/shop/shop/vendor/laravel/framework/src/Illuminate/Container/Container.php(651): Illuminate\Container\BoundMethod::call()
#27 /var/www/shop/shop/vendor/laravel/framework/src/Illuminate/Console/Command.php(144): Illuminate\Container\Container->call()
#28 /var/www/shop/shop/vendor/symfony/console/Command/Command.php(291): Illuminate\Console\Command->execute()
#29 /var/www/shop/shop/vendor/laravel/framework/src/Illuminate/Console/Command.php(126): Symfony\Component\Console\Command\Command->run()
#30 /var/www/shop/shop/vendor/symfony/console/Application.php(1002): Illuminate\Console\Command->run()
#31 /var/www/shop/shop/vendor/symfony/console/Application.php(299): Symfony\Component\Console\Application->doRunCommand()
#32 /var/www/shop/shop/vendor/symfony/console/Application.php(171): Symfony\Component\Console\Application->doRun()
#33 /var/www/shop/shop/vendor/laravel/framework/src/Illuminate/Console/Application.php(102): Symfony\Component\Console\Application->run()
#34 /var/www/shop/shop/vendor/laravel/framework/src/Illuminate/Foundation/Console/Kernel.php(155): Illuminate\Console\Application->run()
#35 /var/www/shop/shop/artisan(37): Illuminate\Foundation\Console\Kernel->handle()
#36 {main}Process (PID "31026") failed with status "256"
aimeos commented 2 years ago

Are you using Aimeos 2022.10.x now? Did you run php artisan aimeos:setup after the update?

vdbin commented 2 years ago

Yes now Aimeos 2022.10.x. Yes, i run php artisan aimeos:setup after the update.

Even if I delete everything from the table mshop_product_list and run the command php artisan aimeos:jobs "product/bought" twice I get an error

composer show ``` composer show aimeos-extensions/myext dev-master Aimeos myext extension aimeos/ai-admin-graphql 2022.10.2 Aimeos Admin GraphQL API extension aimeos/ai-admin-jqadm 2022.10.2 Aimeos VueJS+Bootstrap admin backend aimeos/ai-admin-jsonadm 2022.10.1 Aimeos JSON admin API for backend aimeos/ai-client-html 2022.10.2 Aimeos standard HTML frontend aimeos/ai-client-jsonapi 2022.10.1 Aimeos frontend JSON REST API aimeos/ai-cms-grapesjs 2022.10.2 Aimeos GrapesJS CMS extension aimeos/ai-controller-frontend 2022.10.3 Aimeos business controller logic for frontend aimeos/ai-controller-jobs 2022.10.3 Aimeos job controllers for long running tasks aimeos/ai-laravel 2022.10.2 Laravel adapter for Aimeos e-commerce integration aimeos/aimeos-base 2022.10.2 Aimeos base layer for abstracting from host environments aimeos/aimeos-core 2022.10.3 Full-featured e-commerce components for high performance online shops aimeos/aimeos-laravel 2022.10.3 Professional, full-featured and high performance Laravel e-commerce package for online shops and complex B2B projects aimeos/macro 1.0.0 Dynamically extend objects by custom methods aimeos/map 3.2.0 Easy and elegant handling of PHP arrays as array-like collection objects similar to jQuery and Laravel Collections aimeos/upscheme 0.8.4 Database schema upgrades made easy brick/math 0.10.2 Arbitrary-precision arithmetic library dflydev/dot-access-data v3.0.1 Given a deep data structure, access data by dot notation. doctrine/cache 2.2.0 PHP Doctrine Cache library is a popular cache implementation that supports many different drivers such as redis, memcache, apc, mongodb and others. doctrine/dbal 3.5.1 Powerful PHP database abstraction layer (DBAL) with many features for database schema introspection and management. doctrine/deprecations v1.0.0 A small layer on top of trigger_error(E_USER_DEPRECATED) or PSR-3 logging with options to disable all deprecations or selectively for packages. doctrine/event-manager 1.2.0 The Doctrine Event Manager is a simple PHP event system that was built to be used with the various Doctrine projects. doctrine/inflector 2.0.6 PHP Doctrine Inflector is a small library that can perform string manipulations with regard to upper/lowercase and singular/plural forms of words. doctrine/instantiator 1.4.1 A small, lightweight utility to instantiate objects in PHP without invoking their constructors doctrine/lexer 1.2.3 PHP Doctrine Lexer parser library that can be used in Top-Down, Recursive Descent Parsers. dragonmantank/cron-expression v3.3.2 CRON for PHP: Calculate the next or previous run date and determine if a CRON expression is due egulias/email-validator 3.2.1 A library for validating emails against several RFCs enshrined/svg-sanitize 0.15.4 An SVG sanitizer for PHP fakerphp/faker v1.20.0 Faker is a PHP library that generates fake data for you. filp/whoops 2.14.5 php error handling for cool kids fruitcake/php-cors v1.2.0 Cross-origin resource sharing library for the Symfony HttpFoundation graham-campbell/result-type v1.1.0 An Implementation Of The Result Type guzzlehttp/guzzle 7.5.0 Guzzle is a PHP HTTP client library guzzlehttp/promises 1.5.2 Guzzle promises library guzzlehttp/psr7 2.4.2 PSR-7 message implementation that also provides common utility methods hamcrest/hamcrest-php v2.0.1 This is the PHP port of Hamcrest Matchers laminas/laminas-diactoros 2.20.0 PSR HTTP Message implementations laravel/breeze v1.14.1 Minimal Laravel authentication scaffolding with Blade and Tailwind. laravel/framework v9.37.0 The Laravel Framework. laravel/sail v1.16.2 Docker files for running a basic Laravel application. laravel/sanctum v2.15.1 Laravel Sanctum provides a featherweight authentication system for SPAs and simple APIs. laravel/serializable-closure v1.2.2 Laravel Serializable Closure provides an easy and secure way to serialize closures in PHP. laravel/tinker v2.7.2 Powerful REPL for the Laravel framework. league/commonmark 2.3.5 Highly-extensible PHP Markdown parser which fully supports the CommonMark spec and GitHub-Flavored Markdown (GFM) league/config v1.1.1 Define configuration arrays with strict schemas and access values with dot notation league/flysystem 3.10.2 File storage abstraction for PHP league/mime-type-detection 1.11.0 Mime-type detection for Flysystem mockery/mockery 1.5.1 Mockery is a simple yet flexible PHP mock object framework monolog/monolog 2.8.0 Sends your logs to files, sockets, inboxes, databases and various web services myclabs/deep-copy 1.11.0 Create deep copies (clones) of your objects nesbot/carbon 2.62.1 An API extension for DateTime that supports 281 different languages. nette/schema v1.2.2 📐 Nette Schema: validating data structures against a given Schema. nette/utils v3.2.8 🛠 Nette Utils: lightweight utilities for string & array manipulation, image handling, safe JSON encoding/decoding, validation, slug or strong ... nikic/php-parser v4.15.1 A PHP parser written in PHP nunomaduro/collision v6.3.1 Cli error handling for console/command-line PHP applications. nunomaduro/termwind v1.14.1 Its like Tailwind CSS, but for the console. nyholm/psr7 1.5.1 A fast PHP7 implementation of PSR-7 phar-io/manifest 2.0.3 Component for reading phar.io manifest information from a PHP Archive (PHAR) phar-io/version 3.2.1 Library for handling version information and constraints php-http/message-factory v1.0.2 Factory interfaces for PSR-7 HTTP Message phpoption/phpoption 1.9.0 Option Type for PHP phpunit/php-code-coverage 9.2.17 Library that provides collection, processing, and rendering functionality for PHP code coverage information. phpunit/php-file-iterator 3.0.6 FilterIterator implementation that filters files based on a list of suffixes. phpunit/php-invoker 3.1.1 Invoke callables with a timeout phpunit/php-text-template 2.0.4 Simple template engine. phpunit/php-timer 5.0.3 Utility class for timing phpunit/phpunit 9.5.25 The PHP Unit Testing framework. psr/cache 3.0.0 Common interface for caching libraries psr/container 2.0.2 Common Container Interface (PHP FIG PSR-11) psr/event-dispatcher 1.0.0 Standard interfaces for event handling. psr/http-client 1.0.1 Common interface for HTTP clients psr/http-factory 1.0.1 Common interfaces for PSR-7 HTTP message factories psr/http-message 1.0.1 Common interface for HTTP messages psr/log 3.0.0 Common interface for logging libraries psr/simple-cache 3.0.0 Common interfaces for simple caching psy/psysh v0.11.8 An interactive shell for modern PHP. ralouphie/getallheaders 3.0.3 A polyfill for getallheaders. ramsey/collection 1.2.2 A PHP library for representing and manipulating collections. ramsey/uuid 4.5.1 A PHP library for generating and working with universally unique identifiers (UUIDs). sebastian/cli-parser 1.0.1 Library for parsing CLI options sebastian/code-unit 1.0.8 Collection of value objects that represent the PHP code units sebastian/code-unit-reverse-lookup 2.0.3 Looks up which function or method a line of code belongs to sebastian/comparator 4.0.8 Provides the functionality to compare PHP values for equality sebastian/complexity 2.0.2 Library for calculating the complexity of PHP code units sebastian/diff 4.0.4 Diff implementation sebastian/environment 5.1.4 Provides functionality to handle HHVM/PHP environments sebastian/exporter 4.0.5 Provides the functionality to export PHP variables for visualization sebastian/global-state 5.0.5 Snapshotting of global state sebastian/lines-of-code 1.0.3 Library for counting the lines of code in PHP source code sebastian/object-enumerator 4.0.4 Traverses array structures and object graphs to enumerate all referenced objects sebastian/object-reflector 2.0.4 Allows reflection of object attributes, including inherited and non-public ones sebastian/recursion-context 4.0.4 Provides functionality to recursively process PHP variables sebastian/resource-operations 3.0.3 Provides a list of PHP built-in functions that operate on resources sebastian/type 3.2.0 Collection of value objects that represent the types of the PHP type system sebastian/version 3.0.2 Library that helps with managing the version number of Git-hosted PHP projects spatie/backtrace 1.2.1 A better backtrace spatie/flare-client-php 1.3.0 Send PHP errors to Flare spatie/ignition 1.4.1 A beautiful error page for PHP applications. spatie/laravel-ignition 1.6.0 A beautiful error page for Laravel applications. symfony/console v6.0.14 Eases the creation of beautiful and testable command line interfaces symfony/css-selector v6.0.11 Converts CSS selectors to XPath expressions symfony/deprecation-contracts v3.0.2 A generic function and convention to trigger deprecation notices symfony/error-handler v6.0.14 Provides tools to manage errors and ease debugging PHP code symfony/event-dispatcher v6.0.9 Provides tools that allow your application components to communicate with each other by dispatching events and listening to them symfony/event-dispatcher-contracts v3.0.2 Generic abstractions related to dispatching event symfony/finder v6.0.11 Finds files and directories via an intuitive fluent interface symfony/http-foundation v6.0.14 Defines an object-oriented layer for the HTTP specification symfony/http-kernel v6.0.14 Provides a structured process for converting a Request into a Response symfony/mailer v6.0.13 Helps sending emails symfony/mime v6.0.14 Allows manipulating MIME messages symfony/polyfill-ctype v1.26.0 Symfony polyfill for ctype functions symfony/polyfill-intl-grapheme v1.26.0 Symfony polyfill for intl's grapheme_* functions symfony/polyfill-intl-idn v1.26.0 Symfony polyfill for intl's idn_to_ascii and idn_to_utf8 functions symfony/polyfill-intl-normalizer v1.26.0 Symfony polyfill for intl's Normalizer class and related functions symfony/polyfill-mbstring v1.26.0 Symfony polyfill for the Mbstring extension symfony/polyfill-php72 v1.26.0 Symfony polyfill backporting some PHP 7.2+ features to lower PHP versions symfony/polyfill-php80 v1.26.0 Symfony polyfill backporting some PHP 8.0+ features to lower PHP versions symfony/polyfill-php81 v1.26.0 Symfony polyfill backporting some PHP 8.1+ features to lower PHP versions symfony/polyfill-uuid v1.26.0 Symfony polyfill for uuid functions symfony/process v6.0.11 Executes commands in sub-processes symfony/psr-http-message-bridge v2.1.3 PSR HTTP message bridge symfony/routing v6.0.11 Maps an HTTP request to a set of configuration variables symfony/service-contracts v3.0.2 Generic abstractions related to writing services symfony/string v6.0.14 Provides an object-oriented API to strings and deals with bytes, UTF-8 code points and grapheme clusters in a unified way symfony/translation v6.0.14 Provides tools to internationalize your application symfony/translation-contracts v3.0.2 Generic abstractions related to translation symfony/uid v6.0.13 Provides an object-oriented API to generate and represent UIDs symfony/var-dumper v6.0.14 Provides mechanisms for walking through any arbitrary PHP variable tecnickcom/tcpdf 6.5.0 TCPDF is a PHP class for generating PDF documents and barcodes. theseer/tokenizer 1.2.1 A small library for converting tokenized PHP source code into XML and potentially other formats tijsverkoyen/css-to-inline-styles 2.2.5 CssToInlineStyles is a class that enables you to convert HTML-pages/files into HTML-pages/files with inline styles. This is very useful when you'r... vlucas/phpdotenv v5.5.0 Loads environment variables from `.env` to `getenv()`, `$_ENV` and `$_SERVER` automagically. voku/portable-ascii 2.0.1 Portable ASCII library - performance optimized (ascii) string functions for php. webmozart/assert 1.11.0 Assertions to validate method input/output with nice error messages. webonyx/graphql-php v15.0.0-alpha.2 A PHP port of GraphQL reference implementation ```
aimeos commented 2 years ago

We can reproduce the problem but haven't found the root cause yet

aimeos commented 2 years ago

The problem has been fixed now. Can you please run:

composer req aimeos/ai-controller-jobs:2022.10.x-dev

and test if it also works for you?

vdbin commented 2 years ago

Sorry for the long wait for a reply. Yes, there is no more error. Thanks for the good work