Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

New update Black Screen #1243

Closed
NicoMontanaro opened this issue Apr 1, 2018 · 121 comments
Closed

New update Black Screen #1243

NicoMontanaro opened this issue Apr 1, 2018 · 121 comments

Comments

@NicoMontanaro
Copy link

Just updated to the last version of MM, but when i run the script i get just a black blank screen.

@desq42
Copy link

desq42 commented Apr 1, 2018

…same here.

@kikokazuma
Copy link

Same problem here after updating this morning, even after a clean install. I was prepping this as a science fair project for my daughter due tomorrow so the timing is absolutely horrible, lol. Is there a way for me to install the previous version?

NPM log shows the following:

Starting MagicMirror: v2.3.0
Loading config ...
Loading module helpers ...
No helper found for module: alert.
Initializing new module helper ...
Module helper loaded: updatenotification
No helper found for module: clock.
Initializing new module helper ...
Module helper loaded: calendar
No helper found for module: compliments.
No helper found for module: currentweather.
No helper found for module: weatherforecast.
Initializing new module helper ...
Module helper loaded: newsfeed
All module helpers loaded.
Starting server on port 8080 ...
Server started ...
Connecting socket for: updatenotification
Connecting socket for: calendar
Starting node helper for: calendar
Connecting socket for: newsfeed
Starting module: newsfeed
Sockets connected & modules started ...
Whoops! There was an uncaught exception...
{ Error: listen EADDRINUSE 127.0.0.1:8080
at Object.exports._errnoException (util.js:1050:11)
at exports._exceptionWithHostPort (util.js:1073:20)
at Server.setupListenHandle [as _listen2] (net.js:1263:14)
at listenInCluster (net.js:1304:12)
at doListen (net.js:1428:7)
at GetAddrInfoReqWrap.asyncCallback [as callback] (dns.js:62:16)
at GetAddrInfoReqWrap.onlookup [as oncomplete] (dns.js:78:10)
code: 'EADDRINUSE',
errno: 'EADDRINUSE',
syscall: 'listen',
address: '127.0.0.1',
port: 8080 }
MagicMirror will not quit, but it might be a good idea to check why this happene d. Maybe no internet connection?
If you think this really is an issue, please open an issue on GitHub: https://gi thub.com/MichMich/MagicMirror/issues
Launching application.

@kikokazuma
Copy link

Dear 8 pound, 6 oz baby Jesus, save me.

@MichMich
Copy link
Collaborator

MichMich commented Apr 1, 2018

It seems the port is in use: EADDRINUSE 127.0.0.1:8080 Did you try rebooting you Pi?

@kikokazuma
Copy link

Yes, I've rebooted several times and even tried a fresh install of Raspbian + MagicMirror.

@kikokazuma
Copy link

Was working fine last night and broke after this morning's update, much like the OP.

@NicoMontanaro
Copy link
Author

I did, but still no answer. Thanks!

@MichMich
Copy link
Collaborator

MichMich commented Apr 1, 2018

What commands did you guys use to update?

@hermannw
Copy link

hermannw commented Apr 1, 2018

Same problem here.
mm-error-0.log contains these lines several hundred times:

TypeError: Cannot read property 'hash' of null
at /home/pi/MagicMirror/modules/default/updatenotification/node_helper.js:68:31
at Git. (/home/pi/MagicMirror/node_modules/simple-git/src/git.js:1482:10)
at done (/home/pi/MagicMirror/node_modules/simple-git/src/git.js:1354:21)
at ChildProcess. (/home/pi/MagicMirror/node_modules/simple-git/src/git.js:1379:16)
at emitTwo (events.js:106:13)
at ChildProcess.emit (events.js:191:7)
at Process.ChildProcess._handle.onexit (internal/child_process.js:215:12)

and then at the end:

npm ERR! Linux 4.4.43-v7+
npm ERR! argv "/usr/bin/node" "/usr/bin/npm" "start"
npm ERR! node v6.12.3
npm ERR! npm v3.10.10
npm ERR! code ELIFECYCLE
npm ERR! magicmirror@2.3.0 start: sh run-start.sh
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the magicmirror@2.3.0 start script 'sh run-start.sh'.
npm ERR! Make sure you have the latest version of node.js and npm installed.

