nodered on Raspberry PI is not starting any longer - raspberry-pi

I am not quite sure what node is causing this behaviour and there are tooo many flows so I can not install from scratch and yes I do not have a backup of them.
I realized today in the morning that I can not access the http gui of my nodered instance any longer on my raspberrypi zero. Just edited some flows but nothing real serious.
I am trying to start my node red on my Rapsberry PI zere and no GUI and UI is starting up to access the node red instance. I don't know how to solve and troubleshoot this. What I am doing or trying to do is:
pi#nodered-pi:~/.node-red $ node-red-start
Start Node-RED
Once Node-RED has started, point a browser at http://192.168.1.42:1880
On Pi Node-RED works better with the Firefox or Chrome browser
Use node-red-stop to stop Node-RED
Use node-red-start to start Node-RED again
Use node-red-log to view the recent log output
Use sudo systemctl enable nodered.service to autostart Node-RED at every boot
Use sudo systemctl disable nodered.service to disable autostart on boot
To find more nodes and example flows - go to http://flows.nodered.org
Starting as a systemd service.
Started Node-RED graphical event wiring tool.
19 Aug 15:13:55 - [info]
Welcome to Node-RED
===================
19 Aug 15:13:55 - [info] Node-RED version: v0.18.7
19 Aug 15:13:55 - [info] Node.js version: v8.11.1
19 Aug 15:13:55 - [info] Linux 4.14.52+ arm LE
19 Aug 15:14:06 - [info] Loading palette nodes
19 Aug 15:14:37 - [info] Dashboard version 2.9.6 started at /ui
19 Aug 15:14:49 - [warn] ------------------------------------------------------
19 Aug 15:14:49 - [warn] [node-red-contrib-delta-timed/delta-time] 'delta' already registered by module node-red-contrib-change-detect
19 Aug 15:14:49 - [warn] ------------------------------------------------------
19 Aug 15:14:49 - [info] Settings file : /home/pi/.node-red/settings.js
19 Aug 15:14:49 - [info] User directory : /home/pi/.node-red
19 Aug 15:14:49 - [warn] Projects disabled : set editorTheme.projects.enabled=true to enable
19 Aug 15:14:49 - [info] Flows file : /home/pi/.node-red/flows_nodered-pi.json
19 Aug 15:14:50 - [info] Server now running at http://127.0.0.1:1880/
19 Aug 15:14:50 - [warn]
---------------------------------------------------------------------
Your flow credentials file is encrypted using a system-generated key.
If the system-generated key is lost for any reason, your credentials
file will not be recoverable, you will have to delete it and re-enter
your credentials.
You should set your own key using the 'credentialSecret' option in
your settings file. Node-RED will then re-encrypt your credentials
file using your chosen key the next time you deploy a change.
---------------------------------------------------------------------
19 Aug 15:14:50 - [warn] Error loading credentials: SyntaxError: Unexpected token T in JSON at position 0
19 Aug 15:14:50 - [warn] Error loading flows: Error: Failed to decrypt credentials
19 Aug 15:14:51 - [info] Starting flows
19 Aug 15:15:01 - [warn] [telegram receiver:Telegram Receiver] bot not initialized
19 Aug 15:15:01 - [warn] [telegram sender:Temperatur Wetterstation] bot not initialized.
19 Aug 15:15:01 - [error] [function:Versorge mit Information] SyntaxError: Invalid or unexpected token
19 Aug 15:15:01 - [info] Started flows
19 Aug 15:15:02 - [info] [sonoff-server:166ef3ba.0029bc] SONOFF Server Started On Port 1080
19 Aug 15:15:02 - [red] Uncaught Exception:
19 Aug 15:15:02 - Error: listen EACCES 0.0.0.0:443
at Object._errnoException (util.js:1022:11)
at _exceptionWithHostPort (util.js:1044:20)
nodered.service: Main process exited, code=exited, status=1/FAILURE
nodered.service: Unit entered failed state.
nodered.service: Failed with result 'exit-code'.
nodered.service: Service hold-off time over, scheduling restart.
Stopped Node-RED graphical event wiring tool.
Started Node-RED graphical event wiring tool.
19 Aug 15:15:20 - [info]
Welcome to Node-RED
===================
19 Aug 15:15:20 - [info] Node-RED version: v0.18.7

