akeneo / magento2-connector-community

Akeneo Connector for Magento 2
Open Software License 3.0
81 stars 88 forks source link

Class "Laminas\Diactoros\Response" not found #626

Open grthi opened 1 year ago

grthi commented 1 year ago

Hello,

On a Magento 2.4.5-p1, with akeneo connector in version 103.3.1 installed

Environment and configuration

  1. Magento 2.4.5-p1
  2. akeneo connector 103.3.1
  3. php 8.1

Steps to reproduce

  1. Play command "bin/magento akeneo_connector:import --code=product >> /var/www/html/var/log/magento. cron.akeneo_product.log"

Expected result

  1. Must import all images

Actual result

  1. Work for first items, but stop after some imports and crash this error

    Path to log file : /var/log/akeneo_connector/product-import.log Family imported in this batch: Diffuseurs [14:01:49] Fill temporary table [14:01:55] 116 line(s) found [14:01:55] Product Model Import [14:01:55] No results from Akeneo [14:01:55] Family Variant Import [14:01:55] completed [14:01:55] Add required data [14:01:55] completed [14:01:55] Create configurables [14:01:55] completed [14:01:55] Create empty attributes columns [14:02:00] completed [14:02:00] Create Options for Variant Metrics Attributes [14:02:01] completed [14:02:01] Check already imported entities [14:02:01] completed [14:02:01] Match code with Magento ID [14:02:01] completed [14:02:01] Match family code with Magento ID [14:02:01] completed [14:02:01] Update column values for options [14:02:01] completed [14:02:01] Create or update product entities [14:02:01] completed [14:02:01] Import file attributes [14:02:01] Akeneo Files Attributes is empty [14:02:01] Set values to attributes [14:02:02] completed [14:02:02] Link configurable with children [14:02:02] completed [14:02:02] Link simple products with configurable products [14:02:03] completed [14:02:03] Set products to websites [14:02:03] completed [14:02:03] Set products to categories [14:02:03] completed [14:02:03] Init stock [14:02:03] completed [14:02:03] Update related, up-sell and cross-sell products [14:02:03] completed [14:02:03] Set grouped products relations [14:02:03] completed [14:02:03] Set Url Rewrite [14:02:03] completed [14:02:03] Import image attributes Class "Laminas\Diactoros\Response" not found#0 /var/www/html/vendor/akeneo/module-magento2-connector-community/Job/Product.php(3839): Akeneo\Pim\ApiClient\Api\ProductMediaFileApi->download('15186980_6')

    1 /var/www/html/vendor/akeneo/module-magento2-connector-community/Executor/JobExecutor.php(530): Akeneo\Connector\Job\Product->importMedia()

    2 /var/www/html/vendor/akeneo/module-magento2-connector-community/Executor/JobExecutor.php(425): Akeneo\Connector\Executor\JobExecutor->executeStep()

    3 /var/www/html/vendor/akeneo/module-magento2-connector-community/Executor/JobExecutor.php(325): Akeneo\Connector\Executor\JobExecutor->run('Diffuseurs')

    4 /var/www/html/generated/code/Akeneo/Connector/Executor/JobExecutor/Proxy.php(119): Akeneo\Connector\Executor\JobExecutor->execute('product', Object(Symfony\Component\Console\Output\ConsoleOutput))

    5 /var/www/html/vendor/akeneo/module-magento2-connector-community/Console/Command/AkeneoConnectorImportCommand.php(110): Akeneo\Connector\Executor\JobExecutor\Proxy->execute('product', Object(Symfony\Component\Console\Output\ConsoleOutput))

    6 /var/www/html/vendor/symfony/console/Command/Command.php(255): Akeneo\Connector\Console\Command\AkeneoConnectorImportCommand->execute(Object(Symfony\Component\Console\Input\ArgvInput), Object(Symfony\Component\Console\Output\ConsoleOutput))

    7 /var/www/html/vendor/magento/framework/Interception/Interceptor.php(58): Symfony\Component\Console\Command\Command->run(Object(Symfony\Component\Console\Input\ArgvInput), Object(Symfony\Component\Console\Output\ConsoleOutput))

    8 /var/www/html/vendor/magento/framework/Interception/Interceptor.php(138): Akeneo\Connector\Console\Command\AkeneoConnectorImportCommand\Interceptor->___callParent('run', Array)

    9 /var/www/html/vendor/magento/framework/Interception/Interceptor.php(153): Akeneo\Connector\Console\Command\AkeneoConnectorImportCommand\Interceptor->Magento\Framework\Interception{closure}(Object(Symfony\Component\Console\Input\ArgvInput), Object(Symfony\Component\Console\Output\ConsoleOutput))

    10 /var/www/html/generated/code/Akeneo/Connector/Console/Command/AkeneoConnectorImportCommand/Interceptor.php(104): Akeneo\Connector\Console\Command\AkeneoConnectorImportCommand\Interceptor->___callPlugins('run', Array, Array)

    11 /var/www/html/vendor/symfony/console/Application.php(1021): Akeneo\Connector\Console\Command\AkeneoConnectorImportCommand\Interceptor->run(Object(Symfony\Component\Console\Input\ArgvInput), Object(Symfony\Component\Console\Output\ConsoleOutput))

    12 /var/www/html/vendor/symfony/console/Application.php(275): Symfony\Component\Console\Application->doRunCommand(Object(Akeneo\Connector\Console\Command\AkeneoConnectorImportCommand\Interceptor), Object(Symfony\Component\Console\Input\ArgvInput), Object(Symfony\Component\Console\Output\ConsoleOutput))

    13 /var/www/html/vendor/magento/framework/Console/Cli.php(116): Symfony\Component\Console\Application->doRun(Object(Symfony\Component\Console\Input\ArgvInput), Object(Symfony\Component\Console\Output\ConsoleOutput))

    14 /var/www/html/vendor/symfony/console/Application.php(149): Magento\Framework\Console\Cli->doRun(Object(Symfony\Component\Console\Input\ArgvInput), Object(Symfony\Component\Console\Output\ConsoleOutput))

    15 /var/www/html/bin/magento(23): Symfony\Component\Console\Application->run()

    16 {main}

In fact yes I see in this file => vendor/akeneo/api-php-client/src/Api/ProductMediaFileApi.php

This code:

if (isset($asset['values']['reference'][0]['_links']['download']['href'])) { $downloadUrl = parse_url( $asset['values']['reference'][0]['_links']['download']['href'], PHP_URL_PATH ); return $this->resourceClient->getStreamedResource($downloadUrl); } return new \Laminas\Diactoros\Response;

So there is missing dependencies in composer.json for this module I must manually add to fix the issue => composer require laminas/laminas-diactoros

Perhaps it is an other problem, but was missing dependency like I see.

Thanks