[bug] Akkoma keeps refetching even got 429 #606

Open
opened 2023-07-27 17:49:50 +00:00 by Yonle · 1 comment

Your setup

From source

Extra details

No response

Version

33e7ae763

PostgreSQL version

15

What were you trying to do?

When Akkoma gets error 429, It still keeps refetching and just constantly refetching until the server reboot.

Resulting accidental DOS.

What did you expect to happen?

When the backend receives 429 when trying to get object, it should only try again in several minutes

or just stop.

What actually happened?

DOS-ing an instance that gives 429 status.

Logs

```
19:37:58.409 [error] Could not fetch page https://compostintraining.club/users/prplecake/statuses/108493687465375532/replies?only_other_accounts=true&page=true - {:ok, %Tesla.Env{method: :get, url: "https://compostintraining.club/users/prplecake/statuses/108493687465375532/replies?only_other_accounts=true&page=true", query: [], headers: [{"date", "Thu, 27 Jul 2023 17:37:58 GMT"}, {"content-type", "application/json"}, {"content-length", "29"}, {"connection", "keep-alive"}, {"x-ratelimit-limit", "300"}, {"x-ratelimit-remaining", "0"}, {"x-ratelimit-reset", "2023-07-27T17:45:00.320831Z"}, {"cache-control", "no-cache"}, {"content-security-policy", "base-uri 'none'; default-src 'none'; frame-ancestors 'none'; script-src 'self' https://assets.compostintraining.club 'wasm-unsafe-eval' https://cdn.usefathom.com; font-src 'self' https://assets.compostintraining.club; img-src 'self' data: blob: https://assets.compostintraining.club https://files.compostintraining.club https://api.tenor.com https://media.tenor.com https://compostintraining.github.io https://cdn.usefathom.com https://34.si https://inst.ance.tk; style-src 'self' https://assets.compostintraining.club 'unsafe-inline' https://inst.ance.tk https://compostintraining.github.io 'nonce-rFvd1Svo5ChuVOCfn+V3mg=='; media-src 'self' data: https://assets.compostintraining.club https://files.compostintraining.club https://api.tenor.com https://media.tenor.com https://compostintraining.github.io https://cdn.usefathom.com; frame-src 'self' https:; child-src 'self' blob: https://assets.compostintraining.club; worker-src 'self' blob: https://assets.compostintraining.club; connect-src 'self' blob: data: wss://compostintraining.club https://assets.compostintraining.club https://files.compostintraining.club https://api.tenor.com https://media.tenor.com https://compostintraining.github.io https://cdn.usefathom.com; manifest-src 'self' https://assets.compostintraining.club; form-action 'self'"}, {"x-request-id", "277d02e0-d797-4b54-84c2-fbdd753465f7"}, {"x-runtime", "0.002663"}, {"strict-transport-security", "max-age=63072000; includeSubDomains"}, {"strict-transport-security", "max-age=31536000"}], body: "{\"error\":\"Too many requests\"}", status: 429, opts: [adapter: [receive_timeout: 15000, pool_timeout: 5000, name: MyFinch]], __module__: Tesla, __client__: %Tesla.
Client{fun: nil, pre: [{Tesla.Middleware.FollowRedirects, :call, [[]]}, {Tesla
.Middleware.Telemetry, :call, [[]]}], post: [], adapter: nil}}}
```

Severity

I cannot use it as easily as I'd like

Have you searched for this issue?

  • I have double-checked and have not found this issue mentioned anywhere.
### Your setup From source ### Extra details _No response_ ### Version 33e7ae763 ### PostgreSQL version 15 ### What were you trying to do? When Akkoma gets error 429, It still keeps refetching and just constantly refetching until the server reboot. Resulting accidental DOS. ### What did you expect to happen? When the backend receives 429 when trying to get object, it should only try again in several minutes or just stop. ### What actually happened? DOS-ing an instance that gives 429 status. ### Logs ````shell ``` 19:37:58.409 [error] Could not fetch page https://compostintraining.club/users/prplecake/statuses/108493687465375532/replies?only_other_accounts=true&page=true - {:ok, %Tesla.Env{method: :get, url: "https://compostintraining.club/users/prplecake/statuses/108493687465375532/replies?only_other_accounts=true&page=true", query: [], headers: [{"date", "Thu, 27 Jul 2023 17:37:58 GMT"}, {"content-type", "application/json"}, {"content-length", "29"}, {"connection", "keep-alive"}, {"x-ratelimit-limit", "300"}, {"x-ratelimit-remaining", "0"}, {"x-ratelimit-reset", "2023-07-27T17:45:00.320831Z"}, {"cache-control", "no-cache"}, {"content-security-policy", "base-uri 'none'; default-src 'none'; frame-ancestors 'none'; script-src 'self' https://assets.compostintraining.club 'wasm-unsafe-eval' https://cdn.usefathom.com; font-src 'self' https://assets.compostintraining.club; img-src 'self' data: blob: https://assets.compostintraining.club https://files.compostintraining.club https://api.tenor.com https://media.tenor.com https://compostintraining.github.io https://cdn.usefathom.com https://34.si https://inst.ance.tk; style-src 'self' https://assets.compostintraining.club 'unsafe-inline' https://inst.ance.tk https://compostintraining.github.io 'nonce-rFvd1Svo5ChuVOCfn+V3mg=='; media-src 'self' data: https://assets.compostintraining.club https://files.compostintraining.club https://api.tenor.com https://media.tenor.com https://compostintraining.github.io https://cdn.usefathom.com; frame-src 'self' https:; child-src 'self' blob: https://assets.compostintraining.club; worker-src 'self' blob: https://assets.compostintraining.club; connect-src 'self' blob: data: wss://compostintraining.club https://assets.compostintraining.club https://files.compostintraining.club https://api.tenor.com https://media.tenor.com https://compostintraining.github.io https://cdn.usefathom.com; manifest-src 'self' https://assets.compostintraining.club; form-action 'self'"}, {"x-request-id", "277d02e0-d797-4b54-84c2-fbdd753465f7"}, {"x-runtime", "0.002663"}, {"strict-transport-security", "max-age=63072000; includeSubDomains"}, {"strict-transport-security", "max-age=31536000"}], body: "{\"error\":\"Too many requests\"}", status: 429, opts: [adapter: [receive_timeout: 15000, pool_timeout: 5000, name: MyFinch]], __module__: Tesla, __client__: %Tesla. Client{fun: nil, pre: [{Tesla.Middleware.FollowRedirects, :call, [[]]}, {Tesla .Middleware.Telemetry, :call, [[]]}], post: [], adapter: nil}}} ``` ```` ### Severity I cannot use it as easily as I'd like ### Have you searched for this issue? - [ ] I have double-checked and have not found this issue mentioned anywhere.
Yonle added the
bug
label 2023-07-27 17:49:50 +00:00
Contributor

Possible dupe of #269

Possible dupe of https://akkoma.dev/AkkomaGang/akkoma/issues/269
Sign in to join this conversation.
No Milestone
No project
No Assignees
2 Participants
Notifications
Due Date
The due date is invalid or out of range. Please use the format 'yyyy-mm-dd'.

No due date set.

Dependencies

No dependencies set.

Reference: AkkomaGang/akkoma#606
No description provided.