19 Aug 15:15:02 - Error: listen EACCES 0.0.0.0:443
at Object._errnoException (util.js:1022:11)
at _exceptionWithHostPort (util.js:1044:20)
This error implies that something else is already running on port 443. This could be an existing copy of Node-RED or something else. You can search what applications are listening on what ports with the following command
lsof -i :443
This will list what is listening on port 443

Related

Node-red email node keeps crashing

I have a simple email node and debug-node set-up within a web application using node red.
The email node has refresh time set to 5 seconds. and protocol IMAP.
I have a gmail account logged in.
Node-red crashes with the following error:
(Happens rather quickly when I receive an email with an attachment of > 10mb).
The TypeError is on different properties like 'name', 'type' '11456' etc...
10 Jul 17:00:28 - [info] Starting flows
10 Jul 17:00:28 - [info] Started flows
10 Jul 17:00:37 - [red] Uncaught Exception:
10 Jul 17:00:37 - TypeError: Cannot set property 'name' of undefined
at Connection.<anonymous> (/usr/lib/node_modules/node-red/node_modules/imap/lib/Connection.js:431:22)
at Connection._resTagged (/usr/lib/node_modules/node-red/node_modules/imap/lib/Connection.js:1535:22)
at Parser.<anonymous> (/usr/lib/node_modules/node-red/node_modules/imap/lib/Connection.js:194:10)
at emitOne (events.js:116:13)
at Parser.emit (events.js:211:7)
at Parser._resTagged (/usr/lib/node_modules/node-red/node_modules/imap/lib/Parser.js:175:10)
at Parser._parse (/usr/lib/node_modules/node-red/node_modules/imap/lib/Parser.js:139:16)
at Parser._tryread (/usr/lib/node_modules/node-red/node_modules/imap/lib/Parser.js:82:15)
at TLSSocket.Parser._cbReadable (/usr/lib/node_modules/node-red/node_modules/imap/lib/Parser.js:53:12)
at emitNone (events.js:106:13)
Versions:
10 Jul 17:00:27 - [info] Node-RED version: v0.18.7
10 Jul 17:00:27 - [info] Node.js version: v8.11.3
10 Jul 17:00:27 - [info] Linux 4.15.0-24-generic x64 LE
Package.json :
"dependencies": {
"imap": "^0.8.19",
"mailparser": "^0.6.2",
"nodemailer": "^1.11.0",

Node-red looping on start raspberry pi

I was using node-red in my raspberry pi normally until get the brillant idea to install new nodes.
Now, I am unable to start it. The node-red is in loop when starting.
> Start Node-RED Once Node-RED has started, point a browser at
> http://192.168.0.113:1880 On Pi Node-RED works better with the Firefox
> or Chrome browser Use node-red-stop to
> stop Node-RED Use node-red-start to start
> Node-RED again Use node-red-log to view
> the recent log output Use sudo systemctl enable nodered.service to
> autostart Node-RED at every boot Use sudo systemctl disable
> nodered.service to disable autostart on boot To find more nodes and
> example flows - go to http://flows.nodered.org Starting as a systemd
> service. Started Node-RED graphical event wiring tool.. 10 Jan
> 00:29:50 - [info] Welcome to Node-RED
> =================== 10 Jan 00:29:50 - [info] Node-RED version: v0.17.5 10 Jan 00:29:50 - [info] Node.js version: v6.12.3 10 Jan 00:29:50 -
> [info] Linux 4.9.35-v7+ arm LE 10 Jan 00:29:51 - [info] Loading
> palette nodes [../deps/mpg123/src/output/alsa.c:165] error: cannot
> open device default node: pcm_params.c:2286: snd_pcm_hw_refine:
> Assertion `pcm && params' failed. nodered.service: main process
> exited, code=killed, status=6/ABRT Unit nodered.service entered failed
> state. nodered.service holdoff time over, scheduling restart. Stopping
> Node-RED graphical event wiring tool.... Starting Node-RED graphical
> event wiring tool.... Started Node-RED graphical event wiring tool..
> 10 Jan 00:29:57 - [info] Welcome to Node-RED
> =================== 10 Jan 00:29:57 - [info] Node-RED version: v0.17.5 10 Jan 00:29:57 - [info] Node.js version: v6.12.3 10 Jan 00:29:57 -
> [info] Linux 4.9.35-v7+ arm LE 10 Jan 00:29:58 - [info] Loading
> palette nodes [../deps/mpg123/src/output/alsa.c:165] error: cannot
> open device default node: pcm_params.c:2286: snd_pcm_hw_refine:
> Assertion `pcm && params' failed. nodered.service: main process
> exited, code=killed, status=6/ABRT Unit nodered.service entered failed
> state. nodered.service holdoff time over, scheduling restart. Stopping
> Node-RED graphical event wiring tool.... Starting Node-RED graphical
> event wiring tool.... Started Node-RED graphical event wiring tool..
> 10 Jan 00:30:04 - [info] Welcome to Node-RED
> =================== 10 Jan 00:30:04 - [info] Node-RED version: v0.17.5 10 Jan 00:30:04 - [info] Node.js version: v6.12.3 10 Jan 00:30:04 -
> [info] Linux 4.9.35-v7+ arm LE 10 Jan 00:30:05 - [info] Loading
> palette nodes
Go to the directory /home/pi/.node-red and open the package.json file.
It should contain a dependencies section that lists the extra nodes you installed (assuming you did so via the Palette Manager in the editor). Identify any nodes related to playing audio - the crashing error is related to trying to use the mpg123 command line tool for playing audio files.
Then on the command line, run npm remove NAME-OF-MODULE --save.
Node-RED should then restart cleanly.

IoTP boilerplate application not working after Diego migration

After migrating my Watson IoTP boilerplate application to Diego, it not longer starts. I see this in the log:
[APP/0] OUT Welcome to Node-RED
[APP/0] OUT ===================
[APP/0] OUT 18 Jan 15:43:16 - [info] Node-RED version: v0.15.3
[APP/0] OUT 18 Jan 15:43:16 - [info] Node.js version: v4.6.2
[APP/0] OUT 18 Jan 15:43:16 - [info] Linux 4.4.0-45-generic x64 LE
[APP/0] OUT 18 Jan 15:43:16 - [info] Loading palette nodes
[APP/0] OUT 18 Jan 15:43:18 - [warn] [ibm hdfs in] Deprecated call to RED.runtime.nodes.registerType - node-set name must be provided as first argument
[APP/0] OUT 18 Jan 15:43:18 - [warn] [ibm hdfs] Deprecated call to RED.runtime.nodes.registerType - node-set name must be provided as first argument
[APP/0] OUT 18 Jan 15:43:18 - [warn] [ibmpush] Deprecated call to RED.runtime.nodes.registerType - node-set name must be provided as first argument
[APP/0] OUT 18 Jan 15:43:20 - [info] Settings file : /home/vcap/app/bluemix-settings.js
[APP/0] OUT 18 Jan 15:43:20 - [info] Server now running at http://127.0.0.1:`**1880**`/red/
[APP/0] OUT 18 Jan 15:43:20 - [info] Starting flows
[APP/0] OUT 18 Jan 15:43:20 - [info] Started flows
[CELL/0] ERR Timed out after 1m0s: health check never passed.
[CELL/0] OUT Exit status 0
[CELL/0] OUT Destroying container
[API/8] OUT App instance exited with guid ca3f2bbd-ac6e-42ec-8a61-1ff704274c3e payload: {"instance"=>"", "index"=>0, "reason"=>"CRASHED", "exit_description"=>"2 error(s) occurred:\n\n* 1 error(s) occurred:\n\n* Exited with status 4\n* 2 error(s) occurred:\n\n* cancelled\n* process did not exit", "crash_count"=>2, "crash_timestamp"=>1484754267594231230, "version"=>"0361fa77-694c-4e8f-991e-0c52dd0c4c87"}
How can I fix this ?
The problem is that the way apps find the port to bind to has changed with Diego. The VCAP_APP_PORT environment variable is no longer populated by default. To fix it, you need to create a git repo for your app (Overview tab -> Continuous Delivery -> Add GIT). Use jazzhub to edit the bluemix-settings.js file to change
uiPort: process.env.VCAP_APP_PORT
to
uiPort: process.env.PORT
Deploy those changes and the app should start.
I had a similar issue with a npm express app and fixed it without having to edit the bluemix-settings.js file.
Simple remove all references to process.env.VCAP_APP_HOST (no longer a reference in Diego) and change process.env.VCAP_APP_PORT to process.env.PORT.
for example,
var host = 'localhost';
var port = (process.env.PORT || 1337);
app.listen(port, host);
console.log('App started on port ' + port);
You can check to see if your app is running Diego by typing:
cf has-diego-enabled APPNAME
after installing the diego cli tool
cf install-plugin Diego-Enabler -r CF-Community
I also disabled health checks:
cf set-health-check APPNAME none

How to run puppetmaster using Apache/Passenger

Running Puppet v2.7.14 on CEntOs 6 and also using Apache/Passenger instead of WEBrick. I was told that puppetmaster service is not required to be running (hence: chkconfig off puppetmaster) running when using httpd and passenger but in my case, if I don't start puppetmasterd manually, none of the agents can connect to the master. I can start httpd just fine and 'passenger' seems to start okay as well. This is my apache configuration file:
# /etc/httpd/conf.d/passenger.conf
LoadModule passenger_module modules/mod_passenger.so
<IfModule mod_passenger.c>
PassengerRoot /usr/lib/ruby/gems/1.8/gems/passenger-3.0.12
PassengerRuby /usr/bin/ruby
#PassengerTempDir /var/run/rubygem-passenger
PassengerHighPerformance on
PassengerUseGlobalQueue on
PassengerMaxPoolSize 15
PassengerPoolIdleTime 150
PassengerMaxRequests 10000
PassengerStatThrottleRate 120
RackAutoDetect Off
RailsAutoDetect Off
</IfModule>
Upon restart, I see these in the httpd_error log:
[Sat Jun 09 04:06:47 2012] [notice] caught SIGTERM, shutting down
[Sat Jun 09 09:06:51 2012] [notice] suEXEC mechanism enabled (wrapper: /usr/sbin/suexec)
[Sat Jun 09 09:06:51 2012] [notice] Digest: generating secret for digest authentication ...
[Sat Jun 09 09:06:51 2012] [notice] Digest: done
[Sat Jun 09 09:06:51 2012] [notice] Apache/2.2.15 (Unix) DAV/2 Phusion_Passenger/3.0.12 mod_ssl/2.2.15 OpenSSL/1.0.0-fips configured -- resuming normal operations
And passenger-status prints these info on the screen:
----------- General information -----------
max = 15
count = 0
active = 0
inactive = 0
Waiting on global queue: 0
----------- Application groups -----------
But still, as I said, none of my agents can actually talk to the master until I start puppetmasterd manually. Does anyone know what am I still missing? Or, is this the way it supposed too be? Cheers!!
It sounds like you may be missing an /etc/httpd/conf.d/puppetmaster.conf file that's based on https://github.com/puppetlabs/puppet/blob/master/ext/rack/files/apache2.conf
Without something like this, you're missing the glue that'll map port 8140 to rack-based pupeptmastd.
See http://docs.puppetlabs.com/guides/passenger.html
https://github.com/puppetlabs/puppet/tree/master/ext/rack
http://www.modrails.com/documentation/Users%20guide%20Apache.html#_deploying_a_rack_based_ruby_application_including_rails_gt_3
After a few days of banging head, now it's running. The main problem was with port number - the puppetmaster was running on different port than puppet agent trying to communicate on.
Another thing is: RackAutoDetect On must be executed before the dashboard vhost file. My So, I renamed passenger vhost file as: 00_passenger.conf to make sure it runs first. After that I get puppetmaster running using Apache/Passenger. Cheers!!

Default Index Controller Not Being Called With New Zend Studio Project

I have just purchased a license for Zend Studio 9. I have only a minimal amount of experience with the Zend framework, and no previous experience with Zend Studio. I am using http://framework.zend.com/manual/en/ as a tutorial on the framework and have browsed through the resources located at http://www.zend.com/en/products/studio/resources for help with the studio software.
My main problem is that after creating a new Zend project with zstudio, I'm not seeing the initial welcome message. Here are the steps I am using:
I've already installed the Zend Server and confirmed that web apps are working (made some test files, they all parsed correctly).
Create a new project with Zend Studio.
a. File->New->Local PHP Project
b. For location, I am using C:\Program Files\Zend\Apache2\htdocs.
c. For version I used the default "Zend Framework 1.11.11 (Built-in)"
I go to http://localhost:81/projectname. Instead of the default index controller being called, I just see my directory structure.
Addition info:
OS: Windows 7
PHP version: 5.3
ERROR LOGS:
>[Wed Nov 30 14:32:30 2011] [warn] Init: Session Cache is not configured [hint: SSLSessionCache]
>[Wed Nov 30 14:32:30 2011] [warn] pid file C:/Program Files (x86)/Zend/Apache2/logs/httpd.pid overwritten -- Unclean shutdown of previous Apache run?
>[Wed Nov 30 14:32:30 2011] [notice] Digest: generating secret for digest authentication ...
>[Wed Nov 30 14:32:30 2011] [notice] Digest: done
>[Wed Nov 30 14:32:31 2011] [notice] Apache/2.2.16 (Win32) mod_ssl/2.2.16 OpenSSL/0.9.8o configured -- resuming normal operations
>[Wed Nov 30 14:32:31 2011] [notice] Server built: Aug 8 2010 16:45:53
>[Wed Nov 30 14:32:31 2011] [notice] Parent: Created child process 13788
>[Wed Nov 30 14:32:32 2011] [warn] Init: Session Cache is not configured [hint: SSLSessionCache]
>[Wed Nov 30 14:32:32 2011] [notice] Digest: generating secret for digest authentication ...
>[Wed Nov 30 14:32:32 2011] [notice] Digest: done
>[Wed Nov 30 14:32:33 2011] [notice] Child 13788: Child process is running
>[Wed Nov 30 14:32:33 2011] [notice] Child 13788: Acquired the start mutex.
>[Wed Nov 30 14:32:33 2011] [notice] Child 13788: Starting 64 worker threads.
>[Wed Nov 30 14:32:33 2011] [notice] Child 13788: Starting thread to listen on port 10081.
>[Wed Nov 30 14:32:33 2011] [notice] Child 13788: Starting thread to listen on port 81.
If you navigate to http://localhost:81/projectname/index/index does the correct screen load?
If so:
Check that the .htaccess file in your public directory contains the correct rewrite rules for Zend Framework.
Check your httpd.conf file and make sure index.php is added to the DirectoryIndex directive.
I think the solution is going to be the second bullet, but let me know what you find and I can help further if that doesn't work. Make sure to restart apache after you make any changes to httpd.conf.
Otherwise, report any errors you see when you access the controller directly, and check Apache's error_log file to see if you get any errors.