Skip to content
This repository has been archived by the owner on Jan 16, 2024. It is now read-only.

make error: The LWA response body indicated an unrecoverable error: invalid_grant #2

Closed
boyce-xx opened this issue Apr 5, 2017 · 4 comments

Comments

@boyce-xx
Copy link

boyce-xx commented Apr 5, 2017

I followed the steps in README file, but I encountered a problem at the last step: invalid_grant, my refreshToken is fresh and valid, please help, what‘s my errors?

king@wks:~/Project/DB20_Linux/Alexa_Make$ make all integration
[ 4%] Built target gmock_main
[ 7%] Built target gmock
[ 9%] Built target gtest
[ 11%] Built target gtest_main
[ 23%] Built target AVSUtils
[ 36%] Built target ACL
Scanning dependencies of target AuthDelegate
[ 37%] Building CXX object AuthDelegate/src/CMakeFiles/AuthDelegate.dir/Config.cpp.o
[ 38%] Linking CXX shared library libAuthDelegate.so
[ 40%] Built target AuthDelegate
[ 41%] Linking CXX executable ExampleAuthDelegateClient
[ 42%] Built target ExampleAuthDelegateClient
[ 43%] Linking CXX executable ConfigTest
[ 44%] Built target ConfigTest
[ 45%] Linking CXX executable AuthDelegateTest
[ 46%] Built target AuthDelegateTest
[ 48%] Built target AVSConnectionManagerTest
[ 51%] Built target AttachmentManagerTest
[ 53%] Built target MessageTest
[ 55%] Built target MessageRouterTest
[ 60%] Built target AVSCommon
[ 64%] Built target ADSL
[ 66%] Built target DirectiveSequencerTest
[ 67%] Linking CXX shared library libIntegration.so
[ 72%] Built target Integration
[ 73%] Linking CXX executable AlexaAuthorizationDelegateTest
[ 74%] Built target AlexaAuthorizationDelegateTest
[ 75%] Linking CXX executable AlexaCommunicationsLibraryTest
[ 76%] Built target AlexaCommunicationsLibraryTest
[ 77%] Linking CXX executable AlexaDirectiveSequencerLibraryTest
[ 78%] Built target AlexaDirectiveSequencerLibraryTest
[ 80%] Built target ExampleLogger
[ 82%] Built target ExampleLoggerClient
[ 84%] Built target LogEntryStreamTest
[ 86%] Built target LoggerTest
[ 88%] Built target TaskQueueTest
[ 90%] Built target TaskThreadTest
[ 92%] Built target ExecutorTest
[ 94%] Built target JSONUtilTest
[ 97%] Built target AFML
[100%] Built target FocusManagerTest
[ 21%] Built target AVSUtils
[ 45%] Built target ACL
[ 54%] Built target AVSCommon
[ 60%] Built target gmock
[ 63%] Built target gtest
[ 70%] Built target AuthDelegate
[ 78%] Built target ADSL
[ 89%] Built target Integration
[ 92%] Built target AlexaDirectiveSequencerLibraryTest
[ 96%] Built target AlexaAuthorizationDelegateTest
[100%] Built target AlexaCommunicationsLibraryTest
[==========] Running 2 tests from 1 test case.
[----------] Global test environment set-up.
[----------] 2 tests from AlexaAuthorizationDelegateTest
[ RUN ] AlexaAuthorizationDelegateTest.refreshAuthToken
curl_easy_getinfo(CURLINFO_RESPONSE_CODE) successfully returned the HTTP code: 200
[ OK ] AlexaAuthorizationDelegateTest.refreshAuthToken (1304 ms)
[ RUN ] AlexaAuthorizationDelegateTest.invalidRefreshTokenWithUnrecoverableError
curl_easy_getinfo(CURLINFO_RESPONSE_CODE) successfully returned the HTTP code: 400
The LWA response body indicated an unrecoverable error: invalid_grant
calculateTimeToRetry() delayMs=0
The thread is stopping due to the unrecoverable error.
[ OK ] AlexaAuthorizationDelegateTest.invalidRefreshTokenWithUnrecoverableError (1181 ms)
[----------] 2 tests from AlexaAuthorizationDelegateTest (2485 ms total)
[----------] Global test environment tear-down
[==========] 2 tests from 1 test case ran. (2485 ms total)
[ PASSED ] 2 tests.
[==========] Running 9 tests from 1 test case.
[----------] Global test environment set-up.
[----------] 9 tests from AlexaCommunicationsLibraryTest
[ RUN ] AlexaCommunicationsLibraryTest.connectAndDisconnect
curl_easy_getinfo(CURLINFO_RESPONSE_CODE) successfully returned the HTTP code: 200

  • Trying 54.239.26.171...
  • TCP_NODELAY set
  • Connected to avs-alexa-na.amazon.com (54.239.26.171) port 443 (#0)
  • Cipher selection: ALL:!EXPORT:!EXPORT40:!EXPORT56:!aNULL:!LOW:!RC4:@strength
  • successfully set certificate verify locations:
  • CAfile: /etc/ssl/certs/ca-certificates.crt
    CApath: none
  • SSL connection using TLSv1.2 / ECDHE-RSA-AES256-GCM-SHA384
  • Server certificate:
  • subject: C=US; ST=Washington; L=Seattle; O=Amazon.com, Inc.; CN=latinum.amazon.com
  • start date: Sep 22 00:00:00 2016 GMT
  • expire date: Oct 16 23:59:59 2017 GMT
  • subjectAltName: host "avs-alexa-na.amazon.com" matched cert's "avs-alexa-na.amazon.com"
  • issuer: C=US; O=Symantec Corporation; OU=Symantec Trust Network; CN=Symantec Class 3 Secure Server CA - G4
  • SSL certificate verify ok.

GET /v20160207/directives HTTP/1.1
Host: avs-alexa-na.amazon.com
Accept: /
Authorization: Bearer redacted
Segmentation fault (core dumped)
make[3]: *** [Integration/test/CMakeFiles/integration] Error 139
make[2]: *** [Integration/test/CMakeFiles/integration.dir/all] Error 2
make[1]: *** [Integration/test/CMakeFiles/integration.dir/rule] Error 2
make: *** [integration] Error 2
king@wks:~/Project/DB20_Linux/Alexa_Make$

@yugoren
Copy link

yugoren commented Apr 5, 2017

Hi @boyce-xx:

The first two integration tests test for an invalid token, so the first error is actually expected, and that's why that test passes. The issue you have is for the first test of ACL.

To better help us reproduce your issue, could you tell us which build environment you're running this on? We weren't able to reproduce this on Ubuntu 16.04LTS and Mac OSX.

A couple of initial ideas:

  • Are you using libcurl compiled with nghttp2 / does your libcurl support HTTP2 connections? In our logs after the SSL certificate verify ok, we receive a log message indicating that curl is using HTTP2 and later get a confirmation of this as well, but it seems that this is absent in your logs.
  • Are you using the same AuthDelegate.config in parallel, between different processes?
  • Is the error persistant or intermittent across multiple runs?

@JamieMeyers
Copy link
Contributor

Hi @boyce-xx,

I'm wondering if you are still seeing this issue. Judging from your other posts, it looks like this has been resolved, but I wanted to double check.

Thanks,
Jamie

@JamieMeyers
Copy link
Contributor

JamieMeyers commented Jun 6, 2017

Hi @boyce-xx,

FYI, please make sure to redact any sensitive information you post in the forums. I've gone ahead and redacted your authentication bearer token. We're pushing a change in an upcoming release to ensure we don't log this privacy information in the future.

Thanks,
Jamie

@boyce-xx
Copy link
Author

boyce-xx commented Jun 7, 2017

Thank you @JamieMeyers, and very sorry for late reply, the issue has been resolved, as @yugoren 's suggestions, we followed the attached link SOP to fix the issue caused by CURL, to install mbedTLS

thanks again!

@boyce-xx boyce-xx closed this as completed Jun 8, 2017
@baddemiya baddemiya mentioned this issue Feb 17, 2018
2 tasks
@adeb adeb mentioned this issue Apr 8, 2018
6 tasks
lucarosellini added a commit to lucarosellini/avs-device-sdk that referenced this issue Aug 13, 2020
Version 1.19.0 alexa-client-sdk
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants