How to fix Heroku error: Process exited with status 129 - node.js

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
These are the logs coming from Heroku. My app is here: https://github.com/Alesha24/mysicology_telegram_bot
I've already fixed an error with SIGKILL command, now (after doing node musicology.js) error is of status 129 and moreover this one:
Error R13 (Attach error) -> Failed to attach to process
This error also appears to be unclear for me. Any ideas of way, how can I fix it?

Related

Is there a verbose mode that can be enabled for even more verbose error stacks?

I have a production only error appearing in my pm2 logs that is giving me absolutely no helpful information - the callstack is not deep enough to view where it started in my own codebase, and I know of no environment variables that can be modified for more verbose stack tracing
does anyone know of any settings that can effect the callstack
App [backgroundExcelIntegration:1] exited with code [0] via signal [SIGTERM]
App [backgroundExcelIntegration:1] starting in -fork mode-
TypeError [ERR_INVALID_ARG_TYPE]: The "data" argument must be of type string or an instance of Buffer, TypedArray, or DataView. Received type number (18583)
at Object.writeFileSync (fs.js:1522:5)
at /usr/lib/node_modules/pm2/lib/God/ForkMode.js:258:12
at wrapper (/usr/lib/node_modules/pm2/node_modules/async/internal/once.js:12:16)
at next (/usr/lib/node_modules/pm2/node_modules/async/waterfall.js:96:20)
at /usr/lib/node_modules/pm2/node_modules/async/internal/onlyOnce.js:12:16
at WriteStream.<anonymous> (/usr/lib/node_modules/pm2/lib/Utility.js:186:13)
at WriteStream.emit (events.js:400:28)
at WriteStream.emit (domain.js:537:15)
at internal/fs/streams.js:340:12
at FSReqCallback.oncomplete (fs.js:180:23)
App [backgroundExcelIntegration:1] online
pid=18547 msg=process killed
Deleting process 1
Stopping app:backgroundExcelIntegration id:1
App [backgroundExcelIntegration:1] exited with code [0] via signal [SIGINT]
pid=18583 msg=process killed
Exited peacefully
the answer ended up having nothing to do with node or typescript, it was a PM2 error, after observing pm2 monit it was discovered the server was crashing every 88 seconds (why 88 i have no idea), seemingly others have experienced similar issue and resolved it by running pm2 update
we ran pm2 update and the issue resolved itself

How to get a basic direvent watcher working?

I have read through the direvent documentation and am trying to get a simple watch working. Since I am having so much trouble with it, I am wondering if the issue has to do with the fact that the system I am using is nixos.
Here is the simple watcher file, watcher, I've created:
watcher {
path ./dir;
command "echo $file";
}
I run it in the foreground, so I can see the output, with direvent --foreground watcher. Once it's running, I create a file in dir, thus creating an event for it to respond to. However, it fails with the following output:
$ direvent --foreground watcher
direvent: [INFO] direvent 5.2 started
direvent: [ERROR] process 8552 failed with status 127
direvent: [ERROR] process 8555 failed with status 127
direvent: [ERROR] process 8557 failed with status 127
Since 127 usually means 'command not found', I tried specifying the path to echo, i.e. running this watcher instead:
watcher {
path ./dir;
command "/run/current-system/sw/bin/echo $file";
}
Then the output still gives an error, albeit a different one:
$ direvent --foreground watcher
direvent: [INFO] direvent 5.2 started
direvent: [ERROR] process 8645 failed with status 1
direvent: [ERROR] process 8651 failed with status 1
direvent: [ERROR] process 8652 failed with status 1
So the failure is now with status 1. I am not sure what to try next. I'm wondering if this issue is due to the fact that I am running nixos. Anyone know what I might try next to get direvent working?
direvent has two other flag that may be useful for you.
--debug(-d) to give extra information.
There's also --lint(t) that check the configuration file for errors, but I suspect this isn't your issue if direvent is running.
Source: https://www.gnu.org.ua/software/direvent/manual/direvent.html

heroku error Error R10 (Boot timeout) -> Web process failed to bind to $PORT within 60 seconds of launch

I made a scraper with puppeteer and I didn't specified any port for serving it. it just runs and scrape data and exits with process.exit() command.
I deployed it to heroku with cli but after running it throw error:
Error R10 (Boot timeout) -> Web process failed to bind to $PORT within 60 seconds of launch.
Stopping process with SIGKILL
Process exited with status 137
whats wrong?
Looks like you have a Web Dyno so the app must bind to $PORT.
You can instead define a worker (in the Procfile) if you do not need incoming HTTP requests.

