akeneo / transporteo

Migration Tool for Akeneo PIM from 1.7 to 2.0
Other
8 stars 7 forks source link

You are not allowed to access the web API (on destination?) #106

Open adamrandazzo opened 6 years ago

adamrandazzo commented 6 years ago

Sorry for the issue per day.. After working through my previous issues, I am receiving the following on alpha3.

Migrating products data...

  [Akeneo\Pim\Exception\ClientErrorHttpException (403)]
  You are not allowed to access the web API.

Exception trace:
 () at /root/transporteo/vendor/akeneo/api-php-client/src/Client/HttpExceptionHandler.php:57
 Akeneo\Pim\Client\HttpExceptionHandler->transformResponseToException() at /root/transporteo/vendor/akeneo/api-php-client/src/Client/HttpClient.php:46
 Akeneo\Pim\Client\HttpClient->sendRequest() at /root/transporteo/vendor/akeneo/api-php-client/src/Client/AuthenticatedHttpClient.php:67
 Akeneo\Pim\Client\AuthenticatedHttpClient->sendRequest() at /root/transporteo/vendor/akeneo/api-php-client/src/Client/ResourceClient.php:179
 Akeneo\Pim\Client\ResourceClient->upsertResourceList() at /root/transporteo/vendor/akeneo/api-php-client/src/Api/ProductApi.php:111
 Akeneo\Pim\Api\ProductApi->upsertList() at /root/transporteo/src/Infrastructure/Cli/ApiCommandExecutor.php:55
 Akeneo\PimMigration\Infrastructure\Cli\ApiCommandExecutor->executeCommandFromApiClient() at /root/transporteo/src/Infrastructure/Cli/ApiCommandExecutor.php:40
 Akeneo\PimMigration\Infrastructure\Cli\ApiCommandExecutor->execute() at /root/transporteo/src/Infrastructure/Cli/LocalConsole.php:62
 Akeneo\PimMigration\Infrastructure\Cli\LocalConsole->execute() at /root/transporteo/src/Domain/Command/ChainedConsole.php:23
 Akeneo\PimMigration\Domain\Command\ChainedConsole->execute() at /root/transporteo/src/Domain/MigrationStep/s140_ProductMigration/ProductMigrator.php:86
 Akeneo\PimMigration\Domain\MigrationStep\s140_ProductMigration\ProductMigrator->upsertProducts() at /root/transporteo/src/Domain/MigrationStep/s140_ProductMigration/ProductMigrator.php:71
 Akeneo\PimMigration\Domain\MigrationStep\s140_ProductMigration\ProductMigrator->migrateProducts() at /root/transporteo/src/Domain/MigrationStep/s140_ProductMigration/ProductMigrator.php:56
 Akeneo\PimMigration\Domain\MigrationStep\s140_ProductMigration\ProductMigrator->migrate() at /root/transporteo/src/Infrastructure/MigrationStep/S140FromDestinationPimReferenceDataMigratedToDestinationPimProductMigrated.php:45
 Akeneo\PimMigration\Infrastructure\MigrationStep\S140FromDestinationPimReferenceDataMigratedToDestinationPimProductMigrated->onDestinationPimProductMigration() at n/a:n/a
 call_user_func() at /root/transporteo/vendor/symfony/event-dispatcher/EventDispatcher.php:212
 Symfony\Component\EventDispatcher\EventDispatcher->doDispatch() at /root/transporteo/vendor/symfony/event-dispatcher/EventDispatcher.php:44
 Symfony\Component\EventDispatcher\EventDispatcher->dispatch() at /root/transporteo/vendor/symfony/workflow/Workflow.php:256
 Symfony\Component\Workflow\Workflow->transition() at /root/transporteo/vendor/symfony/workflow/Workflow.php:137
 Symfony\Component\Workflow\Workflow->apply() at /root/transporteo/src/Infrastructure/TransporteoStateMachine.php:97
 Akeneo\PimMigration\Infrastructure\TransporteoStateMachine->start() at /root/transporteo/src/Infrastructure/UserInterface/Cli/Transporteo.php:44
 Akeneo\PimMigration\Infrastructure\UserInterface\Cli\Transporteo->execute() at /root/transporteo/vendor/symfony/console/Command/Command.php:264
 Symfony\Component\Console\Command\Command->run() at /root/transporteo/vendor/symfony/console/Application.php:887
 Symfony\Component\Console\Application->doRunCommand() at /root/transporteo/vendor/symfony/console/Application.php:223
 Symfony\Component\Console\Application->doRun() at /root/transporteo/vendor/symfony/console/Application.php:130
 Symfony\Component\Console\Application->run() at /root/transporteo/Transporteo.php:17

I have confirmed that I am able to connect to the source PIM via the API using the same client_id/secret and username/password via a test implementation of the akeneo-api-client running from the same server.

Based on the stack trace, is this happening at the destination?

ahocquard commented 6 years ago

Hello,

Is it a CE or a EE project? Do you know the endpoint responsible of this problem?

ferdyb commented 6 years ago

Same problem here, exact same message. Moving CE project from 1.7 to 2.0 . Happens when it starts on migrating products data (the rest has been imported in the 2.0 environment). Web API works fine on my .NET client.

ferdyb commented 6 years ago

Ok solved this - the API access property on the web api role wasn't set in migration. After setting this manually and rerunning transporteo my products got imported.

adamrandazzo commented 6 years ago

Hi @ferdyb where did you make this setting change? Thanks for the help.

ferdyb commented 6 years ago

Hi @adamrandazzo, after the first time you executed Transporteo, users and roles are copied from your source pim, but not the property for web api access. So after the first import, log in on the destination 2.0 pim, go to System -> Roles and select the role which handles Web API access for you. On the third tab you can set the right permissions. After this you can rerun Transporteo.

adamrandazzo commented 6 years ago

Thank you @ferdyb - this worked and all of my data was imported.