thkl / Homematic-Virtual-Interface

Add your other HTTP Devices as Homematic Actors to your CCU
54 stars 23 forks source link

Probleme beim Installieren von Modulen im HVL Addon #138

Open To-Fu112 opened 3 years ago

To-Fu112 commented 3 years ago

HVL läuft bei mir direkt auf der Raspbarrymatic (ehemalige CCU3). Nach der Installation von HVL ließen sich Mudule installieren, aktivieren und einrichten. Dann hatte ich wie hier bei den Eintägen zu lesen, das Problem, dass HVL nach einem Firmwareupdate nicht richtig lief, da dort immer systeminterne Einträge verschunden sind. Dieses Problem wurde dank thkl gefixt und leuft seit dem auch super (Beim letzten Update keine Probleme). Allerdings lassen sich seit irgenwann mal, vermutlich aufgetreten mit dem gefixten Problem, keinerlei Module mehr installieren. Im Logfile erscheinen folgende Einträge (Reproduzierbar mit jedem Modul):

Wed Dec 30 2020 23:49:02 GMT+0100 (CET)[Homematic Virtual Interface.Server] [ERROR] - Error: Command failed: cd /usr/local/addons/hvl;npm install homematic-virtual-backupservice --production --prefix "/usr/local/addons/hvl" npm ERR! code EROFS npm ERR! syscall mkdir npm ERR! path /.npm npm ERR! errno -30 npm ERR! rofs EROFS: read-only file system, mkdir '/.npm' npm ERR! rofs Often virtualized file systems, or other file systems npm ERR! rofs that don't support symlinks, give this error.

at checkExecSyncError (child_process.js:630:11)
at Object.execSync (child_process.js:666:15)
at Server.installNPM (/usr/local/addons/hvl/node_modules/homematic-virtual-interface/lib/Server.js:1472:30)
at /usr/local/addons/hvl/node_modules/homematic-virtual-interface/lib/Server.js:1172:26
at Array.some (<anonymous>)
at /usr/local/addons/hvl/node_modules/homematic-virtual-interface/lib/Server.js:1167:18
at Server.buildPluginList (/usr/local/addons/hvl/node_modules/homematic-virtual-interface/lib/Server.js:1242:13)
at Server.fetchPluginList (/usr/local/addons/hvl/node_modules/homematic-virtual-interface/lib/Server.js:1220:14)
at Server.installPlugin (/usr/local/addons/hvl/node_modules/homematic-virtual-interface/lib/Server.js:1165:10)
at Server.handleConfigurationRequest (/usr/local/addons/hvl/node_modules/homematic-virtual-interface/lib/Server.js:653:26)

Wed Dec 30 2020 23:48:52 GMT+0100 (CET)[Homematic Virtual Interface.Server] [INFO] - Installing homematic-virtual-backupservice to /usr/local/addons/hvl Wed Dec 30 2020 23:48:26 GMT+0100 (CET)[Homematic Virtual Interface.Server] [INFO] - done Wed Dec 30 2020 23:48:26 GMT+0100 (CET)[Homematic Virtual Interface.Server] [INFO] - Restart (/etc/init.d/S51hvl restart) Wed Dec 30 2020 23:41:28 GMT+0100 (CET)[Homematic Virtual Interface.Server] [ERROR] - Error: Command failed: cd /usr/local/addons/hvl;npm install homematic-virtual-sonosdevice --production --prefix "/usr/local/addons/hvl" npm ERR! code EROFS npm ERR! syscall mkdir npm ERR! path /.npm npm ERR! errno -30 npm ERR! rofs EROFS: read-only file system, mkdir '/.npm' npm ERR! rofs Often virtualized file systems, or other file systems npm ERR! rofs that don't support symlinks, give this error.

Leider kann ich damit nichts anfangen. Vielleicht jemand eine Idee? Neuinstallation von HVL in allen möglichen Variationen bringen leider keinen Erfolg.

robster85 commented 3 years ago

Hallo, vielleicht schließe ich mich To-Fu112 mal an.... Habe das selbe Problem:

`Sun Jan 10 2021 16:37:44 GMT+0100 (CET)[Homematic Virtual Interface.Server] [ERROR] - Error: Command failed: cd /usr/local/addons/hvl;npm install homematic-virtual-weatherundergrounddevice --production --prefix "/usr/local/addons/hvl" npm ERR! code EROFS npm ERR! syscall mkdir npm ERR! path /.npm npm ERR! errno -30 npm ERR! rofs EROFS: read-only file system, mkdir '/.npm' npm ERR! rofs Often virtualized file systems, or other file systems npm ERR! rofs that don't support symlinks, give this error.

at checkExecSyncError (child_process.js:630:11)
at Object.execSync (child_process.js:666:15)
at Server.installNPM (/usr/local/addons/hvl/node_modules/homematic-virtual-interface/lib/Server.js:1472:30)
at /usr/local/addons/hvl/node_modules/homematic-virtual-interface/lib/Server.js:1172:26
at Array.some (<anonymous>)
at /usr/local/addons/hvl/node_modules/homematic-virtual-interface/lib/Server.js:1167:18
at Server.buildPluginList (/usr/local/addons/hvl/node_modules/homematic-virtual-interface/lib/Server.js:1242:13)
at Server.fetchPluginList (/usr/local/addons/hvl/node_modules/homematic-virtual-interface/lib/Server.js:1220:14)
at Server.installPlugin (/usr/local/addons/hvl/node_modules/homematic-virtual-interface/lib/Server.js:1165:10)
at Server.handleConfigurationRequest (/usr/local/addons/hvl/node_modules/homematic-virtual-interface/lib/Server.js:653:26)

Sun Jan 10 2021 16:37:33 GMT+0100 (CET)[Homematic Virtual Interface.Server] [INFO] - Installing homematic-virtual-weatherundergrounddevice to /usr/local/addons/hvl`

thkl commented 3 years ago

Das Problem liegt daran, das npm (das ist der Paketinstaller) einen temporären Pfad benutzt. Dieser liegt normalerweise im Home des Users unter .npm ... Dummerweise ist das Verzeichnis auf der CCu3 nicht beschreibbar.

Man kann dem npm aber eine Pfadangabe mitgeben. Dazu müsste ich was am Core ändern.

To-Fu112 commented 3 years ago

Arbeitest du da aktuell an einem Patch oder so? Besteht dann nicht auch die Möglichkeit das verzeichnis manuell vorübergehend Schreibrechte zu erteilen, oder lohnt sich das nicht (mehr)?

thkl commented 3 years ago

Ein Patch ist derzeit nicht in Sicht , das ich zumindest im Entwicklungssystem das ganze komplett auseinander gerissen habe, um es neu zu bauen. Was machbar wäre ist das Filesystem beschreibbar zu machen:

mount -o remount,rw /

und hinterher wieder auf RO

mount -o remount,ro /

oder diese Zeile zu ändern:

https://github.com/thkl/Homematic-Virtual-Interface/blob/53fc9bda2003bff4f9b3b46fdce4a99f77dd7567/lib/Server.js#L1471

in

var cmd = 'cd ' + destPath + ';' + this.npmCommand + ' install ' + npmName + ' --cache /tmp --production --prefix "' + destPath + '"' 

Damit wird das Cache Verzeichnis auf /tmp gesetzt und das ist beschreibbar

To-Fu112 commented 3 years ago

Welches Verzeichnis müsste dann Schreibrechte bekommen? Schöner ist natürlich die Variante das Verzeichnis auszutauschen. Wenn ich die Zeile austausche, wie bekomme ich den Quellcode in die CCU, bzw. wie (wo) tausche ich die Zeile aus?

thkl commented 3 years ago

Es ist so, das die ganze Root Partition immer nur lesend gemountet wird, daher das Remount Commando um die Partition beschreibbar zu machen. Einzig /usr/local ist normalerweise beschreibbar. /tmp und /var sind RAM Discs

thkl commented 3 years ago

Achso das File wo es die Zeile zu erweitern gilt liegt in /usr/local/addons/hvl/node_modules/homematic-virtual-interface/lib/ und heisst Server.js ..

To-Fu112 commented 3 years ago

Ich habe die Zeile ausgetauscht, gespeichert und HVL neu gestartet. Leider vergebens. Die Fehlermeldung siht meineserachtens identisch zu der vorherigen aus?

Tue Jan 12 2021 23:03:27 GMT+0100 (CET)[Homematic Virtual Interface.Server] [ERROR] - Error: Command failed: cd /usr/local/addons/hvl;npm install homematic-virtual-backupservice --production --prefix "/usr/local/addons/hvl" npm ERR! code EROFS npm ERR! syscall mkdir npm ERR! path /.npm npm ERR! errno -30 npm ERR! rofs EROFS: read-only file system, mkdir '/.npm' npm ERR! rofs Often virtualized file systems, or other file systems npm ERR! rofs that don't support symlinks, give this error.

at checkExecSyncError (child_process.js:630:11)
at Object.execSync (child_process.js:666:15)
at Server.installNPM (/usr/local/addons/hvl/node_modules/homematic-virtual-interface/lib/Server.js:1472:30)
at /usr/local/addons/hvl/node_modules/homematic-virtual-interface/lib/Server.js:1172:26
at Array.some (<anonymous>)
at /usr/local/addons/hvl/node_modules/homematic-virtual-interface/lib/Server.js:1167:18
at Server.buildPluginList (/usr/local/addons/hvl/node_modules/homematic-virtual-interface/lib/Server.js:1242:13)
at Server.fetchPluginList (/usr/local/addons/hvl/node_modules/homematic-virtual-interface/lib/Server.js:1220:14)
at Server.installPlugin (/usr/local/addons/hvl/node_modules/homematic-virtual-interface/lib/Server.js:1165:10)
at Server.handleConfigurationRequest (/usr/local/addons/hvl/node_modules/homematic-virtual-interface/lib/Server.js:653:26)

