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] Occasional Service Unavailable - 503 when posting video or image #499

Open
francistogram opened this issue Sep 1, 2023 · 0 comments

Comments

@francistogram
Copy link

Describe the bug
We've been posting threads and every once in a while we'll get back a 503, service unavailable error

ApiResponseError: Request failed with code 503
    at RequestHandlerHelper.createResponseError (/var/task/node_modules/twitter-api-v2/dist/cjs/client-mixins/request-handler.helper.js:103:16)
    at RequestHandlerHelper.onResponseEndHandler (/var/task/node_modules/twitter-api-v2/dist/cjs/client-mixins/request-handler.helper.js:252:25)
    at Gunzip.emit (node:events:514:28)
    at endReadableNT (node:internal/streams/readable:1359:12)
    at process.processTicksAndRejections (node:internal/process/task_queues:82:21) {
  error: true,
  type: 'response',
  code: 503,
  headers: {
    date: 'Thu, 31 Aug 2023 17:45:05 UTC',
    perf: '7626143928',
    server: 'tsa_b',
    'set-cookie': [
      'guest_id=v1%3A169350390426486385; Max-Age=34214400; Expires=Mon, 30 Sep 2024 17:45:05 GMT; Path=/; Domain=.twitter.com; Secure; SameSite=None'
    ],
    'api-version': '2.66',
    'content-type': 'application/json; charset=utf-8',
    'cache-control': 'no-cache, no-store, max-age=0',
    'content-length': '94',
    'x-access-level': 'read-write',
    'x-frame-options': 'SAMEORIGIN',
    'content-encoding': 'gzip',
    'x-transaction-id': '1ffe80abeab02a67',
    'x-xss-protection': '0',
    'x-rate-limit-limit': '40000',
    'x-rate-limit-reset': '1693504804',
    'content-disposition': 'attachment; filename=json.json',
    'x-content-type-options': 'nosniff',
    'x-rate-limit-remaining': '40000',
    'x-app-limit-24hour-limit': '50',
    'x-app-limit-24hour-reset': '1693587602',
    'strict-transport-security': 'max-age=631138519',
    'x-user-limit-24hour-limit': '50',
    'x-user-limit-24hour-reset': '1693575905',
    'x-app-limit-24hour-remaining': '47',
    'x-user-limit-24hour-remaining': '47',
    'x-response-time': '1028',
    'x-connection-hash': 'a942524660f7ee7aa5ce51cd2e21913f00aa6103b9cf3f8b7c7d75ea2235c78e',
    connection: 'close'
  },
  rateLimit: { limit: 40000, remaining: 40000, reset: 1693504804 },
  data: {
    title: 'Service Unavailable',
    detail: 'Service Unavailable',
    type: 'about:blank',
    status: 503
  }
}

The tweet does actually post but because it's a 503 it's interpreted as a failure and the thread stops posting

To Reproduce
I'm actually unable to reproduce consistently as I think it's some kind of Twitter API bug

I wonder if anyone's run into this and figured out how to work around this as I think it's an issue with the Twitter API

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant