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

Hung on Loading #10

Open
elgeorgie opened this issue Nov 28, 2024 · 19 comments
Open

Hung on Loading #10

elgeorgie opened this issue Nov 28, 2024 · 19 comments

Comments

@elgeorgie
Copy link

elgeorgie commented Nov 28, 2024

My module hangs on Loading. The debug is showing the following error.

Screenshot 2024-11-28 at 12 33 50 PM

That's the config for the module.

  {
	    module: "MMM-OpenWeatherForecast",
	    position: "top_right",
	    header: "Weather",
	    config: {
	      // apiVersion: '2.5',
	      type: "current",
	      apikey: "KEY", //only string here
	      latitude: "2",            //number works here
	      longitude: "-9.",          //so does a string
	      units:"imperial",
	      iconset: "3c",
	      showHourlyForecast: false,
	      showDailyForecast: true,
	      // apiBaseURL: "https://api.openweathermap.org/data/3.0/onecall?",
	    }
	  },

I verified the API and when I paste the API Call URL it returns data, so I know my API key is working.

Screenshot 2024-11-28 at 12 36 30 PM

Any ideas? I also tried the default weather module, no luck.

@Tom-Hirschberger
Copy link
Owner

Hi,

sorry for the late reply...
Just tried your config and it worked out of the box with the current version of the module.

Are you sure you use this for of the module?

If you enter:

git remote get-url origin 

you should get this as answer:

git@github.com:Tom-Hirschberger/MMM-OpenWeatherForecast.git

@elgeorgie
Copy link
Author

Hi,

sorry for the late reply... Just tried your config and it worked out of the box with the current version of the module.

Are you sure you use this for of the module?

If you enter:

git remote get-url origin 

you should get this as answer:

git@github.com:Tom-Hirschberger/MMM-OpenWeatherForecast.git

That's the result I'm receiving.

image

Not sure what's going on then. Tried installing the module again, no luck. Still receiving the error in my original post, when I open the browser debug.

@elgeorgie
Copy link
Author

Hi,
sorry for the late reply... Just tried your config and it worked out of the box with the current version of the module.
Are you sure you use this for of the module?
If you enter:

git remote get-url origin 

you should get this as answer:

git@github.com:Tom-Hirschberger/MMM-OpenWeatherForecast.git

That's the result I'm receiving.
image

Not sure what's going on then. Tried installing the module again, no luck. Still receiving the error in my original post, when I open the browser debug.

Also, receiving this error, not sure if its got anything to do.

image

@Tom-Hirschberger
Copy link
Owner

There is definitely a problem with the MMPM module.

Maybe it is not installed correctly.

@Tom-Hirschberger
Copy link
Owner

Do you see any more errors in the server console output?

If you start MagicMirror with pm2 the log files are located in the directory /home/pi/.pm2/logs/

@elgeorgie
Copy link
Author

Do you see any more errors in the server console output?

If you start MagicMirror with pm2 the log files are located in the directory /home/pi/.pm2/logs/

I tried another instance of mm on a Rpi. My original has been running on Dockers for 1+ year. I ran it on rPI and having the same loading issue..

image image

Don't know what else to try...all other modules are loading without any issue.

@Tom-Hirschberger
Copy link
Owner

At least it is clear it is a problem during the fetch of the data in the node_helper.js.

I just pushed a new version which prints some more information in case a error occurs during fetch.

Can you please try the latest version for another check.

I use a docker instance of karsten13/magicmirror. So docker should be fine, too.

With this config it works very well in my case:

{
    module: "MMM-OpenWeatherForecast",
    position: "top_right",
    header: "Weather",
    config: {
      debug: true,
      apikey: "123456abcdef", //my api key
      latitude: "2",
      longitude: "-9.", 
      units:"imperial",
      iconset: "3c",
      showHourlyForecast: false,
      showDailyForecast: true,
    },
  },

@Tom-Hirschberger
Copy link
Owner

> magicmirror@2.29.0 server
> node ./serveronly

[2024-12-01 20:36:32.470] [LOG]   Starting MagicMirror: v2.29.0 
[2024-12-01 20:36:32.480] [LOG]   Loading config ... 
[2024-12-01 20:36:32.481] [LOG]   config template file not exists, no envsubst 
[2024-12-01 20:36:32.650] [INFO]  Checking config file /opt/magic_mirror/config/config.js ... 
[2024-12-01 20:36:32.675] [INFO]  Your configuration file doesn't contain syntax errors :) 
[2024-12-01 20:36:32.675] [INFO]  Checking modules structure configuration ... 
[2024-12-01 20:36:32.707] [INFO]  Your modules structure configuration doesn't contain errors :) 
[2024-12-01 20:36:32.781] [LOG]   Loading module helpers ... 
[2024-12-01 20:36:32.781] [LOG]   No helper found for module: clock. 
[2024-12-01 20:36:32.793] [LOG]   Initializing new module helper ... 
[2024-12-01 20:36:32.793] [LOG]   Module helper loaded: MMM-OpenWeatherForecast 
[2024-12-01 20:36:32.794] [LOG]   Initializing new module helper ... 
[2024-12-01 20:36:32.794] [LOG]   Module helper loaded: MMM-EmbedURL 
[2024-12-01 20:36:32.795] [LOG]   Initializing new module helper ... 
[2024-12-01 20:36:32.795] [LOG]   Module helper loaded: MMM-ProfileControl 
[2024-12-01 20:36:32.795] [LOG]   No helper found for module: MMM-ProfileSwitcher. 
[2024-12-01 20:36:32.795] [LOG]   All module helpers loaded. 
[2024-12-01 20:36:32.799] [LOG]   Starting server on port 8080 ...  
[2024-12-01 20:36:32.801] [WARN]  You're using a full whitelist configuration to allow for all IPs 
[2024-12-01 20:36:32.811] [LOG]   Server started ... 
[2024-12-01 20:36:32.812] [LOG]   Connecting socket for: MMM-OpenWeatherForecast 
[2024-12-01 20:36:32.812] [LOG]   Starting node_helper for: MMM-OpenWeatherForecast 
[2024-12-01 20:36:32.812] [LOG]   Connecting socket for: MMM-EmbedURL 
[2024-12-01 20:36:32.812] [LOG]   Connecting socket for: MMM-ProfileControl 
[2024-12-01 20:36:32.812] [LOG]   Sockets connected & modules started ... 
[2024-12-01 20:36:32.812] [INFO]  
>>>   Ready to go! Please point your browser to: http://0.0.0.0:8080   <<< 
[2024-12-01 20:36:32.933] [INFO]  System information:
### SYSTEM:   manufacturer: HP; model: Docker Container; virtual: false
### OS:       platform: linux; distro: Debian GNU/Linux; release: 12; arch: x64; kernel: 6.8.0-48-generic
### VERSIONS: electron: undefined; used node: 22.11.0; installed node: 22.11.0; npm: 10.9.0; pm2: 
### OTHER:    timeZone: Europe/Berlin; ELECTRON_ENABLE_GPU: undefined 
[2024-12-01 20:36:34.726] [LOG]   MMM-OpenWeatherForecastFetching url: https://api.openweathermap.org/data/3.0/onecall?lat=2&lon=-9.&exclude=minutely&appid=123456abcdef&units=imperial&lang=de 

@elgeorgie
Copy link
Author

elgeorgie commented Dec 1, 2024

> magicmirror@2.29.0 server
> node ./serveronly

[2024-12-01 20:36:32.470] [LOG]   Starting MagicMirror: v2.29.0 
[2024-12-01 20:36:32.480] [LOG]   Loading config ... 
[2024-12-01 20:36:32.481] [LOG]   config template file not exists, no envsubst 
[2024-12-01 20:36:32.650] [INFO]  Checking config file /opt/magic_mirror/config/config.js ... 
[2024-12-01 20:36:32.675] [INFO]  Your configuration file doesn't contain syntax errors :) 
[2024-12-01 20:36:32.675] [INFO]  Checking modules structure configuration ... 
[2024-12-01 20:36:32.707] [INFO]  Your modules structure configuration doesn't contain errors :) 
[2024-12-01 20:36:32.781] [LOG]   Loading module helpers ... 
[2024-12-01 20:36:32.781] [LOG]   No helper found for module: clock. 
[2024-12-01 20:36:32.793] [LOG]   Initializing new module helper ... 
[2024-12-01 20:36:32.793] [LOG]   Module helper loaded: MMM-OpenWeatherForecast 
[2024-12-01 20:36:32.794] [LOG]   Initializing new module helper ... 
[2024-12-01 20:36:32.794] [LOG]   Module helper loaded: MMM-EmbedURL 
[2024-12-01 20:36:32.795] [LOG]   Initializing new module helper ... 
[2024-12-01 20:36:32.795] [LOG]   Module helper loaded: MMM-ProfileControl 
[2024-12-01 20:36:32.795] [LOG]   No helper found for module: MMM-ProfileSwitcher. 
[2024-12-01 20:36:32.795] [LOG]   All module helpers loaded. 
[2024-12-01 20:36:32.799] [LOG]   Starting server on port 8080 ...  
[2024-12-01 20:36:32.801] [WARN]  You're using a full whitelist configuration to allow for all IPs 
[2024-12-01 20:36:32.811] [LOG]   Server started ... 
[2024-12-01 20:36:32.812] [LOG]   Connecting socket for: MMM-OpenWeatherForecast 
[2024-12-01 20:36:32.812] [LOG]   Starting node_helper for: MMM-OpenWeatherForecast 
[2024-12-01 20:36:32.812] [LOG]   Connecting socket for: MMM-EmbedURL 
[2024-12-01 20:36:32.812] [LOG]   Connecting socket for: MMM-ProfileControl 
[2024-12-01 20:36:32.812] [LOG]   Sockets connected & modules started ... 
[2024-12-01 20:36:32.812] [INFO]  
>>>   Ready to go! Please point your browser to: http://0.0.0.0:8080   <<< 
[2024-12-01 20:36:32.933] [INFO]  System information:
### SYSTEM:   manufacturer: HP; model: Docker Container; virtual: false
### OS:       platform: linux; distro: Debian GNU/Linux; release: 12; arch: x64; kernel: 6.8.0-48-generic
### VERSIONS: electron: undefined; used node: 22.11.0; installed node: 22.11.0; npm: 10.9.0; pm2: 
### OTHER:    timeZone: Europe/Berlin; ELECTRON_ENABLE_GPU: undefined 
[2024-12-01 20:36:34.726] [LOG]   MMM-OpenWeatherForecastFetching url: https://api.openweathermap.org/data/3.0/onecall?lat=2&lon=-9.&exclude=minutely&appid=123456abcdef&units=imperial&lang=de 
0|mm  | [2024-12-01 13:54:10.988] [ERROR] [MMM-OpenWeatherForecast] 1-Dec-24 13:54 ** ERROR ** TypeError: fetch failed
0|mm  | TypeError: fetch failed
0|mm  |     at node:internal/deps/undici/undici:13178:13
0|mm  |     at processTicksAndRejections (node:internal/process/task_queues:95:5)
0|mm  |     at runNextTicks (node:internal/process/task_queues:64:3)
0|mm  |     at listOnTimeout (node:internal/timers:545:9)
0|mm  |     at process.processTimers (node:internal/timers:519:7)
0|mm  | [2024-12-01 13:54:11.604] [INFO]  Checking git for module: MMM-GooglePhotos

The above error shows with the update.

However, the weirdest thing is happening now. When I run MM on the rPi at first it hangs on Loading...however, when I connect to it from another terminal and refresh, everything then loads.

@Tom-Hirschberger
Copy link
Owner

Are the both logs are of the same run?

There is a time gap of a couple of hours between the start and fetch errors.

@elgeorgie
Copy link
Author

Are the both logs are of the same run?

There is a time gap of a couple of hours between the start and fetch errors.

the first half is from your post, I was replying to your post..

0|mm | [2024-12-01 13:54:10.988] [ERROR] [MMM-OpenWeatherForecast] 1-Dec-24 13:54 ** ERROR ** TypeError: fetch failed
0|mm | TypeError: fetch failed
0|mm | at node:internal/deps/undici/undici:13178:13
0|mm | at processTicksAndRejections (node:internal/process/task_queues:95:5)
0|mm | at runNextTicks (node:internal/process/task_queues:64:3)
0|mm | at listOnTimeout (node:internal/timers:545:9)
0|mm | at process.processTimers (node:internal/timers:519:7)
0|mm | [2024-12-01 13:54:11.604] [INFO] Checking git for module: MMM-GooglePhotos

this is the error from my run

@Tom-Hirschberger
Copy link
Owner

Sorry. Was answering with my mobile phone and got confused cause of the small screen.

Which node version do you use?

@elgeorgie
Copy link
Author

Sorry. Was answering with my mobile phone and got confused cause of the small screen.

Which node version do you use?

pi@raspberrypi:~/MagicMirror/modules/MMM-OpenWeatherForecast $ node -v
v22.11.0

@elgeorgie
Copy link
Author

Sorry. Was answering with my mobile phone and got confused cause of the small screen.
Which node version do you use?

pi@raspberrypi:~/MagicMirror/modules/MMM-OpenWeatherForecast $ node -v v22.11.0

No more issues on the rPI. however, the instance running on docker has the same issue.

@Tom-Hirschberger
Copy link
Owner

Tom-Hirschberger commented Dec 2, 2024

Can you please check the node version of the Docker instance.

As the module uses a build in node function to fetch the data it is the only thing remaining I can imagine.

@elgeorgie
Copy link
Author

Can you please check the node version of the Docker instance.

As the module uses a build in node function to fetch the data it is the only thing remaining I can imagine.

image

@Tom-Hirschberger
Copy link
Owner

OK. That's strange.

Did you run the npm install in the Docker instance in the module folder?

Did you use the same user id the mirror runs in the container?

@Tom-Hirschberger
Copy link
Owner

Did you make any progress with this problem?

@elgeorgie
Copy link
Author

Did you make any progress with this problem?

Not really. I ran the container again yesterday and issue remains. I reverted to running mm directly on the pi.

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

2 participants