mm-out-0.log on the other hand says everything is running ok...

/home/pi/.pm2/logs/mm-out-0.log 166857/163K 100%

sh run-start.sh

Starting MagicMirror: v2.3.0
Loading config ...
Loading module helpers ...
No helper found for module: alert.
Initializing new module helper ...
Module helper loaded: updatenotification
No helper found for module: clock.
Initializing new module helper ...
Module helper loaded: calendar
Initializing new module helper ...
Module helper loaded: newsfeed
No helper found for module: MM-Remote-Control.
Initializing new module helper ...
Module helper loaded: mmm-weatherchart
Initializing new module helper ...
Module helper loaded: MMM-Tools
No helper found for module: worldclock.
No helper found for module: MMM-CurrencyExchange.
Initializing new module helper ...
Module helper loaded: MMM-NOAA
Initializing new module helper ...
Module helper loaded: MMM-ImagesPhotos
All module helpers loaded.
Starting server on port 8080 ...
Server started ...
Connecting socket for: updatenotification
Connecting socket for: calendar
Starting node helper for: calendar
Connecting socket for: newsfeed
Starting module: newsfeed
Connecting socket for: mmm-weatherchart
Starting node helper: mmm-weatherchart
Connecting socket for: MMM-Tools
Connecting socket for: MMM-NOAA
Starting module: MMM-NOAA
Connecting socket for: MMM-ImagesPhotos
Starting node helper for: MMM-ImagesPhotos
Sockets connected & modules started ...
Launching application.

Any help would be appreciated.

@kikokazuma
Copy link

As per instructions on https://github.com/MichMich/MagicMirror#updating

I ran this from the MagicMirror directory:

git pull && npm install

@hermannw
Copy link

hermannw commented Apr 1, 2018

Michael,

I used the recommended git pull && npm install.

@NicoMontanaro
Copy link
Author

git pull && npm install

@MichMich
Copy link
Collaborator

MichMich commented Apr 1, 2018

Try disabling all non-default modules.

@kikokazuma
Copy link

Hi MichMich

Given I am running a clean install, would there by any non-default modules?

@MichMich
Copy link
Collaborator

MichMich commented Apr 1, 2018

@kikokazuma Not by default. - Any messages in your logs?

@kikokazuma
Copy link

@MichMich pardon my noobishness, is there a log I can provide other than the NPM log I posted above? If so, what command can I run to help?

Thanks in advance!

@hermannw
Copy link

hermannw commented Apr 1, 2018

Nope. Disabling modules did not help.

@MichMich
Copy link
Collaborator

MichMich commented Apr 1, 2018

AH, sorry, no that was what I was looking for (only noticed @hermannw 's log).
@kikokazuma You log states you are already running something on port 8080. Are you sure you're not running two instances at the same time?

@MichMich
Copy link
Collaborator

MichMich commented Apr 1, 2018

@hermannw Try disabling the updatenotification module.

@hermannw
Copy link

hermannw commented Apr 1, 2018

Nope. No change. I disabled everything except the clock.

@kikokazuma
Copy link

kikokazuma commented Apr 1, 2018

@MichMich Previously, if I ran sudo netstat -lnptu it would tell me electron was already running on that port.

Strangely, just one minute ago, I rebooted again and it seems to be working again.
Others reported similar issues: https://forum.magicmirror.builders/topic/6874/so-to-update-magicmirror-i-would

Something is/was going on.

@MichMich
Copy link
Collaborator

MichMich commented Apr 1, 2018

So, just to be clear @kikokazuma, it is working for you now? If so, what version of Node are you running?

@Hurg84
Copy link

Hurg84 commented Apr 1, 2018

Hi MichMich, hi other Magicmirror Users,

I can confirm that after the upgrade the physical display stays black,
reinstalling electron doesnt fix the problem.

On the other hand ip:8080 in a Browser works, so it's just the mirror's browser.

Regards

Hurg

@desq42
Copy link

desq42 commented Apr 1, 2018

Hi,

same symptoms here as Hurg84. Applications works remotely, but die Screen stays black.
Node -v -> v6.14.1

Regards

desq

@kikokazuma
Copy link

@MichMich correct. I rebooted again and it is still working for me.

If I run node -v, I get:
v9.10.1

@Hurg84
Copy link

Hurg84 commented Apr 1, 2018

I got node v6.14.1 like desq42

@hermannw
Copy link

hermannw commented Apr 1, 2018

Opening from a browser doesn't work for me either.
I white-listed all IP's and the log says server is running but when I try to connect it says "Can't establish connection..."

@MichMich
Copy link
Collaborator

MichMich commented Apr 1, 2018

Could someone try the following in the MagicMirror folder:

npm install electron@1.4.15

If this works, please state your Node version as well. (node -v)

@Hurg84
Copy link

Hurg84 commented Apr 1, 2018

@MichMich It works with node v6.14.1

Thanks :-)

