Telegram Bot Crashes
kdt82
FREEOP

3 months ago

My Telegram Bot keeps crashing unexpectedly - its not a massive project - I cannot figure out why? Can you see more than I can. Advise what I need to fix to sort the problem out.

$10 Bounty

3 Replies

3 months ago

This thread has been marked as public for community involvement, as it does not contain any sensitive or personal information. Any further activity in this thread will be visible to everyone.

Status changed to Open brody 3 months ago


kdt82
FREEOP

3 months ago

Requested information that may help

Language: Node.js (TypeScript)

Communication Method: Polling

Last 20 Lines from Railway Logs:

[2025-12-19 02:25:00] Processing notification job: check_raffle_end

[2025-12-19 02:25:00] Processing notification job: process_due_notifications

[2025-12-19 02:25:07] Memory: RSS=125MB, Heap=32/41MB, External=4MB

[2025-12-19 02:26:00] Processing notification job: process_due_notifications

[2025-12-19 02:26:07] Memory: RSS=122MB, Heap=36/41MB, External=4MB

[2025-12-19 02:27:00] Processing notification job: process_due_notifications

[2025-12-19 02:28:00] Processing notification job: process_due_notifications

[2025-12-19 02:28:07] Memory: RSS=123MB, Heap=37/42MB, External=5MB

[2025-12-19 02:29:00] Processing notification job: process_due_notifications

[2025-12-19 02:29:07] Memory: RSS=122MB, Heap=32/41MB, External=4MB

npm error path /app

npm error command failed

npm error signal SIGSEGV

npm error command sh -c npx prisma db push --accept-data-loss --skip-generate && node dist/index.js

Crash Frequency: 2 crashes in the last 3 weeks (Dec 3 and Dec 11). Most recent incident was a SIGSEGV (segmentation fault) on Dec 19 - the process was running normally with stable memory before the crash.


kdt82
FREEOP

3 months ago

It crashes intermittently, no rhyme or reason that I haven't already addressed already and seems to come back randomly. I get and email and then i restart the bot and its fine for another period.


shakirali78690
FREE

2 months ago

The crash isn’t from Telegram or memory, it’s from your start command running npx prisma db push on every boot. That Prisma command sometimes SIGSEGVs and kills the process. Run prisma db push/migrations once (locally or via a one‑off job), then change your Railway start command to just node dist/index.js. Also make sure you’re on the latest Prisma + Node LTS and add better error handling around your Prisma queries so a DB hiccup doesn’t take the whole bot down.


Loading...