Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Bug]: API query failure after upload can trigger a 500 #3741

Open
d33tah opened this issue Dec 21, 2024 · 2 comments
Open

[Bug]: API query failure after upload can trigger a 500 #3741

d33tah opened this issue Dec 21, 2024 · 2 comments
Labels
bug Something isn't working

Comments

@d33tah
Copy link

d33tah commented Dec 21, 2024

What happened?

I was uploading my file and got a 500. I looked at the logs and found that it's because Audiobookshelf made a query to https://api.audnex.us/books/B0DK3LD9CF?region=in', and the query triggered an error:

audiobookshelf-1 | message: "Item not available in region 'in' for ASIN: B0DK3LD9CF"

What did you expect to happen?

Upload succeeds, warning gets displayed?

Steps to reproduce the issue

  1. Upload my example.mp3 file (private, can share non-publicly)
  2. Observe the error

Audiobookshelf version

e6ce9dfffe56

How are you running audiobookshelf?

Docker

What OS is your Audiobookshelf server hosted from?

Linux

If the issue is being seen in the UI, what browsers are you seeing the problem on?

Firefox

Logs

audiobookshelf-1  | [2024-12-21 11:10:39.368] ERROR: [Audible] ASIN search error [AxiosError: Request failed with status code 500] {
audiobookshelf-1  |   code: 'ERR_BAD_RESPONSE',
audiobookshelf-1  |   config: {
audiobookshelf-1  |     transitional: {
audiobookshelf-1  |       silentJSONParsing: true,
audiobookshelf-1  |       forcedJSONParsing: true,
audiobookshelf-1  |       clarifyTimeoutError: false
audiobookshelf-1  |     },
audiobookshelf-1  |     adapter: [Function: httpAdapter],
audiobookshelf-1  |     transformRequest: [ [Function: transformRequest] ],
audiobookshelf-1  |     transformResponse: [ [Function: transformResponse] ],
audiobookshelf-1  |     timeout: 30000,
audiobookshelf-1  |     xsrfCookieName: 'XSRF-TOKEN',
audiobookshelf-1  |     xsrfHeaderName: 'X-XSRF-TOKEN',
audiobookshelf-1  |     maxContentLength: -1,
audiobookshelf-1  |     maxBodyLength: -1,
audiobookshelf-1  |     env: { FormData: [Function] },
audiobookshelf-1  |     validateStatus: [Function: validateStatus],
audiobookshelf-1  |     headers: {
audiobookshelf-1  |       Accept: 'application/json, text/plain, */*',
audiobookshelf-1  |       'User-Agent': 'axios/0.27.2'
audiobookshelf-1  |     },
audiobookshelf-1  |     method: 'get',
audiobookshelf-1  |     url: 'https://api.audnex.us/books/B0DK3LD9CF?region=in',
audiobookshelf-1  |     data: undefined
audiobookshelf-1  |   },
audiobookshelf-1  |   request: <ref *1> ClientRequest {
audiobookshelf-1  |     _events: [Object: null prototype] {
audiobookshelf-1  |       abort: [Function (anonymous)],
audiobookshelf-1  |       aborted: [Function (anonymous)],
audiobookshelf-1  |       connect: [Function (anonymous)],
audiobookshelf-1  |       error: [Function (anonymous)],
audiobookshelf-1  |       socket: [Function (anonymous)],
audiobookshelf-1  |       timeout: [Function (anonymous)],
audiobookshelf-1  |       finish: [Function: requestOnFinish]
audiobookshelf-1  |     },
audiobookshelf-1  |     _eventsCount: 7,
audiobookshelf-1  |     _maxListeners: undefined,
audiobookshelf-1  |     outputData: [],
audiobookshelf-1  |     outputSize: 0,
audiobookshelf-1  |     writable: true,
audiobookshelf-1  |     destroyed: true,
audiobookshelf-1  |     _last: true,
audiobookshelf-1  |     chunkedEncoding: false,
audiobookshelf-1  |     shouldKeepAlive: true,
audiobookshelf-1  |     maxRequestsOnConnectionReached: false,
audiobookshelf-1  |     _defaultKeepAlive: true,
audiobookshelf-1  |     useChunkedEncodingByDefault: false,
audiobookshelf-1  |     sendDate: false,
audiobookshelf-1  |     _removedConnection: false,
audiobookshelf-1  |     _removedContLen: false,
audiobookshelf-1  |     _removedTE: false,
audiobookshelf-1  |     strictContentLength: false,
audiobookshelf-1  |     _contentLength: 0,
audiobookshelf-1  |     _hasBody: true,
audiobookshelf-1  |     _trailer: '',
audiobookshelf-1  |     finished: true,
audiobookshelf-1  |     _headerSent: true,
audiobookshelf-1  |     _closed: true,
audiobookshelf-1  |     socket: TLSSocket {
audiobookshelf-1  |       _tlsOptions: [Object],
audiobookshelf-1  |       _secureEstablished: true,
audiobookshelf-1  |       _securePending: false,
audiobookshelf-1  |       _newSessionPending: false,
audiobookshelf-1  |       _controlReleased: true,
audiobookshelf-1  |       secureConnecting: false,
audiobookshelf-1  |       _SNICallback: null,
audiobookshelf-1  |       servername: 'api.audnex.us',
audiobookshelf-1  |       alpnProtocol: false,
audiobookshelf-1  |       authorized: true,
audiobookshelf-1  |       authorizationError: null,
audiobookshelf-1  |       encrypted: true,
audiobookshelf-1  |       _events: [Object: null prototype],
audiobookshelf-1  |       _eventsCount: 9,
audiobookshelf-1  |       connecting: false,
audiobookshelf-1  |       _hadError: false,
audiobookshelf-1  |       _parent: null,
audiobookshelf-1  |       _host: 'api.audnex.us',
audiobookshelf-1  |       _closeAfterHandlingError: false,
audiobookshelf-1  |       _readableState: [ReadableState],
audiobookshelf-1  |       _writableState: [WritableState],
audiobookshelf-1  |       allowHalfOpen: false,
audiobookshelf-1  |       _maxListeners: undefined,
audiobookshelf-1  |       _sockname: null,
audiobookshelf-1  |       _pendingData: null,
audiobookshelf-1  |       _pendingEncoding: '',
audiobookshelf-1  |       server: undefined,
audiobookshelf-1  |       _server: null,
audiobookshelf-1  |       ssl: [TLSWrap],
audiobookshelf-1  |       _requestCert: true,
audiobookshelf-1  |       _rejectUnauthorized: true,
audiobookshelf-1  |       timeout: 5000,
audiobookshelf-1  |       parser: null,
audiobookshelf-1  |       _httpMessage: null,
audiobookshelf-1  |       autoSelectFamilyAttemptedAddresses: [Array],
audiobookshelf-1  |       [Symbol(alpncallback)]: null,
audiobookshelf-1  |       [Symbol(res)]: [TLSWrap],
audiobookshelf-1  |       [Symbol(verified)]: true,
audiobookshelf-1  |       [Symbol(pendingSession)]: null,
audiobookshelf-1  |       [Symbol(async_id_symbol)]: -1,
audiobookshelf-1  |       [Symbol(kHandle)]: [TLSWrap],
audiobookshelf-1  |       [Symbol(lastWriteQueueSize)]: 0,
audiobookshelf-1  |       [Symbol(timeout)]: Timeout {
audiobookshelf-1  |         _idleTimeout: 5000,
audiobookshelf-1  |         _idlePrev: [TimersList],
audiobookshelf-1  |         _idleNext: [Timeout],
audiobookshelf-1  |         _idleStart: 508955,
audiobookshelf-1  |         _onTimeout: [Function: bound ],
audiobookshelf-1  |         _timerArgs: undefined,
audiobookshelf-1  |         _repeat: null,
audiobookshelf-1  |         _destroyed: false,
audiobookshelf-1  |         [Symbol(refed)]: false,
audiobookshelf-1  |         [Symbol(kHasPrimitive)]: false,
audiobookshelf-1  |         [Symbol(asyncId)]: 92938,
audiobookshelf-1  |         [Symbol(triggerId)]: 92936
audiobookshelf-1  |       },
audiobookshelf-1  |       [Symbol(kBuffer)]: null,
audiobookshelf-1  |       [Symbol(kBufferCb)]: null,
audiobookshelf-1  |       [Symbol(kBufferGen)]: null,
audiobookshelf-1  |       [Symbol(shapeMode)]: true,
audiobookshelf-1  |       [Symbol(kCapture)]: false,
audiobookshelf-1  |       [Symbol(kSetNoDelay)]: false,
audiobookshelf-1  |       [Symbol(kSetKeepAlive)]: true,
audiobookshelf-1  |       [Symbol(kSetKeepAliveInitialDelay)]: 1,
audiobookshelf-1  |       [Symbol(kBytesRead)]: 0,
audiobookshelf-1  |       [Symbol(kBytesWritten)]: 0,
audiobookshelf-1  |       [Symbol(connect-options)]: [Object]
audiobookshelf-1  |     },
audiobookshelf-1  |     _header: 'GET /books/B0DK3LD9CF?region=in HTTP/1.1\r\n' +
audiobookshelf-1  |       'Accept: application/json, text/plain, */*\r\n' +
audiobookshelf-1  |       'User-Agent: axios/0.27.2\r\n' +
audiobookshelf-1  |       'Host: api.audnex.us\r\n' +
audiobookshelf-1  |       'Connection: keep-alive\r\n' +
audiobookshelf-1  |       '\r\n',
audiobookshelf-1  |     _keepAliveTimeout: 0,
audiobookshelf-1  |     _onPendingData: [Function: nop],
audiobookshelf-1  |     agent: Agent {
audiobookshelf-1  |       _events: [Object: null prototype],
audiobookshelf-1  |       _eventsCount: 2,
audiobookshelf-1  |       _maxListeners: undefined,
audiobookshelf-1  |       defaultPort: 443,
audiobookshelf-1  |       protocol: 'https:',
audiobookshelf-1  |       options: [Object: null prototype],
audiobookshelf-1  |       requests: [Object: null prototype] {},
audiobookshelf-1  |       sockets: [Object: null prototype] {},
audiobookshelf-1  |       freeSockets: [Object: null prototype],
audiobookshelf-1  |       keepAliveMsecs: 1000,
audiobookshelf-1  |       keepAlive: true,
audiobookshelf-1  |       maxSockets: Infinity,
audiobookshelf-1  |       maxFreeSockets: 256,
audiobookshelf-1  |       scheduling: 'lifo',
audiobookshelf-1  |       maxTotalSockets: Infinity,
audiobookshelf-1  |       totalSocketCount: 13,
audiobookshelf-1  |       maxCachedSessions: 100,
audiobookshelf-1  |       _sessionCache: [Object],
audiobookshelf-1  |       [Symbol(shapeMode)]: false,
audiobookshelf-1  |       [Symbol(kCapture)]: false
audiobookshelf-1  |     },
audiobookshelf-1  |     socketPath: undefined,
audiobookshelf-1  |     method: 'GET',
audiobookshelf-1  |     maxHeaderSize: undefined,
audiobookshelf-1  |     insecureHTTPParser: undefined,
audiobookshelf-1  |     joinDuplicateHeaders: undefined,
audiobookshelf-1  |     path: '/books/B0DK3LD9CF?region=in',
audiobookshelf-1  |     _ended: true,
audiobookshelf-1  |     res: IncomingMessage {
audiobookshelf-1  |       _events: [Object],
audiobookshelf-1  |       _readableState: [ReadableState],
audiobookshelf-1  |       _maxListeners: undefined,
audiobookshelf-1  |       socket: null,
audiobookshelf-1  |       httpVersionMajor: 1,
audiobookshelf-1  |       httpVersionMinor: 1,
audiobookshelf-1  |       httpVersion: '1.1',
audiobookshelf-1  |       complete: true,
audiobookshelf-1  |       rawHeaders: [Array],
audiobookshelf-1  |       rawTrailers: [],
audiobookshelf-1  |       joinDuplicateHeaders: undefined,
audiobookshelf-1  |       aborted: false,
audiobookshelf-1  |       upgrade: false,
audiobookshelf-1  |       url: '',
audiobookshelf-1  |       method: null,
audiobookshelf-1  |       statusCode: 500,
audiobookshelf-1  |       statusMessage: 'Internal Server Error',
audiobookshelf-1  |       client: [TLSSocket],
audiobookshelf-1  |       _consuming: false,
audiobookshelf-1  |       _dumped: false,
audiobookshelf-1  |       req: [Circular *1],
audiobookshelf-1  |       _eventsCount: 4,
audiobookshelf-1  |       responseUrl: 'https://api.audnex.us/books/B0DK3LD9CF?region=in',
audiobookshelf-1  |       redirects: [],
audiobookshelf-1  |       [Symbol(shapeMode)]: true,
audiobookshelf-1  |       [Symbol(kCapture)]: false,
audiobookshelf-1  |       [Symbol(kHeaders)]: [Object],
audiobookshelf-1  |       [Symbol(kHeadersCount)]: 54,
audiobookshelf-1  |       [Symbol(kTrailers)]: null,
audiobookshelf-1  |       [Symbol(kTrailersCount)]: 0
audiobookshelf-1  |     },
audiobookshelf-1  |     aborted: false,
audiobookshelf-1  |     timeoutCb: null,
audiobookshelf-1  |     upgradeOrConnect: false,
audiobookshelf-1  |     parser: null,
audiobookshelf-1  |     maxHeadersCount: null,
audiobookshelf-1  |     reusedSocket: true,
audiobookshelf-1  |     host: 'api.audnex.us',
audiobookshelf-1  |     protocol: 'https:',
audiobookshelf-1  |     _redirectable: Writable {
audiobookshelf-1  |       _events: [Object],
audiobookshelf-1  |       _writableState: [WritableState],
audiobookshelf-1  |       _maxListeners: undefined,
audiobookshelf-1  |       _options: [Object],
audiobookshelf-1  |       _ended: true,
audiobookshelf-1  |       _ending: true,
audiobookshelf-1  |       _redirectCount: 0,
audiobookshelf-1  |       _redirects: [],
audiobookshelf-1  |       _requestBodyLength: 0,
audiobookshelf-1  |       _requestBodyBuffers: [],
audiobookshelf-1  |       _eventsCount: 3,
audiobookshelf-1  |       _onNativeResponse: [Function (anonymous)],
audiobookshelf-1  |       _currentRequest: [Circular *1],
audiobookshelf-1  |       _currentUrl: 'https://api.audnex.us/books/B0DK3LD9CF?region=in',
audiobookshelf-1  |       _timeout: null,
audiobookshelf-1  |       [Symbol(shapeMode)]: true,
audiobookshelf-1  |       [Symbol(kCapture)]: false
audiobookshelf-1  |     },
audiobookshelf-1  |     [Symbol(shapeMode)]: false,
audiobookshelf-1  |     [Symbol(kCapture)]: false,
audiobookshelf-1  |     [Symbol(kBytesWritten)]: 0,
audiobookshelf-1  |     [Symbol(kNeedDrain)]: false,
audiobookshelf-1  |     [Symbol(corked)]: 0,
audiobookshelf-1  |     [Symbol(kOutHeaders)]: [Object: null prototype] {
audiobookshelf-1  |       accept: [Array],
audiobookshelf-1  |       'user-agent': [Array],
audiobookshelf-1  |       host: [Array]
audiobookshelf-1  |     },
audiobookshelf-1  |     [Symbol(errored)]: null,
audiobookshelf-1  |     [Symbol(kHighWaterMark)]: 16384,
audiobookshelf-1  |     [Symbol(kRejectNonStandardBodyWrites)]: false,
audiobookshelf-1  |     [Symbol(kUniqueHeaders)]: null
audiobookshelf-1  |   },
audiobookshelf-1  |   response: {
audiobookshelf-1  |     status: 500,
audiobookshelf-1  |     statusText: 'Internal Server Error',
audiobookshelf-1  |     headers: {
audiobookshelf-1  |       date: 'Sat, 21 Dec 2024 10:10:39 GMT',
audiobookshelf-1  |       'content-type': 'application/json; charset=utf-8',
audiobookshelf-1  |       'content-length': '117',
audiobookshelf-1  |       connection: 'keep-alive',
audiobookshelf-1  |       'content-security-policy': "default-src 'self';base-uri 'self';font-src 'self' https: data:;form-action 'self';frame-ancestors 'self';img-src 'self' data:;object-src 'none';script-src 'self';script-src-attr 'none';style-src 'self' https: 'unsafe-inline';upgrade-insecure-requests",
audiobookshelf-1  |       'cross-origin-opener-policy': 'same-origin',
audiobookshelf-1  |       'cross-origin-resource-policy': 'same-origin',
audiobookshelf-1  |       'origin-agent-cluster': '?1',
audiobookshelf-1  |       'referrer-policy': 'no-referrer',
audiobookshelf-1  |       'strict-transport-security': 'max-age=15552000; includeSubDomains',
audiobookshelf-1  |       'x-content-type-options': 'nosniff',
audiobookshelf-1  |       'x-dns-prefetch-control': 'off',
audiobookshelf-1  |       'x-download-options': 'noopen',
audiobookshelf-1  |       'x-frame-options': 'SAMEORIGIN',
audiobookshelf-1  |       'x-permitted-cross-domain-policies': 'none',
audiobookshelf-1  |       'x-xss-protection': '0',
audiobookshelf-1  |       vary: 'Origin',
audiobookshelf-1  |       'x-ratelimit-limit': '100',
audiobookshelf-1  |       'x-ratelimit-remaining': '43',
audiobookshelf-1  |       'x-ratelimit-reset': '29',
audiobookshelf-1  |       'cf-cache-status': 'BYPASS',
audiobookshelf-1  |       'report-to': '{"endpoints":[{"url":"https:\\/\\/a.nel.cloudflare.com\\/report\\/v4?s=l6BFUxbv8SzO%2F42salWGfLSZbes0iI2O1j9cShgVIWxnwLc%2FVo56yXhrWskeX8cIdb6XNtDAyslhIxmuVXMprE5003yqNuWLmvpfJqWZxPNOm%2FIemP6iLz7CLkxrXa0S"}],"group":"cf-nel","max_age":604800}',
audiobookshelf-1  |       nel: '{"success_fraction":0,"report_to":"cf-nel","max_age":604800}',
audiobookshelf-1  |       server: 'cloudflare',
audiobookshelf-1  |       'cf-ray': '8f57155ada9c2c26-FRA',
audiobookshelf-1  |       'alt-svc': 'h3=":443"; ma=86400',
audiobookshelf-1  |       'server-timing': 'cfL4;desc="?proto=TCP&rtt=5637&min_rtt=5606&rtt_var=1636&sent=8&recv=8&lost=0&retrans=0&sent_bytes=2387&recv_bytes=1066&delivery_rate=747805&cwnd=253&unsent_bytes=0&cid=6c1f68a1da8f9091&ts=4096&x=0"'
audiobookshelf-1  |     },
audiobookshelf-1  |     config: {
audiobookshelf-1  |       transitional: [Object],
audiobookshelf-1  |       adapter: [Function: httpAdapter],
audiobookshelf-1  |       transformRequest: [Array],
audiobookshelf-1  |       transformResponse: [Array],
audiobookshelf-1  |       timeout: 30000,
audiobookshelf-1  |       xsrfCookieName: 'XSRF-TOKEN',
audiobookshelf-1  |       xsrfHeaderName: 'X-XSRF-TOKEN',
audiobookshelf-1  |       maxContentLength: -1,
audiobookshelf-1  |       maxBodyLength: -1,
audiobookshelf-1  |       env: [Object],
audiobookshelf-1  |       validateStatus: [Function: validateStatus],
audiobookshelf-1  |       headers: [Object],
audiobookshelf-1  |       method: 'get',
audiobookshelf-1  |       url: 'https://api.audnex.us/books/B0DK3LD9CF?region=in',
audiobookshelf-1  |       data: undefined
audiobookshelf-1  |     },
audiobookshelf-1  |     request: <ref *1> ClientRequest {
audiobookshelf-1  |       _events: [Object: null prototype],
audiobookshelf-1  |       _eventsCount: 7,
audiobookshelf-1  |       _maxListeners: undefined,
audiobookshelf-1  |       outputData: [],
audiobookshelf-1  |       outputSize: 0,
audiobookshelf-1  |       writable: true,
audiobookshelf-1  |       destroyed: true,
audiobookshelf-1  |       _last: true,
audiobookshelf-1  |       chunkedEncoding: false,
audiobookshelf-1  |       shouldKeepAlive: true,
audiobookshelf-1  |       maxRequestsOnConnectionReached: false,
audiobookshelf-1  |       _defaultKeepAlive: true,
audiobookshelf-1  |       useChunkedEncodingByDefault: false,
audiobookshelf-1  |       sendDate: false,
audiobookshelf-1  |       _removedConnection: false,
audiobookshelf-1  |       _removedContLen: false,
audiobookshelf-1  |       _removedTE: false,
audiobookshelf-1  |       strictContentLength: false,
audiobookshelf-1  |       _contentLength: 0,
audiobookshelf-1  |       _hasBody: true,
audiobookshelf-1  |       _trailer: '',
audiobookshelf-1  |       finished: true,
audiobookshelf-1  |       _headerSent: true,
audiobookshelf-1  |       _closed: true,
audiobookshelf-1  |       socket: [TLSSocket],
audiobookshelf-1  |       _header: 'GET /books/B0DK3LD9CF?region=in HTTP/1.1\r\n' +
audiobookshelf-1  |         'Accept: application/json, text/plain, */*\r\n' +
audiobookshelf-1  |         'User-Agent: axios/0.27.2\r\n' +
audiobookshelf-1  |         'Host: api.audnex.us\r\n' +
audiobookshelf-1  |         'Connection: keep-alive\r\n' +
audiobookshelf-1  |         '\r\n',
audiobookshelf-1  |       _keepAliveTimeout: 0,
audiobookshelf-1  |       _onPendingData: [Function: nop],
audiobookshelf-1  |       agent: [Agent],
audiobookshelf-1  |       socketPath: undefined,
audiobookshelf-1  |       method: 'GET',
audiobookshelf-1  |       maxHeaderSize: undefined,
audiobookshelf-1  |       insecureHTTPParser: undefined,
audiobookshelf-1  |       joinDuplicateHeaders: undefined,
audiobookshelf-1  |       path: '/books/B0DK3LD9CF?region=in',
audiobookshelf-1  |       _ended: true,
audiobookshelf-1  |       res: [IncomingMessage],
audiobookshelf-1  |       aborted: false,
audiobookshelf-1  |       timeoutCb: null,
audiobookshelf-1  |       upgradeOrConnect: false,
audiobookshelf-1  |       parser: null,
audiobookshelf-1  |       maxHeadersCount: null,
audiobookshelf-1  |       reusedSocket: true,
audiobookshelf-1  |       host: 'api.audnex.us',
audiobookshelf-1  |       protocol: 'https:',
audiobookshelf-1  |       _redirectable: [Writable],
audiobookshelf-1  |       [Symbol(shapeMode)]: false,
audiobookshelf-1  |       [Symbol(kCapture)]: false,
audiobookshelf-1  |       [Symbol(kBytesWritten)]: 0,
audiobookshelf-1  |       [Symbol(kNeedDrain)]: false,
audiobookshelf-1  |       [Symbol(corked)]: 0,
audiobookshelf-1  |       [Symbol(kOutHeaders)]: [Object: null prototype],
audiobookshelf-1  |       [Symbol(errored)]: null,
audiobookshelf-1  |       [Symbol(kHighWaterMark)]: 16384,
audiobookshelf-1  |       [Symbol(kRejectNonStandardBodyWrites)]: false,
audiobookshelf-1  |       [Symbol(kUniqueHeaders)]: null
audiobookshelf-1  |     },
audiobookshelf-1  |     data: {
audiobookshelf-1  |       statusCode: 500,
audiobookshelf-1  |       error: 'Internal Server Error',
audiobookshelf-1  |       message: "Item not available in region 'in' for ASIN: B0DK3LD9CF"
audiobookshelf-1  |     }
audiobookshelf-1  |   }
audiobookshelf-1  | }