@MichMich
Copy link
Collaborator

MichMich commented Apr 1, 2018

So an electron downgrade solved it for you?

@bachoo786
Copy link

I dont use mmm pir sensor

@sdetweil
Copy link
Collaborator

sdetweil commented Apr 4, 2019

Ok, two debug things to do

  1. start mirror like this, from a terminal window
npm start dev &

watch for error messages in the terminal window
2. in the developers window (on screen)
select the console tab,
scroll up to see if there are any messages, errors in red text

@bachoo786
Copy link

so this is the only error in red:

see image below:

mm

@bachoo786
Copy link

i just checked the api in openweather and it hasnt changed what else could it be?

@sdetweil
Copy link
Collaborator

sdetweil commented Apr 4, 2019

401 sounds like the api-key for openweather wasn't specified correctly,

@bachoo786
Copy link

so I removed the weather module all together and the error has gone however I now get this error:
mm

and on my terminal I get this :

........
..........
  errno: 'EADDRINUSE',
  code: 'EADDRINUSE',
  syscall: 'listen',
  address: '::',
  port: 8080 }
MagicMirror will not quit, but it might be a good idea to check why this happened. Maybe no internet connection    ?
If you think this really is an issue, please open an issue on GitHub: https://github.com/MichMich/MagicMirror/i    ssues
Launching application.
Whoops! There was an uncaught exception...
SyntaxError: Unexpected end of JSON input
    at JSON.parse (<anonymous>)
    at fs.readFile (/home/pi/MagicMirror/modules/MMM-Remote-Control/node_helper.js:188:46)
    at FSReqWrap.readFileAfterClose [as oncomplete] (fs.js:440:3)
MagicMirror will not quit, but it might be a good idea to check why this happened. Maybe no internet connection    ?
If you think this really is an issue, please open an issue on GitHub: https://github.com/MichMich/MagicMirror/issues

@sdetweil
Copy link
Collaborator

sdetweil commented Apr 4, 2019 via email

@bachoo786
Copy link

So rebooted everything was working fine for few hours and now back to black screen

@bachoo786
Copy link

bachoo786 commented Apr 4, 2019

Pm2 list doesn't show mm anymore it seems like its disappearing from pm2 until i reboot the rpi

@sdetweil
Copy link
Collaborator

sdetweil commented Apr 4, 2019

pm can't help with, never could get it to work for me..

black screen after a few hours.. comment out the updatenotification module in config.js.. this has caused problems for a while..

@a-wenzel
Copy link

a-wenzel commented Apr 5, 2019

@bachoo786
sudo nano /etc/systemd/system/pm2-pi.service

check the paths... by default there are wrong for pi-user.

Description=PM2 process manager
Documentation=https://pm2.keymetrics.io/
After=network.target

[Service]
Type=forking
User=pi
LimitNOFILE=infinity
LimitNPROC=infinity
LimitCORE=infinity
Environment=PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin
Environment=PM2_HOME=/home/pi/.pm2
PIDFile=/home/pi/.pm2/pm2.pid

ExecStart=/usr/lib/node_modules/pm2/bin/pm2 resurrect
ExecReload=/usr/lib/node_modules/pm2/bin/pm2 reload all
ExecStop=/usr/lib/node_modules/pm2/bin/pm2 kill

[Install]
WantedBy=multi-user.target

@bachoo786
Copy link

@a-wenzel sorry just saw this.

how shall I check the paths? and what are the correct paths?

@ukcdrf
Copy link

ukcdrf commented Apr 14, 2019