Tue Jan 12 2021 23:03:17 GMT+0100 (CET)[Homematic Virtual Interface.Server] [INFO] - Installing homematic-virtual-backupservice to /usr/local/addons/hvl Tue Jan 12 2021 23:02:56 GMT+0100 (CET)[Homematic Virtual Interface.Server] [INFO] - done Tue Jan 12 2021 23:02:56 GMT+0100 (CET)[Homematic Virtual Interface.Server] [INFO] - Restart (/etc/init.d/S51hvl restart) Tue Jan 12 2021 22:52:19 GMT+0100 (CET)[Homematic Virtual Interface.Server] [ERROR] - Error: Command failed: cd /usr/local/addons/hvl;npm install homematic-virtual-backupservice --production --prefix "/usr/local/addons/hvl" npm ERR! code EROFS npm ERR! syscall mkdir npm ERR! path /.npm npm ERR! errno -30 npm ERR! rofs EROFS: read-only file system, mkdir '/.npm' npm ERR! rofs Often virtualized file systems, or other file systems npm ERR! rofs that don't support symlinks, give this error.

at checkExecSyncError (child_process.js:630:11)
at Object.execSync (child_process.js:666:15)
at Server.installNPM (/usr/local/addons/hvl/node_modules/homematic-virtual-interface/lib/Server.js:1472:30)
at /usr/local/addons/hvl/node_modules/homematic-virtual-interface/lib/Server.js:1172:26
at Array.some (<anonymous>)
at /usr/local/addons/hvl/node_modules/homematic-virtual-interface/lib/Server.js:1167:18
at Server.buildPluginList (/usr/local/addons/hvl/node_modules/homematic-virtual-interface/lib/Server.js:1242:13)
at Server.fetchPluginList (/usr/local/addons/hvl/node_modules/homematic-virtual-interface/lib/Server.js:1220:14)
at Server.installPlugin (/usr/local/addons/hvl/node_modules/homematic-virtual-interface/lib/Server.js:1165:10)
at Server.handleConfigurationRequest (/usr/local/addons/hvl/node_modules/homematic-virtual-interface/lib/Server.js:653:26)
To-Fu112 commented 3 years ago

Kann es sein, das du dich geirrt hast? Du schreibst oben, dass das temp Verzeichnis schreibgeschützt ist. In der geändertten Komandozeile verweist du aber auf ein temp Verzeichnis, oder irre ich da?

robster85 commented 3 years ago

Ich habe die andere Option gewählt... was soll ich sagen, ich installiere soeben diverse Plugins im Plugin :-)

mount -o remount,rw / und hinterher wieder auf RO

mount -o remount,ro /

robster85 commented 3 years ago

das einzige, was ich nicht installieren kann, ist das tägliche Backup...

Tue Jan 12 2021 23:14:27 GMT+0100 (CET)[Homematic Virtual Interface.Server] [ERROR] - Cannot initialize Backup - TypeError: Cannot set property 'callback' of null at BackupPlatform.schedule (/usr/local/addons/hvl/node_modules/homematic-virtual-backupservice/BackupPlatform.js:63:22) at BackupPlatform.init (/usr/local/addons/hvl/node_modules/homematic-virtual-backupservice/BackupPlatform.js:45:10) at new module.exports (/usr/local/addons/hvl/node_modules/homematic-virtual-backupservice/index.js:10:19) at Server._loadPlugins (/usr/local/addons/hvl/node_modules/homematic-virtual-interface/lib/Server.js:1287:40) at Server.reloadPlugins (/usr/local/addons/hvl/node_modules/homematic-virtual-interface/lib/Server.js:248:25) at Server.activatePlugin (/usr/local/addons/hvl/node_modules/homematic-virtual-interface/lib/Server.js:1106:10) at Server.handleConfigurationRequest (/usr/local/addons/hvl/node_modules/homematic-virtual-interface/lib/Server.js:669:30) at ConfigurationServer.<anonymous> (/usr/local/addons/hvl/node_modules/homematic-virtual-interface/lib/Server.js:132:26) at ConfigurationServer.emit (events.js:315:20) at Server.handleRequest (/usr/local/addons/hvl/node_modules/homematic-virtual-interface/lib/ConfigurationServer.js:106:26)

To-Fu112 commented 3 years ago

Hast du dafür das gesamte root Verzeichnis beschreibbar gemacht?

Eleganter wäre natürlich die andere Variante.

To-Fu112 commented 3 years ago

oh. genau das versuche ich die ganze Zeit.

To-Fu112 commented 3 years ago

Das Backup Problem kann ich bestätigen. Selbes Problem. Add on wird als Installiert angezeigt, kann aber nicht aktiviert werden.

robster85 commented 3 years ago

die Ursache scheint was anderes zu sein...

thkl commented 3 years ago

Backup schau ich mir an ... ist ein anderes Problem ...