You need to enable JavaScript to run this app.
优惠活动
大模型
产品
解决方案
定价
更多

如何修复Heroku错误:Process exited with status 129及Error R13

Troubleshooting Heroku Exit Status 129 & Error R13 (Attach Error)

Hey, let's tackle those errors you're seeing with your Telegram bot on Heroku. You mentioned you fixed the SIGKILL issues, but now running node musicology.js is throwing exit status 129 and an R13 attach error. Let's break this down step by step.

First, here's the log output you shared for context:

2018-05-14T09:12:46.770011+00:00 app[api]: Starting process with command node musicology.js by user leshaber24@yandex.ru
2018-05-14T09:12:50.704836+00:00 heroku[run.5756]: Awaiting client
2018-05-14T09:12:50.760658+00:00 heroku[run.5756]: Starting process with command node musicology.js
2018-05-14T09:12:50.767575+00:00 heroku[run.5756]: State changed from starting to up
2018-05-14T09:12:56.951346+00:00 heroku[run.5756]: Client connection closed. Sending SIGHUP to all processes
2018-05-14T09:12:57.484760+00:00 heroku[run.5756]: Process exited with status 129
2018-05-14T09:12:57.499531+00:00 heroku[run.5756]: State changed from up to complete

What's Causing This?

Looking at the logs, the key line is Client connection closed. Sending SIGHUP to all processes. Exit status 129 is tied to the SIGHUP signal, which Heroku sends when the interactive client connection (from heroku run) drops. Error R13 is just Heroku telling you it couldn't maintain that attach connection to your process.

The core issue here is that heroku run is designed for one-off interactive commands, not long-running processes like a Telegram bot that needs to stay alive in the background. When you close your local terminal or the session times out, Heroku sends that SIGHUP and kills your bot.

Fixes to Try

  • Use a Worker Dyno (The Right Way to Run Long-Living Processes)

    • Create a Procfile in your project root (no file extension) with this line:
      worker: node musicology.js
      
    • Commit this file to your repo and push to Heroku.
    • Scale up the worker dyno to start your bot as a persistent background process:
      heroku ps:scale worker=1
      
    • This way, your bot runs independently of your local terminal session and won't get killed when you disconnect.
  • Run Without Attaching (If You Need a Temporary Session)

    • If you just want to test the bot temporarily with heroku run, add the --no-attach flag to avoid the attach error:
      heroku run node musicology.js --no-attach
      
    • This starts the process without tying it to your local client, so it won't receive a SIGHUP when you close your terminal. You can still view logs with heroku logs --tail to monitor it.
  • Check for Interactive Dependencies

    • Make sure your bot isn't expecting any interactive input (like a command-line prompt) that would cause it to hang or exit when running non-interactively. All configuration (like your Telegram bot token) should be set via Heroku environment variables:
      heroku config:set TELEGRAM_BOT_TOKEN=your_bot_token_here
      
    • Also, confirm your package.json has all required dependencies and specifies a compatible Node.js version (add this if missing):
      "engines": {
        "node": "16.x"
      }
      
  • Verify Dyno Resources

    • Even though you fixed the SIGKILL error, double-check that your worker dyno has enough memory. Use heroku ps or the Heroku dashboard to monitor memory usage—if you're hitting limits, you might need to upgrade to a larger dyno size.

内容的提问来源于stack exchange,提问作者Bereznyak

相关产品推荐
方舟 Agent Plan

超全模态模型 × Harness 升级,最新支持 Deepseek-V4.1-Flash、GLM-5.3 系列、Doubao-Seedream-5.0-pro、Kimi-K3 (部分), 限时 9.9 元起

最近更新时间:2026.05.27 09:36:05