Cannot read properties of undefined (reading 'modules')
Fredi009sg opened this issue · 13 comments
OS
Pi4 4GB
NodeJS Version
16.13.1
MagicMirror Version
2.16.0
Remote Control Version
2.3.6
Did you try using just Remote Control alone with MM?
- I have and the error still happening
Description
Can't restart over the Remote Control
Expected behavior
restart MagicMirror
Current behavior
nothing
Possible solution
No response
Steps to reproduce
Click restart nothing happend
Log
Wed, 19 Jan 2022 08:19:12 GMT express deprecated res.send(status): Use res.sendStatus(status) instead at modules/MMM-Remote-Control/node_helper.js:138:25
0|MagicMir | [19.01.2022 09:27.33.424] [ERROR] TypeError: Cannot read properties of undefined (reading 'modules')
0|MagicMir | at Class.answerConfigHelp (/home/pi/MagicMirror/modules/MMM-Remote-Control/node_helper.js:342:52)
0|MagicMir | at /home/pi/MagicMirror/modules/MMM-Remote-Control/node_helper.js:161:22
0|MagicMir | at Layer.handle [as handle_request] (/home/pi/MagicMirror/node_modules/express/lib/router/layer.js:95:5)
0|MagicMir | at next (/home/pi/MagicMirror/node_modules/express/lib/router/route.js:137:13)
0|MagicMir | at Route.dispatch (/home/pi/MagicMirror/node_modules/express/lib/router/route.js:112:3)
0|MagicMir | at Layer.handle [as handle_request] (/home/pi/MagicMirror/node_modules/express/lib/router/layer.js:95:5)
0|MagicMir | at /home/pi/MagicMirror/node_modules/express/lib/router/index.js:281:22
0|MagicMir | at Function.process_params (/home/pi/MagicMirror/node_modules/express/lib/router/index.js:341:12)
0|MagicMir | at next (/home/pi/MagicMirror/node_modules/express/lib/router/index.js:275:10)
0|MagicMir | at internalNext (/home/pi/MagicMirror/node_modules/helmet/dist/index.js:142:6)
0|MagicMir | [20.01.2022 09:19.12.869] [ERROR] Whoops! There was an uncaught exception...
0|MagicMir | [20.01.2022 09:19.12.884] [ERROR] TypeError: Cannot read properties of undefined (reading 'modules')
0|MagicMir | at /home/pi/MagicMirror/modules/MMM-Remote-Control/node_helper.js:223:60
0|MagicMir | at FSReqCallback.readFileAfterClose [as oncomplete] (node:internal/fs/read_file_context:68:3)
config.js
/*************** AUTO GENERATED BY REMOTE CONTROL MODULE ***************/
var config =
{
address: '0.0.0.0',
electronOptions: {
fullscreen: true,
width: 3840,
x: 1920
},
ipWhitelist: [],
language: 'de',
modules: [
{
module: 'alert',
config: {}
},
{
module: 'clock',
position: 'top_left',
config: {}
},
{
module: 'calendar',
position: 'top_left',
header: 'Termine',
config: {
calendars: [
{
symbol: 'calendar-check',
url: 'xxxx'
}
],
maximumEntries: 5
}
},
{
module: 'calendar',
header: 'Geburtstage',
position: 'top_left',
config: {
calendars: [
{
symbol: 'birthday-cake',
url: 'xxx',
maximumEntries: '2'
}
]
}
},
{
module: 'compliments',
position: 'top_center',
config: {
compliments: {
anytime: [
'Na du!'
],
morning: [
'Guten morgen',
'Genies deinen Tag!'
],
afternoon: [
'Du siehst gut aus!'
],
evening: [
'Bettzeit',
'Schlaf gut',
'Ab ins Bett'
],
'....-01-01': [
'Happy new year!'
]
}
},
header: ''
},
{
module: 'weather',
position: 'top_right',
config: {
location: 'xxx',
locationID: 'xx',
apiKey: 'xxx',
iconTable: {
'01d': 'wi-day-sunny',
'02d': 'wi-day-cloudy',
'03d': 'wi-cloudy',
'04d': 'wi-cloudy-windy',
'09d': 'wi-showers',
'10d': 'wi-rain',
'11d': 'wi-thunderstorm',
'13d': 'wi-snow',
'50d': 'wi-fog',
'01n': 'wi-night-clear',
'02n': 'wi-night-cloudy',
'03n': 'wi-night-cloudy',
'04n': 'wi-night-cloudy',
'09n': 'wi-night-showers',
'10n': 'wi-night-rain',
'11n': 'wi-night-thunderstorm',
'13n': 'wi-night-snow',
'50n': 'wi-night-alt-cloudy-windy'
}
}
},
{
module: 'weather',
position: 'top_right',
header: 'Wettervorhersage',
config: {
type: 'forecast',
location: 'xxx',
locationID: 'xxx',
apiKey: 'xxx'
}
},
{
module: 'newsfeed',
position: 'bottom_bar',
config: {
feeds: [
{
title: 'Tagesschau',
url: 'https://www.tagesschau.de/xml/rss2/'
}
]
}
},
{
module: 'MMM-Remote-Control',
header: '',
config: {
apiKey: 'xxx',
pm2ProcessName: 'MagicMirror'
}
},
{
module: 'MMM-iHaveBeenThere',
position: 'fullscreen_below',
header: '',
config: {
success: true,
query: {
data: 'defaultConfig',
module: 'MMM-iHaveBeenThere'
},
data: {
title: '',
AnimationEnabled: true,
pauseDuration: 3,
animationDuration: 10,
displayDesc: false,
zoomLevel: 1.5,
zoomLongitude: -20,
zoomLatitude: 60,
home_lat: 51.xxxx,
home_lon: 7.xxxx,
home_desc: 'xxx',
away_lat: [
25.xxx,
21.xx,
40.xx,
41.xx,
'52.xxx',
'48.xxx',
'-22.xxx'
],
away_lon: [
-80.xxx,
-86.xxx,
9.xx,
2.xx,
'13.xxx',
'11.xxx',
'17.xxx'
],
away_desc: [
'xxx',
'xxx',
'xxx',
'xxx',
'xxx',
'xxx',
'xxxx'
],
trip: [
false,
false,
false,
false
],
colorCountries: '#BDBDBD',
colorCountryBorders: '#000000',
colorTargetPoints: '#FFFFFF',
colorPlane: '#FF0000',
colorPlaneLine: '#FFFFFF',
colorLegendBorder: '#FFFFFF',
colorLegendFont: '#FFFFFF',
colorTitleFont: '#FFFFFF'
},
title: '',
home_lat: 51.xxx,
home_lon: 7.xxxx,
away_desc: [
'xxx',
'xxx',
'xxx',
'xxx',
'xxx',
'xxx',
'xxx'
],
displayDesc: false,
away_lat: [
25.xxx,
21.xx,
40.xx,
41.xx,
'52.xxx',
'48.xxx',
'-22.xxx'
],
away_lon: [
-80.xx,
-86.xx,
9.xx,
2.xx,
'13.xx',
'11.xx',
'17.xx'
],
home_desc: 'xxxxx',
trip: [
false,
false,
false,
false
],
zoomLevel: 1.5,
zoomLatitude: 30,
zoomLongitude: -50
}
},
{
module: 'MMM-MyGarbage',
position: 'top_left',
header: '',
config: {
success: true,
query: {
data: 'defaultConfig',
module: 'MMM-MyGarbage'
},
data: {
alert: false,
weeksToDisplay: 3,
limitTo: 99,
dateFormat: 'dddd D MMMM',
fade: true,
fadePoint: 0.25
}
}
}
],
useHttps: false,
httpsPrivateKey: '',
httpsCertificate: '',
locale: 'en-US'
}
/*************** DO NOT EDIT THE LINE BELOW ***************/
if (typeof module !== 'undefined') {module.exports = config;}
Additional info
No response
No log nor error? Are you using PM2?
No log nor error? Are you using PM2?
yes i'm using pm2
Please use pm2 logs
and let me know what you see.
@ezeholz i uploaded the log to the first request.
Please start pm2 logs
in a terminal, and when you're getting the output, restart the mirror. The logs you're sending seems completely normal to me.
i uploaded the error
This error doesn't seem to be the same as the one before. It's probably some compatibility with modules. Did you try to take everything of except from RC?
I don't see any config.js
either, so I can't replicate this error.
This error doesn't seem to be the same as the one before. It's probably some compatibility with modules. Did you try to take everything of except from RC? I don't see any
config.js
either, so I can't replicate this error.
I uploaded aswell the config.js.
Try setting remote control above every other module. Sometimes that could be the issue. I'll try it on my end too, to check if it's working properly
seems like it's worked. But have some additional questions..
102730091 ms: Mark-sweep 881.5 (983.0) -> 880.4 (983.3) MB, 6928.0 / 0.5 ms (average mu = 0.346, current mu = 0.311) allocation failure scavenge might not succeed
what does this means ?
Seems to be a problem with NodeJS not having enough memory to run everything. Try allocating more memory into it, or keep things you're using to a minimum.
You cannot put under pressure a RPi, it just isn't enough hardware.
Seems to be a problem with NodeJS not having enough memory to run everything. Try allocating more memory into it, or keep things you're using to a minimum. You cannot put under pressure a RPi, it just isn't enough hardware.
How i can adjust the memory for nodejs ?
This issue has been automatically marked as stale because it has not had
recent activity. It will be closed if no further activity occurs. Thank you
for your contributions.