Azure-IoT - Raspberry pi3 Forever script exited with code: 7

I'm running a forever script sending data from raspberry pi 3 to azure-iot-hub, using the following,
root#raspberrypi3:~# forever start /home/pi/azure/iam/ble_azure.js
After working for about 1.5 days, I stopped getting messages at auzre-iot-hub, when I checked forever list I got the following:
root#raspberrypi3:~# forever list
info: Forever processes running
data: uid command script forever pid id logfile uptime
data: [0] NWgI /usr/bin/nodejs /home/pi/azure/iam/ble_azure.js 8990 3784 /root/.forever/NWgI.log 0:21:17:38.742
When I checked the log file I get this error message:
/home/pi/azure/iam/node_modules/applicationinsights/AutoCollection/Exceptions.js:27
throw error;
^
NotConnectedError: mqtt.js returned client disconnecting error
at translateError (/home/pi/azure/iam/node_modules/azure-iot-device-mqtt/lib/mqtt-translate-error.js:25:11)
at MqttTwinReceiver._handleError (/home/pi/azure/iam/node_modules/azure-iot-device-mqtt/lib/mqtt-twin-receiver.js:201:42)
at /home/pi/azure/iam/node_modules/azure-iot-device-mqtt/lib/mqtt-twin-receiver.js:64:18
at MqttClient._checkDisconnecting (/home/pi/azure/iam/node_modules/mqtt/lib/client.js:314:7)
at MqttClient.subscribe (/home/pi/azure/iam/node_modules/mqtt/lib/client.js:423:12)
at /home/pi/azure/iam/node_modules/azure-iot-device-mqtt/lib/mqtt-twin-receiver.js:62:22
at _combinedTickCallback (internal/process/next_tick.js:73:7)
at process._tickCallback (internal/process/next_tick.js:104:9)
error: Forever detected script exited with code: 7
error: Script restart attempt #34
state has changed poweredOn
started scanning
[IoT hub Client] Connect error: mqtt.js returned premature close error
Through the log file, mqtt error keeps happening multiple times and forever handled it successfully, what I can't understand why after 1.5 days, I get this error:
**error: Forever detected script exited with code: 7
error: Script restart attempt #34**
Also why I keep getting such mqtt error, why it keeps disconnecting?
**NotConnectedError: mqtt.js returned client disconnecting error**
Forever --version
v0.15.3
root#raspberrypi3:~# uname -a
Linux raspberrypi3 4.9.35-v7+ #1014 SMP Fri Jun 30 14:47:43 BST 2017 armv7l GNU/Linux
Thanks
If you're using Client.fromConnectionString to instantiate the client object the SDK disconnects and reconnects every 45 minutes to renew the shared access signature token. (it doesn't happen with AMQP that uses a different authentication mechanism). It might be that when re-establishing the connection the client hits this "premature close" error that we've been tracking in this issue.
There are 2 things that could help limit potential errors linked to disconnecting/reconnecting:
Use X509 certificates instead of connection strings to authenticate.
Create a client object using Client.fromSharedAccessSignature and build a long-lived signature that does not require disconnecting and reconnecting as often.
Last but not least, the next release of the SDK (1.2.0) will include a retry/reconnect logic that is way more robust than what was there before. I'll update the issue to point to it when it is released.

Error after (seemingly) following the Heroku instructions for Node.js

ANSWER: Don't put a Gemfile into the root of your Node.js project. Heroku get's confused and treats it like a Ruby app.
I am trying to follow the instructions from the Heroku documentation but am receiving an error: "No such file or directory - node web.js".
My Procfile is...
web: node web.js
Foreman runs locally as expected.
Here's a logging snapshot...
2011-07-21T23:28:49+00:00 heroku[web.1]: State changed from starting to crashed
2011-07-21T23:37:50+00:00 heroku[web.1]: State changed from crashed to created
2011-07-21T23:37:50+00:00 heroku[web.1]: State changed from created to starting
2011-07-21T23:37:51+00:00 heroku[web.1]: Starting process with command: `node web.js`
2011-07-21T23:37:51+00:00 app[web.1]: Error: No such file or directory - node web.js
2011-07-21T23:37:52+00:00 heroku[web.1]: Process exited
And my heroku ps output...
Process State Command
------------ ------------------ ------------------------------
web.1 crashed for 8m node web.js
Source is https://github.com/just3ws/hellode
If it didn't run locally I'd move forward and just assume it was only me.
Thanks in advance.
My guess is it's the Gemfile or .rvmrc ;)
http://twitter.com/ryanbriones/status/94212379654631424

Resources