Unable to import product: Invalid type "size" (attribute)

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!
alesconti
Posts: 11
Joined: 24 Feb 2021, 12:55

Unable to import product: Invalid type "size" (attribute)

Post by alesconti » 24 Feb 2021, 13:03

I can't import products with attributes.
I have tried in every way to change the mapping in the shop.php file but nothing works.
I always get the same error.
------
This is the configuration of my shop.php

'controller' => [
'jobs' => [
'product' => [
'import' => [
'csv' => [
'location' => storage_path() . '/tmp',
'container' =>[
'type' => 'Directory',
'content' => 'CSV',
],
'mapping' => [
'item' => [
0 => 'product.code', // e.g. unique EAN code
1 => 'product.label', // UTF-8 encoded text, also used as product name
2 => 'product.type', // type of the product, e.g. "default" or "selection"
3 => 'product.status', // enabled (1) or disabled (0)
],
'text' => [
4 => 'text.type',
5 => 'text.content',
6 => 'text.type',
7 => 'text.content',
],
'media' => [
8 => 'media.url',
],
'price' => [
11 => 'price.currencyid',
12 => 'price.quantity',
13 => 'price.value',
14 => 'price.taxrate',
],
'attribute' => [
9 => 'attribute.type',
10 => 'attribute.code',
],
],

],
],
],
],
],
--------------
Command line:
php artisan aimeos:jobs "product/import/csv" "default"

Error received:
Executing the Aimeos jobs for "default"
Invalid product lines in "/var/www/html/newb2b/storage/tmp": 1/1#0 /var/www/html/newb2b/vendor/aimeos/aimeos-laravel/src/Aimeos/Shop/Command/JobsCommand.php(76): Aimeos\Controller\Jobs\Product\Import\Csv\Standard->run()
#1 [internal function]: Aimeos\Shop\Command\JobsCommand->Aimeos\Shop\Command\{closure}(Object(Aimeos\MShop\Context\Item\Standard), Object(Aimeos\Bootstrap), 'product/import/...')
#2 /var/www/html/newb2b/vendor/aimeos/aimeos-core/lib/mwlib/src/MW/Process/Pcntl.php(176): call_user_func_array(Object(Closure), Array)
#3 /var/www/html/newb2b/vendor/aimeos/aimeos-core/lib/mwlib/src/MW/Process/Pcntl.php(111): Aimeos\MW\Process\Pcntl->exec(Object(Closure), Array)
#4 /var/www/html/newb2b/vendor/aimeos/aimeos-core/lib/mwlib/src/MW/Process/Decorator/Check.php(61): Aimeos\MW\Process\Pcntl->start(Object(Closure), Array, false)
#5 /var/www/html/newb2b/vendor/aimeos/aimeos-laravel/src/Aimeos/Shop/Command/JobsCommand.php(79): Aimeos\MW\Process\Decorator\Check->start(Object(Closure), Array, false)
#6 /var/www/html/newb2b/vendor/laravel/framework/src/Illuminate/Container/BoundMethod.php(36): Aimeos\Shop\Command\JobsCommand->handle()
#7 /var/www/html/newb2b/vendor/laravel/framework/src/Illuminate/Container/Util.php(37): Illuminate\Container\BoundMethod::Illuminate\Container\{closure}()
#8 /var/www/html/newb2b/vendor/laravel/framework/src/Illuminate/Container/BoundMethod.php(93): Illuminate\Container\Util::unwrapIfClosure(Object(Closure))
#9 /var/www/html/newb2b/vendor/laravel/framework/src/Illuminate/Container/BoundMethod.php(37): Illuminate\Container\BoundMethod::callBoundMethod(Object(Illuminate\Foundation\Application), Array, Object(Closure))
#10 /var/www/html/newb2b/vendor/laravel/framework/src/Illuminate/Container/Container.php(590): Illuminate\Container\BoundMethod::call(Object(Illuminate\Foundation\Application), Array, Array, NULL)
#11 /var/www/html/newb2b/vendor/laravel/framework/src/Illuminate/Console/Command.php(134): Illuminate\Container\Container->call(Array)
#12 /var/www/html/newb2b/vendor/symfony/console/Command/Command.php(255): Illuminate\Console\Command->execute(Object(Symfony\Component\Console\Input\ArgvInput), Object(Illuminate\Console\OutputStyle))
#13 /var/www/html/newb2b/vendor/laravel/framework/src/Illuminate/Console/Command.php(121): Symfony\Component\Console\Command\Command->run(Object(Symfony\Component\Console\Input\ArgvInput), Object(Illuminate\Console\OutputStyle))
#14 /var/www/html/newb2b/vendor/symfony/console/Application.php(1009): Illuminate\Console\Command->run(Object(Symfony\Component\Console\Input\ArgvInput), Object(Symfony\Component\Console\Output\ConsoleOutput))
#15 /var/www/html/newb2b/vendor/symfony/console/Application.php(273): Symfony\Component\Console\Application->doRunCommand(Object(Aimeos\Shop\Command\JobsCommand), Object(Symfony\Component\Console\Input\ArgvInput), Object(Symfony\Component\Console\Output\ConsoleOutput))
#16 /var/www/html/newb2b/vendor/symfony/console/Application.php(149): Symfony\Component\Console\Application->doRun(Object(Symfony\Component\Console\Input\ArgvInput), Object(Symfony\Component\Console\Output\ConsoleOutput))
#17 /var/www/html/newb2b/vendor/laravel/framework/src/Illuminate/Console/Application.php(93): Symfony\Component\Console\Application->run(Object(Symfony\Component\Console\Input\ArgvInput), Object(Symfony\Component\Console\Output\ConsoleOutput))
#18 /var/www/html/newb2b/vendor/laravel/framework/src/Illuminate/Foundation/Console/Kernel.php(131): Illuminate\Console\Application->run(Object(Symfony\Component\Console\Input\ArgvInput), Object(Symfony\Component\Console\Output\ConsoleOutput))
#19 /var/www/html/newb2b/artisan(37): Illuminate\Foundation\Console\Kernel->handle(Object(Symfony\Component\Console\Input\ArgvInput), Object(Symfony\Component\Console\Output\ConsoleOutput))
#20 {main}Process (PID "21872") failed with status "256"
--------------

In attach you can find the example file with just one product and screenshots about my attribute configuration in admin page.
Attachments
Schermata 2021-02-24 alle 14.01.33.png
Schermata 2021-02-24 alle 14.01.33.png (86.68 KiB) Viewed 969 times
Schermata 2021-02-24 alle 14.01.46.png
Schermata 2021-02-24 alle 14.01.46.png (44.2 KiB) Viewed 969 times
products_laravel_b2b.csv.zip
(798 Bytes) Downloaded 92 times

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

Re: Unable to import product: Invalid type "size" (attribute)

Post by aimeos » 26 Feb 2021, 07:43

Check in the Log panel of the admin backend (extended left navigation) for the error details after you've executed the product/import/csv command (or have a look into the madmin_log table). There, a detailed error message is available.
Professional support and custom implementation are available at Aimeos.com
If you like Aimeos, Image give us a star

alesconti
Posts: 11
Joined: 24 Feb 2021, 12:55

Re: Unable to import product: Invalid type "size" (attribute)

Post by alesconti » 27 Feb 2021, 12:09

I have found the problem.
Attribute types must be in "product" Domain and not in "attribute" Domain.
Solved !

thanks
Alessandro

Post Reply