I notice the same behavior as reported by bachoo786 above.
When launching the mirror with start npm & the mirror boots up nicely, reports the correct weather and correct news, but fails with the calendar and MMM-RMV modules.
The console reports that several modules have stopped.:

Whoops! There was an uncaught exception...
{ Error: listen EADDRINUSE 127.0.0.1:8080
    at Server.setupListenHandle [as _listen2] (net.js:1330:14)
    at listenInCluster (net.js:1378:12)
    at GetAddrInfoReqWrap.doListen [as callback] (net.js:1492:7)
    at GetAddrInfoReqWrap.onlookup [as oncomplete] (dns.js:55:10)
  errno: 'EADDRINUSE',
  code: 'EADDRINUSE',
  syscall: 'listen',
  address: '127.0.0.1',
  port: 8080 }
MagicMirror will not quit, but it might be a good idea to check why this happened. Maybe no internet connection?
If you think this really is an issue, please open an issue on GitHub: https://github.com/MichMich/MagicMirror/issues
Launching application.
Shutting down server...
Stopping module helper: updatenotification
Stopping module helper: calendar
Stopping module helper: MMM-RMV
Stopping module helper: newsfeed

However, if I list all running processes while my mirror is running I see four instances of Electron.
Is this expected????

@sdetweil
Copy link
Collaborator

That means another copy if mm is running already

@ukcdrf
Copy link

ukcdrf commented Apr 14, 2019

Any idea how this could happen and how to stop this behaviour?
I just ran the "standard" setup on a fresh Raspi using this command:

bash -c "$(curl -sL https://raw.githubusercontent.com/MichMich/MagicMirror/master/installers/raspberry.sh)"

@sdetweil
Copy link
Collaborator

sdetweil commented Apr 14, 2019

The install script will register ANOTHER pm2 to start the mirror if one already exists

@a-wenzel
Copy link

@a-wenzel sorry just saw this.

how shall I check the paths? and what are the correct paths?

@bachoo786 My paste has the right paths.

@bachoo786
Copy link

@a-wenzel thanks.. so the path is the reason for the black screen issue then ?

@ukcdrf
Copy link

ukcdrf commented Apr 14, 2019

@sdetweil
I just ran the script once.
I already formated and started from scratch 3 times, always with the same result.

Do you know where the script registers and calls PM2?
I would like to delete the call of the second instance there.

@ukcdrf
Copy link

ukcdrf commented Apr 14, 2019

@bachoo786
I have the same path as reported by a-wenzel and run into a similar issue as you.
Please try the following commands in a terminal window:

npm start &

When you see your black screen open another terminal window.
In the terminal window run:

ps -a

How many instances of **Electron ** do you see?

@sdetweil
Copy link
Collaborator

Pm2 will start mm at boot time if u start another u will see this kind of problem.

I don't use pm2 for this very reason.

Do pm2 list to see what is registered. Pm2 stop to shutdown some instance by name

@bachoo786
Copy link

Guys magic mirror process has disappeared from my pm2 list.

What shall I do?

@sdetweil
Copy link
Collaborator

see the end of the mm/installers/raspberry.sh for the steps used to create a pm2 entry

@bachoo786
Copy link

Sorry which part is that?

@sdetweil
Copy link
Collaborator

you will have to read the code in the batch file

@bachoo786
Copy link

When I freshly installed mm pm2 was already installed with the mm process...why is that now it has disappeared?

@sdetweil
Copy link
Collaborator

i do not know.. i don't own this code, i am just advising what I know.

@bachoo786
Copy link

Thank you

@ukcdrf
Copy link

ukcdrf commented Apr 17, 2019

@sdetweil and @ALL
Thanks for your help :-), I identified the error now.
I was using the Windows Remote Desktop tool to connect to my Raspberry and installed the XRDP package on my Raspi for this purpose. This is working perfectly fine, but the trouble is, that a remote desktop connection does not mirror the Raspberry desktop, but created an additional one.
Since Magic Mirror was autostart enabled, I got duplicated Magic Mirror instances without seeing them.
Now XRDP is removed from my Pi and I am using the default VNC which mirrors the Raspi screen and I no longer suffer from EADDRINUSE errors that kill my modules.

@dstoianovici
Copy link

Hello all,
I had the EACCESS error running MM on windows as described here fixed it by changing the port number from 8080 in config.js

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests