How to exchange the LWA authorization code for a LWA refresh token
Opened this issue ยท 2 comments
Hi there, thanks for your work on bringing this to Ruby. ๐๐ป
I'm currently stuck on Step 4. Your application exchanges the LWA authorization code for a LWA refresh token
Amazon did hit my callback URL and I saved the selling_partner_id
and spapi_oauth_code
How do I use the spapi_oauth_code
?
You need to call the LWA authorization server.
Here is an example of what that request can look like.
res = Faraday.post(
'https://api.amazon.com/auth/o2/token',
{
grant_type: 'authorization_code',
client_id: "use the client identifier from the the LWA credentials in your seller central account",
client_secret: "use the client secret from the the LWA credentials in your seller central account",
code: "use the spapi_oauth_code you have",
}.to_json,
{ "Content-Type" => "application/json" }
)
puts res.body
This request times out pretty quickly, so make this request immediatly.
if you get the response invalid_code - its possible that the request has already timed out so make it quickly
Hey @mendywoly thanks for your answer.
I was able to get the refresh_token
and access_token
as per your suggestion. Now the problem is that all my API calls are being responded with error 403. What am I missing? Here's a log:
Calling API: FbaOutboundApi.list_all_fulfillment_orders ...
ETHON: Libcurl initialized
Expire in 0 ms for 6 (transfer 0x55824b3a36a0)
Expire in 20000 ms for 8 (transfer 0x55824b3a36a0)
Expire in 1 ms for 1 (transfer 0x55824b3a36a0)
Expire in 0 ms for 1 (transfer 0x55824b3a36a0)
Expire in 1 ms for 1 (transfer 0x55824b3a36a0)
Expire in 0 ms for 1 (transfer 0x55824b3a36a0)
Expire in 0 ms for 1 (transfer 0x55824b3a36a0)
Expire in 1 ms for 1 (transfer 0x55824b3a36a0)
Expire in 0 ms for 1 (transfer 0x55824b3a36a0)
Expire in 0 ms for 1 (transfer 0x55824b3a36a0)
Expire in 1 ms for 1 (transfer 0x55824b3a36a0)
Expire in 0 ms for 1 (transfer 0x55824b3a36a0)
Expire in 0 ms for 1 (transfer 0x55824b3a36a0)
Expire in 1 ms for 1 (transfer 0x55824b3a36a0)
Expire in 0 ms for 1 (transfer 0x55824b3a36a0)
Expire in 0 ms for 1 (transfer 0x55824b3a36a0)
Expire in 1 ms for 1 (transfer 0x55824b3a36a0)
Expire in 0 ms for 1 (transfer 0x55824b3a36a0)
Expire in 0 ms for 1 (transfer 0x55824b3a36a0)
Expire in 1 ms for 1 (transfer 0x55824b3a36a0)
Expire in 0 ms for 1 (transfer 0x55824b3a36a0)
Expire in 0 ms for 1 (transfer 0x55824b3a36a0)
Expire in 1 ms for 1 (transfer 0x55824b3a36a0)
Expire in 0 ms for 1 (transfer 0x55824b3a36a0)
Expire in 0 ms for 1 (transfer 0x55824b3a36a0)
Expire in 1 ms for 1 (transfer 0x55824b3a36a0)
Expire in 0 ms for 1 (transfer 0x55824b3a36a0)
Expire in 0 ms for 1 (transfer 0x55824b3a36a0)
Expire in 1 ms for 1 (transfer 0x55824b3a36a0)
Expire in 0 ms for 1 (transfer 0x55824b3a36a0)
Expire in 0 ms for 1 (transfer 0x55824b3a36a0)
Expire in 1 ms for 1 (transfer 0x55824b3a36a0)
Expire in 0 ms for 1 (transfer 0x55824b3a36a0)
Expire in 0 ms for 1 (transfer 0x55824b3a36a0)
Expire in 1 ms for 1 (transfer 0x55824b3a36a0)
Expire in 0 ms for 1 (transfer 0x55824b3a36a0)
Expire in 0 ms for 1 (transfer 0x55824b3a36a0)
Expire in 1 ms for 1 (transfer 0x55824b3a36a0)
Expire in 0 ms for 1 (transfer 0x55824b3a36a0)
Expire in 0 ms for 1 (transfer 0x55824b3a36a0)
Expire in 1 ms for 1 (transfer 0x55824b3a36a0)
Expire in 0 ms for 1 (transfer 0x55824b3a36a0)
Expire in 0 ms for 1 (transfer 0x55824b3a36a0)
Expire in 1 ms for 1 (transfer 0x55824b3a36a0)
Expire in 0 ms for 1 (transfer 0x55824b3a36a0)
Expire in 0 ms for 1 (transfer 0x55824b3a36a0)
Expire in 1 ms for 1 (transfer 0x55824b3a36a0)
Expire in 0 ms for 1 (transfer 0x55824b3a36a0)
Expire in 0 ms for 1 (transfer 0x55824b3a36a0)
Expire in 1 ms for 1 (transfer 0x55824b3a36a0)
Expire in 0 ms for 1 (transfer 0x55824b3a36a0)
Expire in 0 ms for 1 (transfer 0x55824b3a36a0)
Expire in 1 ms for 1 (transfer 0x55824b3a36a0)
Expire in 0 ms for 1 (transfer 0x55824b3a36a0)
Expire in 0 ms for 1 (transfer 0x55824b3a36a0)
Expire in 1 ms for 1 (transfer 0x55824b3a36a0)
Expire in 0 ms for 1 (transfer 0x55824b3a36a0)
Expire in 0 ms for 1 (transfer 0x55824b3a36a0)
Expire in 1 ms for 1 (transfer 0x55824b3a36a0)
Expire in 0 ms for 1 (transfer 0x55824b3a36a0)
Expire in 0 ms for 1 (transfer 0x55824b3a36a0)
Expire in 1 ms for 1 (transfer 0x55824b3a36a0)
Expire in 0 ms for 1 (transfer 0x55824b3a36a0)
Expire in 0 ms for 1 (transfer 0x55824b3a36a0)
Expire in 2 ms for 1 (transfer 0x55824b3a36a0)
Expire in 0 ms for 1 (transfer 0x55824b3a36a0)
Expire in 0 ms for 1 (transfer 0x55824b3a36a0)
Expire in 2 ms for 1 (transfer 0x55824b3a36a0)
Expire in 0 ms for 1 (transfer 0x55824b3a36a0)
Expire in 0 ms for 1 (transfer 0x55824b3a36a0)
Expire in 2 ms for 1 (transfer 0x55824b3a36a0)
Expire in 0 ms for 1 (transfer 0x55824b3a36a0)
Expire in 0 ms for 1 (transfer 0x55824b3a36a0)
Expire in 2 ms for 1 (transfer 0x55824b3a36a0)
Expire in 0 ms for 1 (transfer 0x55824b3a36a0)
Expire in 0 ms for 1 (transfer 0x55824b3a36a0)
Expire in 2 ms for 1 (transfer 0x55824b3a36a0)
Expire in 0 ms for 1 (transfer 0x55824b3a36a0)
Expire in 0 ms for 1 (transfer 0x55824b3a36a0)
Expire in 2 ms for 1 (transfer 0x55824b3a36a0)
Expire in 0 ms for 1 (transfer 0x55824b3a36a0)
Expire in 0 ms for 1 (transfer 0x55824b3a36a0)
Expire in 2 ms for 1 (transfer 0x55824b3a36a0)
Expire in 0 ms for 1 (transfer 0x55824b3a36a0)
Expire in 0 ms for 1 (transfer 0x55824b3a36a0)
Expire in 2 ms for 1 (transfer 0x55824b3a36a0)
Expire in 0 ms for 1 (transfer 0x55824b3a36a0)
Expire in 0 ms for 1 (transfer 0x55824b3a36a0)
Expire in 2 ms for 1 (transfer 0x55824b3a36a0)
Expire in 0 ms for 1 (transfer 0x55824b3a36a0)
Expire in 0 ms for 1 (transfer 0x55824b3a36a0)
Expire in 2 ms for 1 (transfer 0x55824b3a36a0)
Expire in 0 ms for 1 (transfer 0x55824b3a36a0)
Expire in 0 ms for 1 (transfer 0x55824b3a36a0)
Expire in 2 ms for 1 (transfer 0x55824b3a36a0)
Expire in 0 ms for 1 (transfer 0x55824b3a36a0)
Expire in 0 ms for 1 (transfer 0x55824b3a36a0)
Expire in 2 ms for 1 (transfer 0x55824b3a36a0)
Expire in 0 ms for 1 (transfer 0x55824b3a36a0)
Expire in 0 ms for 1 (transfer 0x55824b3a36a0)
Expire in 2 ms for 1 (transfer 0x55824b3a36a0)
Expire in 0 ms for 1 (transfer 0x55824b3a36a0)
Expire in 0 ms for 1 (transfer 0x55824b3a36a0)
Expire in 2 ms for 1 (transfer 0x55824b3a36a0)
Expire in 0 ms for 1 (transfer 0x55824b3a36a0)
Expire in 0 ms for 1 (transfer 0x55824b3a36a0)
Expire in 2 ms for 1 (transfer 0x55824b3a36a0)
Expire in 0 ms for 1 (transfer 0x55824b3a36a0)
Expire in 0 ms for 1 (transfer 0x55824b3a36a0)
Expire in 2 ms for 1 (transfer 0x55824b3a36a0)
Expire in 0 ms for 1 (transfer 0x55824b3a36a0)
Expire in 0 ms for 1 (transfer 0x55824b3a36a0)
Expire in 2 ms for 1 (transfer 0x55824b3a36a0)
Expire in 0 ms for 1 (transfer 0x55824b3a36a0)
Expire in 0 ms for 1 (transfer 0x55824b3a36a0)
Expire in 2 ms for 1 (transfer 0x55824b3a36a0)
Expire in 0 ms for 1 (transfer 0x55824b3a36a0)
Expire in 0 ms for 1 (transfer 0x55824b3a36a0)
Expire in 2 ms for 1 (transfer 0x55824b3a36a0)
Expire in 0 ms for 1 (transfer 0x55824b3a36a0)
Expire in 0 ms for 1 (transfer 0x55824b3a36a0)
Expire in 2 ms for 1 (transfer 0x55824b3a36a0)
Expire in 0 ms for 1 (transfer 0x55824b3a36a0)
Expire in 0 ms for 1 (transfer 0x55824b3a36a0)
Expire in 2 ms for 1 (transfer 0x55824b3a36a0)
Expire in 0 ms for 1 (transfer 0x55824b3a36a0)
Expire in 0 ms for 1 (transfer 0x55824b3a36a0)
Expire in 2 ms for 1 (transfer 0x55824b3a36a0)
Expire in 0 ms for 1 (transfer 0x55824b3a36a0)
Expire in 0 ms for 1 (transfer 0x55824b3a36a0)
Expire in 2 ms for 1 (transfer 0x55824b3a36a0)
Expire in 0 ms for 1 (transfer 0x55824b3a36a0)
Expire in 0 ms for 1 (transfer 0x55824b3a36a0)
Expire in 2 ms for 1 (transfer 0x55824b3a36a0)
Expire in 0 ms for 1 (transfer 0x55824b3a36a0)
Expire in 0 ms for 1 (transfer 0x55824b3a36a0)
Expire in 2 ms for 1 (transfer 0x55824b3a36a0)
Expire in 0 ms for 1 (transfer 0x55824b3a36a0)
Expire in 0 ms for 1 (transfer 0x55824b3a36a0)
Expire in 2 ms for 1 (transfer 0x55824b3a36a0)
Expire in 0 ms for 1 (transfer 0x55824b3a36a0)
Expire in 0 ms for 1 (transfer 0x55824b3a36a0)
Expire in 2 ms for 1 (transfer 0x55824b3a36a0)
Expire in 0 ms for 1 (transfer 0x55824b3a36a0)
Expire in 0 ms for 1 (transfer 0x55824b3a36a0)
Expire in 2 ms for 1 (transfer 0x55824b3a36a0)
Expire in 0 ms for 1 (transfer 0x55824b3a36a0)
Expire in 0 ms for 1 (transfer 0x55824b3a36a0)
Expire in 2 ms for 1 (transfer 0x55824b3a36a0)
Expire in 0 ms for 1 (transfer 0x55824b3a36a0)
Expire in 0 ms for 1 (transfer 0x55824b3a36a0)
Expire in 2 ms for 1 (transfer 0x55824b3a36a0)
Expire in 0 ms for 1 (transfer 0x55824b3a36a0)
Expire in 0 ms for 1 (transfer 0x55824b3a36a0)
Expire in 2 ms for 1 (transfer 0x55824b3a36a0)
Expire in 0 ms for 1 (transfer 0x55824b3a36a0)
Expire in 0 ms for 1 (transfer 0x55824b3a36a0)
Expire in 2 ms for 1 (transfer 0x55824b3a36a0)
Expire in 0 ms for 1 (transfer 0x55824b3a36a0)
Expire in 0 ms for 1 (transfer 0x55824b3a36a0)
Expire in 2 ms for 1 (transfer 0x55824b3a36a0)
Expire in 0 ms for 1 (transfer 0x55824b3a36a0)
Expire in 0 ms for 1 (transfer 0x55824b3a36a0)
Expire in 2 ms for 1 (transfer 0x55824b3a36a0)
Expire in 0 ms for 1 (transfer 0x55824b3a36a0)
Expire in 0 ms for 1 (transfer 0x55824b3a36a0)
Expire in 2 ms for 1 (transfer 0x55824b3a36a0)
Expire in 0 ms for 1 (transfer 0x55824b3a36a0)
Expire in 0 ms for 1 (transfer 0x55824b3a36a0)
Expire in 2 ms for 1 (transfer 0x55824b3a36a0)
Expire in 0 ms for 1 (transfer 0x55824b3a36a0)
Expire in 0 ms for 1 (transfer 0x55824b3a36a0)
Expire in 2 ms for 1 (transfer 0x55824b3a36a0)
Expire in 0 ms for 1 (transfer 0x55824b3a36a0)
Expire in 0 ms for 1 (transfer 0x55824b3a36a0)
Expire in 2 ms for 1 (transfer 0x55824b3a36a0)
Expire in 0 ms for 1 (transfer 0x55824b3a36a0)
Expire in 0 ms for 1 (transfer 0x55824b3a36a0)
Expire in 2 ms for 1 (transfer 0x55824b3a36a0)
Expire in 0 ms for 1 (transfer 0x55824b3a36a0)
Expire in 0 ms for 1 (transfer 0x55824b3a36a0)
Expire in 2 ms for 1 (transfer 0x55824b3a36a0)
Expire in 0 ms for 1 (transfer 0x55824b3a36a0)
Expire in 0 ms for 1 (transfer 0x55824b3a36a0)
Expire in 2 ms for 1 (transfer 0x55824b3a36a0)
Expire in 0 ms for 1 (transfer 0x55824b3a36a0)
Expire in 0 ms for 1 (transfer 0x55824b3a36a0)
Expire in 2 ms for 1 (transfer 0x55824b3a36a0)
Expire in 0 ms for 1 (transfer 0x55824b3a36a0)
Expire in 0 ms for 1 (transfer 0x55824b3a36a0)
Expire in 2 ms for 1 (transfer 0x55824b3a36a0)
Expire in 0 ms for 1 (transfer 0x55824b3a36a0)
Expire in 0 ms for 1 (transfer 0x55824b3a36a0)
Expire in 2 ms for 1 (transfer 0x55824b3a36a0)
Expire in 0 ms for 1 (transfer 0x55824b3a36a0)
Expire in 0 ms for 1 (transfer 0x55824b3a36a0)
Expire in 2 ms for 1 (transfer 0x55824b3a36a0)
Expire in 0 ms for 1 (transfer 0x55824b3a36a0)
Expire in 0 ms for 1 (transfer 0x55824b3a36a0)
Expire in 2 ms for 1 (transfer 0x55824b3a36a0)
Expire in 0 ms for 1 (transfer 0x55824b3a36a0)
Expire in 0 ms for 1 (transfer 0x55824b3a36a0)
Expire in 2 ms for 1 (transfer 0x55824b3a36a0)
Expire in 0 ms for 1 (transfer 0x55824b3a36a0)
Expire in 0 ms for 1 (transfer 0x55824b3a36a0)
Expire in 2 ms for 1 (transfer 0x55824b3a36a0)
Expire in 1 ms for 1 (transfer 0x55824b3a36a0)
Expire in 1 ms for 1 (transfer 0x55824b3a36a0)
Expire in 2 ms for 1 (transfer 0x55824b3a36a0)
Expire in 1 ms for 1 (transfer 0x55824b3a36a0)
Expire in 1 ms for 1 (transfer 0x55824b3a36a0)
Expire in 2 ms for 1 (transfer 0x55824b3a36a0)
Expire in 1 ms for 1 (transfer 0x55824b3a36a0)
Expire in 1 ms for 1 (transfer 0x55824b3a36a0)
Expire in 2 ms for 1 (transfer 0x55824b3a36a0)
Expire in 2 ms for 1 (transfer 0x55824b3a36a0)
Expire in 2 ms for 1 (transfer 0x55824b3a36a0)
Expire in 4 ms for 1 (transfer 0x55824b3a36a0)
Expire in 2 ms for 1 (transfer 0x55824b3a36a0)
Expire in 2 ms for 1 (transfer 0x55824b3a36a0)
Expire in 4 ms for 1 (transfer 0x55824b3a36a0)
Expire in 3 ms for 1 (transfer 0x55824b3a36a0)
Expire in 3 ms for 1 (transfer 0x55824b3a36a0)
Expire in 4 ms for 1 (transfer 0x55824b3a36a0)
Expire in 4 ms for 1 (transfer 0x55824b3a36a0)
Expire in 4 ms for 1 (transfer 0x55824b3a36a0)
Expire in 4 ms for 1 (transfer 0x55824b3a36a0)
Expire in 4 ms for 1 (transfer 0x55824b3a36a0)
Expire in 4 ms for 1 (transfer 0x55824b3a36a0)
Expire in 8 ms for 1 (transfer 0x55824b3a36a0)
Expire in 5 ms for 1 (transfer 0x55824b3a36a0)
Expire in 5 ms for 1 (transfer 0x55824b3a36a0)
Expire in 8 ms for 1 (transfer 0x55824b3a36a0)
Expire in 7 ms for 1 (transfer 0x55824b3a36a0)
Expire in 7 ms for 1 (transfer 0x55824b3a36a0)
Expire in 8 ms for 1 (transfer 0x55824b3a36a0)
Expire in 7 ms for 1 (transfer 0x55824b3a36a0)
Expire in 7 ms for 1 (transfer 0x55824b3a36a0)
Expire in 8 ms for 1 (transfer 0x55824b3a36a0)
Expire in 9 ms for 1 (transfer 0x55824b3a36a0)
Expire in 9 ms for 1 (transfer 0x55824b3a36a0)
Expire in 8 ms for 1 (transfer 0x55824b3a36a0)
Expire in 10 ms for 1 (transfer 0x55824b3a36a0)
Expire in 10 ms for 1 (transfer 0x55824b3a36a0)
Expire in 16 ms for 1 (transfer 0x55824b3a36a0)
Expire in 13 ms for 1 (transfer 0x55824b3a36a0)
Expire in 13 ms for 1 (transfer 0x55824b3a36a0)
Expire in 16 ms for 1 (transfer 0x55824b3a36a0)
Expire in 50 ms for 1 (transfer 0x55824b3a36a0)
Expire in 50 ms for 1 (transfer 0x55824b3a36a0)
Expire in 16 ms for 1 (transfer 0x55824b3a36a0)
Expire in 50 ms for 1 (transfer 0x55824b3a36a0)
Expire in 50 ms for 1 (transfer 0x55824b3a36a0)
Expire in 32 ms for 1 (transfer 0x55824b3a36a0)
Expire in 50 ms for 1 (transfer 0x55824b3a36a0)
Expire in 50 ms for 1 (transfer 0x55824b3a36a0)
Expire in 64 ms for 1 (transfer 0x55824b3a36a0)
Expire in 50 ms for 1 (transfer 0x55824b3a36a0)
Expire in 50 ms for 1 (transfer 0x55824b3a36a0)
Expire in 64 ms for 1 (transfer 0x55824b3a36a0)
Expire in 50 ms for 1 (transfer 0x55824b3a36a0)
Expire in 50 ms for 1 (transfer 0x55824b3a36a0)
Expire in 64 ms for 1 (transfer 0x55824b3a36a0)
Expire in 50 ms for 1 (transfer 0x55824b3a36a0)
Expire in 50 ms for 1 (transfer 0x55824b3a36a0)
Expire in 64 ms for 1 (transfer 0x55824b3a36a0)
Expire in 200 ms for 1 (transfer 0x55824b3a36a0)
Expire in 200 ms for 1 (transfer 0x55824b3a36a0)
Expire in 64 ms for 1 (transfer 0x55824b3a36a0)
Expire in 200 ms for 1 (transfer 0x55824b3a36a0)
Expire in 200 ms for 1 (transfer 0x55824b3a36a0)
Expire in 200 ms for 1 (transfer 0x55824b3a36a0)
Trying 52.204.137.14...
TCP_NODELAY set
Expire in 9773 ms for 3 (transfer 0x55824b3a36a0)
Expire in 200 ms for 4 (transfer 0x55824b3a36a0)
Connected to sellingpartnerapi-na.amazon.com (52.204.137.14) port 443 (#0)
ALPN, offering h2
ALPN, offering http/1.1
successfully set certificate verify locations:
CAfile: none
CApath: /etc/ssl/certs
TLSv1.3 (OUT), TLS handshake, Client hello (1):
fTLSv1.3 (IN), TLS handshake, Server hello (2):
TLSv1.2 (IN), TLS handshake, Certificate (11):
MTLSv1.2 (IN), TLS handshake, Server key exchange (12):
TLSv1.2 (IN), TLS handshake, Server finished (14):
FTLSv1.2 (OUT), TLS handshake, Client key exchange (16):
TLSv1.2 (OUT), TLS change cipher, Change cipher spec (1):
(TLSv1.2 (OUT), TLS handshake, Finished (20):
(TLSv1.2 (IN), TLS handshake, Finished (20):
SSL connection using TLSv1.2 / ECDHE-RSA-AES128-GCM-SHA256
ALPN, server accepted to use h2
Server certificate:
subject: CN=sellingpartnerapi-na.amazon.com
start date: Apr 4 00:00:00 2021 GMT
expire date: May 3 23:59:59 2022 GMT
subjectAltName: host "sellingpartnerapi-na.amazon.com" matched cert's "sellingpartnerapi-na.amazon.com"
issuer: C=US; O=Amazon; OU=Server CA 1B; CN=Amazon
SSL certificate verify ok.
Using HTTP2, server supports multi-use
Connection state changed (HTTP/2 confirmed)
Copying HTTP/2 data in stream buffer to connection buffer after upgrade: len=0
03%Using Stream ID: 1 (easy handle 0x55824b3a36a0)
GET /fba/outbound/2020-07-01/fulfillmentOrders HTTP/2
Host: sellingpartnerapi-na.amazon.com
User-Agent: Swagger-Codegen/0.2.1/ruby
Content-Type: application/json
x-amz-date: 20220104T150547Z
x-amz-content-sha256: e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855
authorization: AWS4-HMAC-SHA256 Credential=AKIAJ7ETDZSJ2NGNSLMA/20220104/us-east-1/execute-api/aws4_request, SignedHeaders=host;x-amz-content-sha256;x-amz-date, Signature=cb89e3f43070fa293415c605045bd8698538bbbc501108cdd2749d415ff20b0b
x-amz-access-token: ANdiXPaaSViAnIUWDohr
Accept: application/json
x-datadog-trace-id: 317816672620510270
x-datadog-parent-id: 1613609588072367557
x-datadog-sampling-priority: 1
@Connection state changed (MAX_CONCURRENT_STREAMS == 128)!
!!HTTP/2 403
date: Tue, 04 Jan 2022 15:05:48 GMT
content-type: application/json
content-length: 204
x-amzn-requestid: f7b022da-e240-4080-a2ae-c8640ac883a9
x-amzn-errortype: AccessDeniedException
x-amz-apigw-id: LbRMAHZEIAMFbNQ=
!Connection #0 to host sellingpartnerapi-na.amazon.com left intact
ETHON: performed EASY effective_url=https://sellingpartnerapi-na.amazon.com/fba/outbound/2020-07-01/fulfillmentOrders response_code=403 return_code=ok total_time=1.166006
HTTP response body ~BEGIN~
{
"errors": [
{
"message": "Access to requested resource is denied.",
"code": "Unauthorized",
"details": "The access token you provided is revoked, malformed or invalid."
}
]
}
~END~
Exception when calling SP-API: Error message: the server returns an error
HTTP status code: 403
Response headers: {"date"=>"Tue, 04 Jan 2022 15:05:48 GMT", "content-type"=>"application/json", "content-length"=>"204", "x-amzn-requestid"=>"f7b022da-e240-4080-a2ae-c8640ac883a9", "x-amzn-errortype"=>"AccessDeniedException", "x-amz-apigw-id"=>"LbRMAHZEIAMFbNQ="}
Response body: {
"errors": [
{
"message": "Access to requested resource is denied.",
"code": "Unauthorized",
"details": "The access token you provided is revoked, malformed or invalid."
}
]
}
=> nil
E, [2022-01-04T15:05:48.797031 #19] ERROR -- ddtrace: [ddtrace] (/usr/local/bundle/gems/ddtrace-0.49.0/lib/ddtrace/transport/http/client.rb:35:in `rescue in send_request') Internal error during HTTP transport request. Cause: Failed to open TCP connection to 127.0.0.1:8126 (Connection refused - connect(2) for "127.0.0.1" port 8126) Location: /usr/local/lib/ruby/2.7.0/resolv-replace.rb:25:in `initialize'
I, [2022-01-04T15:05:48.804348 #19] INFO -- ddtrace: [ddtrace] DATADOG TRACER CONFIGURATION - {"date":"2022-01-04T15:05:48+00:00","os_name":"x86_64-pc-linux-gnu","version":"0.49.0","lang":"ruby","lang_version":"2.7.3","env":"production","enabled":true,"service":"feedback-plus-app","agent_url":"http://127.0.0.1:8126?timeout=1","agent_error":"Datadog::Transport::InternalErrorResponse ok?: unsupported?:, not_found?:, client_error?:, server_error?:, internal_error?:true, payload:, error_type:Errno::ECONNREFUSED error:Failed to open TCP connection to 127.0.0.1:8126 (Connection refused - connect(2) for \"127.0.0.1\" port 8126)","debug":false,"analytics_enabled":false,"runtime_metrics_enabled":false,"integrations_loaded":"active_model_serializers@0.10.12,aws@,concurrent_ruby@1.1.8,dalli@,delayed_job@,elasticsearch@,ethon@0.14.0,excon@0.81.0,faraday@1.4.2,grape@,graphql@,grpc@,http@2.7.3,httpclient@,httprb@,kafka@,presto@,que@,mysql2@,mongo@,qless@,racecar@,rails@4.2.11.1,rake@13.0.3,redis@4.2.5,resque@,rest_client@,sequel@,shoryuken@,sidekiq@5.2.8,sinatra@1.4.8,sneakers@,sucker_punch@,rack@1.6.13,active_support@4.2.11.1,action_pack@4.2.11.1,action_view@4.2.11.1,active_record@4.2.11.1","vm":"ruby-2.7.3","partial_flushing_enabled":false,"priority_sampling_enabled":false,"health_metrics_enabled":false,"integration_active_model_serializers_analytics_enabled":"false","integration_active_model_serializers_analytics_sample_rate":"1.0","integration_active_model_serializers_enabled":"true","integration_active_model_serializers_service_name":"active_model_serializers","integration_aws_analytics_enabled":"false","integration_aws_analytics_sample_rate":"1.0","integration_aws_enabled":"true","integration_aws_service_name":"aws","integration_concurrent_ruby_analytics_enabled":"false","integration_concurrent_ruby_analytics_sample_rate":"1.0","integration_concurrent_ruby_enabled":"true","integration_concurrent_ruby_service_name":"concurrent-ruby","integration_dalli_analytics_enabled":"false","integration_dalli_analytics_sample_rate":"1.0","integration_dalli_enabled":"true","integration_dalli_service_name":"memcached","integration_delayed_job_analytics_enabled":"false","integration_delayed_job_analytics_sample_rate":"1.0","integration_delayed_job_enabled":"true","integration_delayed_job_service_name":"delayed_job","integration_delayed_job_client_service_name":"delayed_job-client","integration_delayed_job_error_handler":"#\u003cProc:0x000055824cceb368 /usr/local/bundle/gems/ddtrace-0.49.0/lib/ddtrace/tracer.rb:32\u003e","integration_elasticsearch_analytics_enabled":"false","integration_elasticsearch_analytics_sample_rate":"1.0","integration_elasticsearch_enabled":"true","integration_elasticsearch_service_name":"elasticsearch","integration_elasticsearch_quantize":"{}","integration_ethon_analytics_enabled":"false","integration_ethon_analytics_sample_rate":"1.0","integration_ethon_enabled":"true","integration_ethon_service_name":"ethon","integration_ethon_distributed_tracing":"true","integration_ethon_split_by_domain":"false","integration_excon_analytics_enabled":"false","integration_excon_analytics_sample_rate":"1.0","integration_excon_enabled":"true","integration_excon_service_name":"excon","integration_excon_distributed_tracing":"true","integration_excon_error_handler":"","integration_excon_split_by_domain":"false","integration_faraday_analytics_enabled":"false","integration_faraday_analytics_sample_rate":"1.0","integration_faraday_enabled":"true","integration_faraday_service_name":"faraday","integration_faraday_distributed_tracing":"true","integration_faraday_error_handler":"#\u003cProc:0x000055824cfebe28 /usr/local/bundle/gems/ddtrace-0.49.0/lib/ddtrace/contrib/faraday/configuration/settings.rb:11 (lambda)\u003e","integration_faraday_split_by_domain":"false","integration_grape_analytics_enabled":"","integration_grape_analytics_sample_rate":"1.0","integration_grape_enabled":"true","integration_grape_service_name":"grape","integration_grape_error_statuses":"","integration_graphql_analytics_enabled":"","integration_graphql_analytics_sample_rate":"1.0","integration_graphql_enabled":"true","integration_graphql_service_name":"ruby-graphql","integration_graphql_schemas":"","integration_grpc_analytics_enabled":"false","integration_grpc_analytics_sample_rate":"1.0","integration_grpc_enabled":"true","integration_grpc_service_name":"grpc","integration_http_analytics_enabled":"false","integration_http_analytics_sample_rate":"1.0","integration_http_enabled":"true","integration_http_service_name":"net/http","integration_http_distributed_tracing":"true","integration_http_split_by_domain":"false","integration_httpclient_analytics_enabled":"false","integration_httpclient_analytics_sample_rate":"1.0","integration_httpclient_enabled":"true","integration_httpclient_service_name":"httpclient","integration_httpclient_distributed_tracing":"true","integration_httpclient_split_by_domain":"false","integration_httprb_analytics_enabled":"false","integration_httprb_analytics_sample_rate":"1.0","integration_httprb_enabled":"true","integration_httprb_service_name":"httprb","integration_httprb_distributed_tracing":"true","integration_httprb_split_by_domain":"false","integration_kafka_analytics_enabled":"false","integration_kafka_analytics_sample_rate":"1.0","integration_kafka_enabled":"true","integration_kafka_service_name":"kafka","integration_presto_analytics_enabled":"false","integration_presto_analytics_sample_rate":"1.0","integration_presto_enabled":"true","integration_presto_service_name":"presto","integration_que_analytics_enabled":"false","integration_que_analytics_sample_rate":"1.0","integration_que_enabled":"true","integration_que_service_name":"que","integration_que_distributed_tracing":"true","integration_que_tag_args":"false","integration_que_tag_data":"false","integration_que_error_handler":"#\u003cProc:0x000055824cceb368 /usr/local/bundle/gems/ddtrace-0.49.0/lib/ddtrace/tracer.rb:32\u003e","integration_mysql2_analytics_enabled":"false","integration_mysql2_analytics_sample_rate":"1.0","integration_mysql2_enabled":"true","integration_mysql2_service_name":"mysql2","integration_mongo_analytics_enabled":"false","integration_mongo_analytics_sample_rate":"1.0","integration_mongo_enabled":"true","integration_mongo_service_name":"mongodb","integration_mongo_quantize":"{:show=\u003e[:collection, :database, :operation]}","integration_qless_analytics_enabled":"false","integration_qless_analytics_sample_rate":"1.0","integration_qless_enabled":"true","integration_qless_service_name":"qless","integration_qless_tag_job_data":"false","integration_qless_tag_job_tags":"false","integration_racecar_analytics_enabled":"false","integration_racecar_analytics_sample_rate":"1.0","integration_racecar_enabled":"true","integration_racecar_service_name":"racecar","integration_rails_analytics_enabled":"","integration_rails_analytics_sample_rate":"1.0","integration_rails_enabled":"true","integration_rails_service_name":"feedback-plus-app","integration_rails_cache_service":"feedback-plus-app-cache","integration_rails_controller_service":"feedback-plus-app","integration_rails_database_service":"feedback-plus-app-postgres","integration_rails_distributed_tracing":"true","integration_rails_exception_controller":"","integration_rails_middleware":"true","integration_rails_middleware_names":"false","integration_rails_template_base_path":"views/","integration_rails_log_injection":"false","integration_rake_analytics_enabled":"false","integration_rake_analytics_sample_rate":"1.0","integration_rake_enabled":"true","integration_rake_service_name":"rake","integration_rake_quantize":"{}","integration_redis_analytics_enabled":"false","integration_redis_analytics_sample_rate":"1.0","integration_redis_enabled":"true","integration_redis_service_name":"redis","integration_redis_command_args":"true","integration_resque_analytics_enabled":"false","integration_resque_analytics_sample_rate":"1.0","integration_resque_enabled":"true","integration_resque_service_name":"resque","integration_resque_workers":"","integration_resque_error_handler":"#\u003cProc:0x000055824cceb368 /usr/local/bundle/gems/ddtrace-0.49.0/lib/ddtrace/tracer.rb:32\u003e","integration_rest_client_analytics_enabled":"false","integration_rest_client_analytics_sample_rate":"1.0","integration_rest_client_enabled":"true","integration_rest_client_service_name":"rest_client","integration_rest_client_distributed_tracing":"true","integration_sequel_analytics_enabled":"false","integration_sequel_analytics_sample_rate":"1.0","integration_sequel_enabled":"true","integration_sequel_service_name":"","integration_shoryuken_analytics_enabled":"false","integration_shoryuken_analytics_sample_rate":"1.0","integration_shoryuken_enabled":"true","integration_shoryuken_service_name":"shoryuken","integration_shoryuken_error_handler":"#\u003cProc:0x000055824cceb368 /usr/local/bundle/gems/ddtrace-0.49.0/lib/ddtrace/tracer.rb:32\u003e","integration_shoryuken_tag_body":"false","integration_sidekiq_analytics_enabled":"false","integration_sidekiq_analytics_sample_rate":"1.0","integration_sidekiq_enabled":"true","integration_sidekiq_service_name":"sidekiq","integration_sidekiq_tag_args":"false","integration_sidekiq_client_service_name":"sidekiq-client","integration_sidekiq_error_handler":"#\u003cProc:0x000055824cceb368 /usr/local/bundle/gems/ddtrace-0.49.0/lib/ddtrace/tracer.rb:32\u003e","integration_sinatra_analytics_enabled":"","integration_sinatra_analytics_sample_rate":"1.0","integration_sinatra_enabled":"true","integration_sinatra_service_name":"sinatra","integration_sinatra_distributed_tracing":"true","integration_sinatra_headers":"{:response=\u003e[\"Content-Type\", \"X-Request-ID\"]}","integration_sinatra_resource_script_names":"false","integration_sneakers_analytics_enabled":"false","integration_sneakers_analytics_sample_rate":"1.0","integration_sneakers_enabled":"true","integration_sneakers_service_name":"sneakers","integration_sneakers_error_handler":"#\u003cProc:0x000055824cceb368 /usr/local/bundle/gems/ddtrace-0.49.0/lib/ddtrace/tracer.rb:32\u003e","integration_sneakers_tag_body":"false","integration_sucker_punch_analytics_enabled":"false","integration_sucker_punch_analytics_sample_rate":"1.0","integration_sucker_punch_enabled":"true","integration_sucker_punch_service_name":"sucker_punch","integration_rack_analytics_enabled":"","integration_rack_analytics_sample_rate":"1.0","integration_rack_enabled":"true","integration_rack_service_name":"feedback-plus-app","integration_rack_application":"#\u003cFeedbackz::Application:0x000055824c9a42b8\u003e","integration_rack_distributed_tracing":"true","integration_rack_headers":"{:response=\u003e[\"Content-Type\", \"X-Request-ID\"]}","integration_rack_middleware_names":"false","integration_rack_quantize":"{}","integration_rack_request_queuing":"false","integration_rack_web_service_name":"web-server","integration_active_support_analytics_enabled":"false","integration_active_support_analytics_sample_rate":"1.0","integration_active_support_enabled":"true","integration_active_support_service_name":"","integration_active_support_cache_service":"feedback-plus-app-cache","integration_action_pack_analytics_enabled":"","integration_action_pack_analytics_sample_rate":"1.0","integration_action_pack_enabled":"true","integration_action_pack_service_name":"feedback-plus-app","integration_action_pack_controller_service":"feedback-plus-app","integration_action_pack_exception_controller":"","integration_action_view_analytics_enabled":"false","integration_action_view_analytics_sample_rate":"1.0","integration_action_view_enabled":"true","integration_action_view_service_name":"feedback-plus-app","integration_action_view_template_base_path":"views/","integration_active_record_analytics_enabled":"false","integration_active_record_analytics_sample_rate":"1.0","integration_active_record_enabled":"true","integration_active_record_service_name":"feedback-plus-app-postgres","integration_active_record_orm_service_name":""}
W, [2022-01-04T15:05:48.804550 #19] WARN -- ddtrace: [ddtrace] DATADOG TRACER DIAGNOSTIC - Agent Error: Datadog::Transport::InternalErrorResponse ok?: unsupported?:, not_found?:, client_error?:, server_error?:, internal_error?:true, payload:, error_type:Errno::ECONNREFUSED error:Failed to open TCP connection to 127.0.0.1:8126 (Connection refused - connect(2) for "127.0.0.1" port 8126)