Additional Notes

No response

@d33tah d33tah added the bug Something isn't working label Dec 21, 2024
@nichwall
Copy link
Contributor

This error is due to Audnexus returning a 500 when it has an internal server error. This is not an issue with ABS, but ABS could handle the 500 error better or make it more clear what is going on. We do still want to report the full response (which is what was posted originally) so we can narrow down other errors, but maybe adding a check of whether the message matches a specific pattern like "item not available" or other patterns that we find to display a better log to the user.

I was able to reproduce this behavior when uploading a book using edge b4e8f16. Both the original post and this reproduction of the issue took place after server v2.17.5 was released.

This behavior only seems to happen when "Auto-Fetch Metadata" option is selected and the provider is Audible. I was unable to reproduce the error when not Auto-Fetching metadata or when using other providers. I have added the debug output "I, Robot" by Isaac Asimov when fetching against Audible, where the folder name is 1 I Robot.

[2024-12-26 13:03:06.414] DEBUG: Book Search: title: "1 I Robot", author: "", provider: audible
[2024-12-26 13:03:06.417] DEBUG: [Audible] Search url: https://api.audible.com/1.0/catalog/products?num_results=10&products_sort_by=Relevance&title=1+I+Robot
[2024-12-26 13:03:06.743] DEBUG: [Audible] ASIN url: https://api.audnex.us/books/B0DNPVXTPH  <-- HTTP 500 error, item not available in region
[2024-12-26 13:03:07.683] INFO: [Audnexus] Searching for author "https://api.audnex.us/authors?name=1+i+robot"
[2024-12-26 13:03:07.897] DEBUG: [AuthorCandidates] Found 1 fuzzy author candidates
[2024-12-26 13:03:07.897] DEBUG: [ '' ]
[2024-12-26 13:03:07.899] DEBUG: [TitleCandidates] Found 2 fuzzy title candidates
[2024-12-26 13:03:07.900] DEBUG: [ 'i robot', '1 i robot' ]
[2024-12-26 13:03:07.900] DEBUG: Book Search: title: "i robot", author: "", provider: audible
[2024-12-26 13:03:07.901] DEBUG: [Audible] Search url: https://api.audible.com/1.0/catalog/products?num_results=10&products_sort_by=Relevance&title=i+robot
[2024-12-26 13:03:08.056] DEBUG: [Audible] ASIN url: https://api.audnex.us/books/B0077DESL0
[2024-12-26 13:03:08.057] DEBUG: [Audible] ASIN url: https://api.audnex.us/books/B0DPXNCMKG
[2024-12-26 13:03:08.060] DEBUG: [Audible] ASIN url: https://api.audnex.us/books/B002V5BE1Q
[2024-12-26 13:03:08.063] DEBUG: [Audible] ASIN url: https://api.audnex.us/books/B01AOFQYUU
[2024-12-26 13:03:08.066] DEBUG: [Audible] ASIN url: https://api.audnex.us/books/0008305919
[2024-12-26 13:03:08.069] DEBUG: [Audible] ASIN url: https://api.audnex.us/books/B00EZTOP30
[2024-12-26 13:03:08.072] DEBUG: [Audible] ASIN url: https://api.audnex.us/books/B0B1QRJ6MJ  <-- HTTP 500 error, 'program_participation' required
[2024-12-26 13:03:08.075] DEBUG: [Audible] ASIN url: https://api.audnex.us/books/B0DR725BYN  <-- no error, but item not available in region
[2024-12-26 13:03:08.078] DEBUG: [Audible] ASIN url: https://api.audnex.us/books/B0DRFZR5RL  <-- HTTP 500 error, item not available in region
[2024-12-26 13:03:08.080] DEBUG: [Audible] ASIN url: https://api.audnex.us/books/1473573521

The process logs only show HTTP 500 errors from Audnexus for the following ASIN:

  • B0DNPVXTPH (happens on line 3 of log above, so easy to miss)
  • B0DRFZR5RL
  • B0B1QRJ6MJ

I received two different types of error 500 from Audnexus, but both are due to not being able to get data for the specific ASIN:

    data: {
      statusCode: 500,
      error: 'Internal Server Error',
      message: "Item not available in region 'us' for ASIN: B0DRFZR5RL"
    }

and

    data: {
      statusCode: 500,
      error: 'Internal Server Error',
      message: "Required key 'program_participation' does not exist in Audible API response for ASIN B0B1QRJ6MJ"
    }

@nichwall
Copy link
Contributor

I did open laxamentumtech/audnexus#812 to see if this is an issue with the Audnexus API documentation or something we would need to account for. The documentation reads like this should return a 404 instead of a 500.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants