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

LCS restarts when running into a FetchError. #2

Open
Avi0n opened this issue Jul 3, 2023 · 1 comment
Open

LCS restarts when running into a FetchError. #2

Avi0n opened this issue Jul 3, 2023 · 1 comment
Labels
bug Something isn't working

Comments

@Avi0n
Copy link

Avi0n commented Jul 3, 2023

When a remote instance can't be reached or returns invalid json, LCS continually restarts instead of skipping the instance it can't reach.

Checking lemmy.sdf.org for posts of Hot

/app/node_modules/node-fetch/lib/index.js:1505
                        reject(new FetchError(`request to ${request.url} failed, reason: ${err.message}`, 'system', err));
                               ^
FetchError: request to https://lemmy.sdf.org/api/v3/post/list?type_=All&sort=Hot&limit=50 failed, reason: connect ECONNREFUSED 205.166.94.11:443
    at ClientRequest.<anonymous> (/app/node_modules/node-fetch/lib/index.js:1505:11)
    at ClientRequest.emit (node:events:511:28)
    at TLSSocket.socketErrorListener (node:_http_client:495:9)
    at TLSSocket.emit (node:events:511:28)
    at emitErrorNT (node:internal/streams/destroy:151:8)
    at emitErrorCloseNT (node:internal/streams/destroy:116:3)
    at process.processTicksAndRejections (node:internal/process/task_queues:82:21) {
  type: 'system',
  errno: 'ECONNREFUSED',
  code: 'ECONNREFUSED'
}

Node.js v20.3.1

> lemmy-subscriber@1.0.0 start
> node index.js
Checking lemmy.world for posts of TopDay

/app/node_modules/node-fetch/lib/index.js:273
                                return Body.Promise.reject(new FetchError(`invalid json response body at ${_this2.url} reason: ${err.message}`, 'invalid-json'));
                                                           ^
FetchError: invalid json response body at https://lemmy.world/api/v3/post/list?type_=All&sort=TopDay&limit=50 reason: Unexpected token '<', "<html>
<h"... is not valid JSON
    at /app/node_modules/node-fetch/lib/index.js:273:32
    at process.processTicksAndRejections (node:internal/process/task_queues:95:5) {
  type: 'invalid-json'
}

Node.js v20.3.1

> lemmy-subscriber@1.0.0 start
> node index.js
@Avi0n Avi0n changed the title LCS restarts when a remote instance returns ECONNREFUSED LCS restarts when running into a FetchError. Jul 3, 2023
@joeknock90
Copy link

This issue seems to actually crash my instance causing a lemmy to enter a loop of this issue:
LemmyNet/lemmy#3661

@Fmstrat Fmstrat added the bug Something isn't working label Oct 11, 2023
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

3 participants