I created a user on AWS and gave the right permissions. Then integrated API key and secret in config.

What did I do wrong? This message is the same when I put false credentials, meaning to me there is an access problem... I made it work on D9. Is that the reason?

Thanks folks!

I always get this error Warning: Attempt to read property "error" on string in Drupal\auto_node_translate\AmazonTranslateApi->translate() (line 64 of modules/contrib/auto_node_translate/src/AmazonTranslateApi.php).

Drupal\auto_node_translate\AmazonTranslateApi->translate('Vos preuves sont en sécurité pour toujours', 'fr', 'en', Array) (Line: 335)
Drupal\auto_node_translate\Form\TranslationForm->translateTextField(Object, 'string', Object, 'fr', 'en') (Line: 201)
Drupal\auto_node_translate\Form\TranslationForm->autoNodeTranslateNode(Object, 'en') (Line: 168)
Drupal\auto_node_translate\Form\TranslationForm->submitForm(Array, Object)
call_user_func_array(Array, Array) (Line: 129)
Drupal\Core\Form\FormSubmitter->executeSubmitHandlers(Array, Object) (Line: 67)
Drupal\Core\Form\FormSubmitter->doSubmitForm(Array, Object) (Line: 597)
Drupal\Core\Form\FormBuilder->processForm('auto_node_translate_form', Array, Object) (Line: 325)
Drupal\Core\Form\FormBuilder->buildForm(Object, Object) (Line: 73)
Drupal\Core\Controller\FormController->getContentResult(Object, Object)
call_user_func_array(Array, Array) (Line: 123)
Drupal\Core\EventSubscriber\EarlyRenderingControllerWrapperSubscriber->Drupal\Core\EventSubscriber\{closure}() (Line: 627)
Drupal\Core\Render\Renderer->executeInRenderContext(Object, Object) (Line: 124)
Drupal\Core\EventSubscriber\EarlyRenderingControllerWrapperSubscriber->wrapControllerExecutionInRenderContext(Array, Array) (Line: 97)
Drupal\Core\EventSubscriber\EarlyRenderingControllerWrapperSubscriber->Drupal\Core\EventSubscriber\{closure}() (Line: 181)
Symfony\Component\HttpKernel\HttpKernel->handleRaw(Object, 1) (Line: 76)
Symfony\Component\HttpKernel\HttpKernel->handle(Object, 1, 1) (Line: 58)
Drupal\Core\StackMiddleware\Session->handle(Object, 1, 1) (Line: 48)
Drupal\Core\StackMiddleware\KernelPreHandle->handle(Object, 1, 1) (Line: 28)
Drupal\Core\StackMiddleware\ContentLength->handle(Object, 1, 1) (Line: 32)
Drupal\big_pipe\StackMiddleware\ContentLength->handle(Object, 1, 1) (Line: 106)
Drupal\page_cache\StackMiddleware\PageCache->pass(Object, 1, 1) (Line: 85)
Drupal\page_cache\StackMiddleware\PageCache->handle(Object, 1, 1) (Line: 48)
Drupal\Core\StackMiddleware\ReverseProxyMiddleware->handle(Object, 1, 1) (Line: 51)
Drupal\Core\StackMiddleware\NegotiationMiddleware->handle(Object, 1, 1) (Line: 36)
Drupal\Core\StackMiddleware\AjaxPageState->handle(Object, 1, 1) (Line: 51)
Drupal\Core\StackMiddleware\StackedHttpKernel->handle(Object, 1, 1) (Line: 704)
Drupal\Core\DrupalKernel->handle(Object) (Line: 19)

Warning: Attempt to read property "code" on null in Drupal\auto_node_translate\AmazonTranslateApi->translate() (line 64 of modules/contrib/auto_node_translate/src/AmazonTranslateApi.php).
Warning: Attempt to read property "error" on string in Drupal\auto_node_translate\AmazonTranslateApi->translate() (line 65 of modules/contrib/auto_node_translate/src/AmazonTranslateApi.php).
Warning: Attempt to read property "message" on null in Drupal\auto_node_translate\AmazonTranslateApi->translate() (line 65 of modules/contrib/auto_node_translate/src/AmazonTranslateApi.php).
Error :
Warning: Attempt to read property "error" on string in Drupal\auto_node_translate\AmazonTranslateApi->translate() (line 64 of modules/contrib/auto_node_translate/src/AmazonTranslateApi.php).
Warning: Attempt to read property "code" on null in Drupal\auto_node_translate\AmazonTranslateApi->translate() (line 64 of modules/contrib/auto_node_translate/src/AmazonTranslateApi.php).
Warning: Attempt to read property "error" on string in Drupal\auto_node_translate\AmazonTranslateApi->translate() (line 65 of modules/contrib/auto_node_translate/src/AmazonTranslateApi.php).
Warning: Attempt to read property "message" on null in Drupal\auto_node_translate\AmazonTranslateApi->translate() (line 65 of modules/contrib/auto_node_translate/src/AmazonTranslateApi.php).

Comments

DudeWeb created an issue. See original summary.

dudeweb’s picture

looks like the key I created did not have enough privileges.

As well I installed the sdk (composer require aws/aws-sdk-php)

Works in D9, I am positive it will work in D10. Keep you updated.

jmauricio’s picture

OK, thanks, we will try to update the documentation in how to get the keys, i think its outdated

jmauricio’s picture

Status: Active » Needs review

  • jmauricio committed 6b320ac8 on 1.0.x
    Issue #3416487 by DudeWeb, jmauricio: D10 Amazon Translate
    
jmauricio’s picture

Version: 2.1.8 » 2.1.9

@DudeWeb just pushed a fix for better error handling

jmauricio’s picture

jmauricio’s picture

Status: Fixed » Closed (fixed)