alexbosworth / balanceofsatoshis

Tool for working with the balance of your satoshis on LND
MIT License
554 stars 78 forks source link

[telegram] HttpError: Network request for 'sendMessage' failed! #558

Open Impa10r opened 11 months ago

Impa10r commented 11 months ago

I am running a testnet node in VirtualBox and quite often bos throws error: FetchError: request to https://api.telegram.org/bot 647...w/sendMessage failed, reason: read ECONNRESET

So bos restarts and I get 'Connected to ' message instead.

Manual ping and curl api.telegram.org never fail. Also, my mainnet node running on Umbrel does not experience this problem.

Not sure what is causing this. Maybe add a listener to this error and try re-sending the message at least once?

brianoflondon commented 10 months ago

I'm getting exactly this though it follows a change in my fiber network connection (switched from my own TP-Link gear back to my ISP's crappy Broadcom box). Having said that, other services I'm running on my network at home haven't failed in this way.

I'm running inside Docker

connecting_to_telegram:
  - v4vapp

is_connected: true

err:
  - 503
  - ErrorInBackupsSub
  -
    err:
      message: 14 UNAVAILABLE: read ECONNRESET
      stack:
        - Error: 14 UNAVAILABLE: read ECONNRESET
        -     at callErrorFromStatus (/app/node_modules/ln-service/node_modules/@grpc/grpc-js/build/src/call.js:31:19)
        -     at Object.onReceiveStatus (/app/node_modules/ln-service/node_modules/@grpc/grpc-js/build/src/client.js:357:73)
        -     at Object.onReceiveStatus (/app/node_modules/ln-service/node_modules/@grpc/grpc-js/build/src/client-interceptors.js:323:181)
        -     at /app/node_modules/ln-service/node_modules/@grpc/grpc-js/build/src/resolving-call.js:99:78
        -     at process.processTicksAndRejections (node:internal/process/task_queues:77:11)
        - for call at
        -     at ServiceClientImpl.makeServerStreamRequest (/app/node_modules/ln-service/node_modules/@grpc/grpc-js/build/src/client.js:340:32)
        -     at ServiceClientImpl.<anonymous> (/app/node_modules/ln-service/node_modules/@grpc/grpc-js/build/src/make-client.js:105:19)
        -     at module.exports (/app/node_modules/ln-service/node_modules/lightning/lnd_methods/offchain/subscribe_to_backups.js:40:41)
        -     at /app/telegram/start_telegram_bot.js:572:23
        -     at /app/node_modules/async/internal/withoutIndex.js:8:40
        -     at eachOfArrayLike (/app/node_modules/async/eachOf.js:61:9)
        -     at eachOf (/app/node_modules/async/eachOf.js:181:12)
        -     at awaitable (/app/node_modules/async/internal/awaitify.js:13:28)
        -     at eachLimit (/app/node_modules/async/each.js:125:31)
        -     at awaitable (/app/node_modules/async/internal/awaitify.js:13:28)
        -     at asyncAuto.backups (/app/telegram/start_telegram_bot.js:570:16)
        -     at runTask (/app/node_modules/async/auto.js:293:13)
        -     at /app/node_modules/async/auto.js:233:31
        -     at processQueue (/app/node_modules/async/auto.js:243:13)
        -     at taskComplete (/app/node_modules/async/auto.js:259:9)
        -     at /app/node_modules/async/auto.js:286:17

connecting_to_telegram:
  - v4vapp

is_connected: true

logs are full of this.

Side note: it would be super helpful if message were time stamped! @alexbosworth

Impa10r commented 10 months ago

Surprisingly, I stopped seeing these errors after torrifying bos telegram.

brianoflondon commented 10 months ago

Hmmmm you mean the setting for socket in credentials.json is via Tor?

Impa10r commented 10 months ago

Yes. https://raspibolt.org/guide/bonus/lightning/balance-of-satoshis.html#tor-proxy-requires-v11501

brianoflondon commented 10 months ago

Thanks, interesting. I'm using BOS on a machine that isn't my node and connecting to a node which has a publicly accessible domain name so I'm not exactly sure how I could proxy.

But I am rebuilding my network at home and I have a feeling that factory resetting all my wifi extenders yesterday helped a lot with DNS stuff.