Bonjour,
je viens de réinstaller une machine debian 10 sur mon Nas QNAP.
J’ai relancé les dépendances en choisissant la première solution d’installation.
J’ai transféré ma DB + fichier de configuration.yaml dans mon dossier.
Malheureusement le service zigbee2mqtt se relance à chaque fois.
Je suis passé en mode debug et voici les log que j’ai du mal à interpréter :
Auriez vous une solution svp ?
> zigbee2mqtt@1.21.0 start /opt/zigbee2mqtt
> node index.js
Building Zigbee2MQTT... (initial build), failed
(node:7596) UnhandledPromiseRejectionWarning: Error: Command failed: npm run build
sh: 1: tsc: not found
npm ERR! code ELIFECYCLE
npm ERR! syscall spawn
npm ERR! file sh
npm ERR! errno ENOENT
npm ERR! zigbee2mqtt@1.21.0 build: `tsc && node index.js writehash`
npm ERR! spawn ENOENT
npm ERR!
npm ERR! Failed at the zigbee2mqtt@1.21.0 build script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.
npm ERR! A complete log of this run can be found in:
npm ERR! /root/.npm/_logs/2021-08-04T13_11_05_806Z-debug.log
at ChildProcess.exithandler (child_process.js:390:12)
at ChildProcess.emit (events.js:400:28)
at maybeClose (internal/child_process.js:1055:16)
at Process.ChildProcess._handle.onexit (internal/child_process.js:288:5)
(Use `node --trace-warnings ...` to show where the warning was created)
(node:7596) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). To terminate the node process on unhandled promise rejection, use the CLI flag `--unhandled-rejections=strict` (see https://nodejs.org/api/cli.html#cli_unhandled_rejections_mode). (rejection id: 1)
(node:7596) [DEP0018] DeprecationWarning: Unhandled promise rejections are deprecated. In the future, promise rejections that are not handled will terminate the Node.js process with a non-zero exit code.
#######################################################
# INSTALL : Zigbee2mqtt #
#######################################################
#######################################################
##### apt-get update in progress
Hit:1 http://security.debian.org/debian-security buster/updates InRelease
Hit:2 http://deb.debian.org/debian buster InRelease
Get:3 http://deb.debian.org/debian buster-updates InRelease [51.9 kB]
Hit:4 https://deb.nodesource.com/node_14.x buster InRelease
Fetched 51.9 kB in 2s (31.2 kB/s)
Reading package lists...
#######################################################
##### Install or update Git
Reading package lists...
Building dependency tree...
Reading state information...
g++ is already the newest version (4:8.3.0-1).
gcc is already the newest version (4:8.3.0-1).
git is already the newest version (1:2.20.1-2+deb10u3).
make is already the newest version (4.2.1-1.2).
0 upgraded, 0 newly installed, 0 to remove and 0 not upgraded.
#######################################################
##### Install or update NodeJs
NodeJs 14 already installed : Nothing to do !
#######################################################
# INSTALLING : Mosquitto (server) #
#######################################################
Reading package lists...
Building dependency tree...
Reading state information...
mosquitto is already the newest version (1.5.7-1+deb10u1).
0 upgraded, 0 newly installed, 0 to remove and 0 not upgraded.
#######################################################
# INSTALLING : Mosquitto for Php #
#######################################################
Mosquitto for Php is already installed, nothing to do
#######################################################
##### Install Socat
Socat is already installed, nothing to do
#######################################################
##### Install yaml php and restart apache
Yaml is already installed, nothing to do
#######################################################
##### Stopping Zigbee2mqtt deamon #
#######################################################
##### Update : Download update from Zigbee2mqtt git
##### up to date
#######################################################
##### Configure deamon and start it
Created symlink /etc/systemd/system/multi-user.target.wants/zigbee2mqtt.service -> /etc/systemd/system/zigbee2mqtt.service.
#######################################################
# END #
#######################################################
[2021-08-04 19:17:08][INFO] : ############ Arrêt des services ############
[2021-08-04 19:17:08][INFO] : ##### Arrêt du service ZigbeeLinker #####
[2021-08-04 19:17:08][INFO] : ##### Service ZigbeeLinker Arrêté #####
[2021-08-04 19:17:08][INFO] : ##### Arrêt du service Client MQTT (Mqtt distant)#####
[2021-08-04 19:17:09][INFO] : ##### Le service Client MQTT (Mqtt distant) s'est arrêté correctement #####
[2021-08-04 19:17:09][INFO] : ##### Arrêt du service Zigbee2MQTT #####
[2021-08-04 19:17:09][INFO] : ##### Le service Zigbee2MQTT s'est arrêté correctement. #####
[2021-08-04 19:17:09][INFO] : ##### Arrêt du service MQTT #####
[2021-08-04 19:17:09][INFO] : ##### Tentative d'arrêt du service MQTT (méthode 1)
[2021-08-04 19:17:10][INFO] : ##### Service MQTT arrêté.
[2021-08-04 19:17:10][INFO] : ##### Le service MQTT s'est arrêté correctement. #####
[2021-08-04 19:18:56][INFO] : ############ Démarrage des service ############
[2021-08-04 19:18:56][INFO] : Démon Version V2
[2021-08-04 19:18:56][INFO] : ##### Démarrage du service ZigbeeLinker #####
[2021-08-04 19:18:57][INFO] : ##### Service ZigbeeLinker démarré #####
[2021-08-04 19:18:58][INFO] : ##### Démarrage du service MQTT #####
[2021-08-04 19:18:59][INFO] : ##### Démarrage du service MQTT terminé avec succès #####
[2021-08-04 19:18:59][INFO] : ##### Démarrage du service Client MQTT (Mqtt distant) #####
[2021-08-04 19:19:00][INFO] : ##### Le service Client MQTT a démarré (Mqtt distant) #####
[2021-08-04 19:19:00][INFO] : ##### Le service Client MQTT ([Local Technique][Mqtt distant]) s'est connecté. #####
[2021-08-04 19:19:00][INFO] : [Local Technique][Mqtt distant] : Client MQTT subscribe : 1
[2021-08-04 19:19:00][INFO] : ##### Le client MQTT Mqtt distant a reçu un premier message de Zigbee2MQTT #####
[2021-08-04 19:19:01][INFO] : ##### Démarrage du service Client MQTT (Mqtt distant) terminé avec succès #####
[2021-08-04 19:19:01][INFO] : ##### Démarrage du service Zigbee2MQTT #####
[2021-08-04 19:19:02][INFO] : ##### Le service Zigbee2MQTT démarre... #####
[2021-08-04 19:19:03][INFO] : ##### Le service zigbee2mqtt a démarré #####
[2021-08-04 19:19:24][ERROR] : ##### Le service zigbee2mqtt s'est arrêté #####
Ce problème vient suite aux dernières mises à jour de Zigbee2MQTT.
Le seul moyen que je vois pour le moment est de revenir à une ancienne version (par exemple celle du 15 Juillet).
Pour le faire, allez dans Jeedom, allez dans réglages > système > Configuration > onglet OS/DB et cliquez sur le bouton Ouvrir en face de " Administration Système" et exécutez : cd /opt/zigbee2mqtt && sudo git fetch origin && sudo git checkout 07ff52a56f112c8808c11f3b6f55cc50560f5fd1
(Pour revenir en dernière version il faudra faire cd /opt/zigbee2mqtt && sudo git fetch origin && sudo git checkout master)
Puis dans la configuration du plugin, cliquez en bas sur le bouton vert « Réparer Zigbee2MQTT », puis relancez les dépendances.
hum pas mieux, par contre dans les installations des dépendances, pas sûr que ça passe correctement ( Update : Download update from Zigbee2mqtt git
fatal: HEAD does not point to a branch
From https://github.com/Koenkk/zigbee2mqtt.git
./install_z2m.sh: line 74: [: too many arguments
./install_z2m.sh: line 80: [: -en: binary operator expected )
#######################################################
# INSTALL : Zigbee2mqtt #
#######################################################
#######################################################
##### apt-get update in progress
Hit:1 http://security.debian.org/debian-security buster/updates InRelease
Hit:2 http://deb.debian.org/debian buster InRelease
Hit:3 http://deb.debian.org/debian buster-updates InRelease
Hit:4 https://deb.nodesource.com/node_14.x buster InRelease
Reading package lists...
#######################################################
##### Install or update Git
Reading package lists...
Building dependency tree...
Reading state information...
g++ is already the newest version (4:8.3.0-1).
gcc is already the newest version (4:8.3.0-1).
git is already the newest version (1:2.20.1-2+deb10u3).
make is already the newest version (4.2.1-1.2).
0 upgraded, 0 newly installed, 0 to remove and 0 not upgraded.
#######################################################
##### Install or update NodeJs
NodeJs 14 already installed : Nothing to do !
#######################################################
# INSTALLING : Mosquitto (server) #
#######################################################
Reading package lists...
Building dependency tree...
Reading state information...
mosquitto is already the newest version (1.5.7-1+deb10u1).
0 upgraded, 0 newly installed, 0 to remove and 0 not upgraded.
#######################################################
# INSTALLING : Mosquitto for Php #
#######################################################
Mosquitto for Php is already installed, nothing to do
#######################################################
##### Install Socat
Socat is already installed, nothing to do
#######################################################
##### Install yaml php and restart apache
Yaml is already installed, nothing to do
#######################################################
##### Stopping Zigbee2mqtt deamon #
#######################################################
##### Update : Download update from Zigbee2mqtt git
fatal: HEAD does not point to a branch
From https://github.com/Koenkk/zigbee2mqtt.git
./install_z2m.sh: line 74: [: too many arguments
./install_z2m.sh: line 80: [: -en: binary operator expected
##### Compiling for NodeJS version 14
##### Updating...
You are not currently on a branch.
Please specify which branch you want to merge with.
See git-pull(1) for details.
git pull <remote> <branch>
##### Installing dependencies...
npm WARN prepare removing existing node_modules/ before installation
> @serialport/bindings@9.2.0 install /opt/zigbee2mqtt/node_modules/zigbee-herdsman-converters/node_modules/zigbee-herdsman/node_modules/@serialport/bindings
> prebuild-install --tag-prefix @serialport/bindings@ || node-gyp rebuild
> @serialport/bindings@9.2.0 install /opt/zigbee2mqtt/node_modules/zigbee-herdsman/node_modules/@serialport/bindings
> prebuild-install --tag-prefix @serialport/bindings@ || node-gyp rebuild
> unix-dgram@2.0.3 install /opt/zigbee2mqtt/node_modules/unix-dgram
> node-gyp rebuild
make: Entering directory '/opt/zigbee2mqtt/node_modules/unix-dgram/build'
CXX(target) Release/obj.target/unix_dgram/src/unix_dgram.o
In file included from ../../nan/nan.h:56,
from ../src/unix_dgram.cc:5:
/root/.cache/node-gyp/14.17.4/include/node/node.h:758:43: warning: cast between incompatible function types from 'void (*)(v8::Local<v8::Object>)' to 'node::addon_register_func' {aka 'void (*)(v8::Local<v8::Object>, v8::Local<v8::Value>, void*)'} [-Wcast-function-type]
(node::addon_register_func) (regfunc), \
^
/root/.cache/node-gyp/14.17.4/include/node/node.h:792:3: note: in expansion of macro 'NODE_MODULE_X'
NODE_MODULE_X(modname, regfunc, NULL, 0) // NOLINT (readability/null_usage)
^~~~~~~~~~~~~
../src/unix_dgram.cc:404:1: note: in expansion of macro 'NODE_MODULE'
NODE_MODULE(unix_dgram, Initialize)
^~~~~~~~~~~
SOLINK_MODULE(target) Release/obj.target/unix_dgram.node
COPY Release/unix_dgram.node
make: Leaving directory '/opt/zigbee2mqtt/node_modules/unix-dgram/build'
added 307 packages in 19.406s
#######################################################
##### Configure deamon and start it
Created symlink /etc/systemd/system/multi-user.target.wants/zigbee2mqtt.service -> /etc/systemd/system/zigbee2mqtt.service.
#######################################################
# END #
#######################################################
Il faut être en ssh ou c’est depuis l’ « Administration système » qu’il faut rentrer les commande ?
Car l’astuce de revenir à une ancienne version ne change rien chez moi.
Plus simple en ssh pour switch en branche dev. A la fin de l’installation, tu auras un peu plus de 1000 packages si mes souvenirs sont bons. Contre plus de 300 quand on est en stable.
Merci pour ton retour.
Donc en ssh, dès la 2eme commande ça bloque. Je ne fait p-e pas comme il faut :
jeedom@jeedom:~ $ sudo systemctl stop zigbee2mqtt
jeedom@jeedom:~ $ cp -R data data-backup
cp: impossible d'évaluer 'data': Aucun fichier ou dossier de ce type
Je n’ai pas encore eu le temps de tester, mais ce que je ne comprends pas, c’est que au départ, j’ai eu ce problème juste après une inclusion d’appareil.
J’ai ensuite testé avec toutes les procédures, relancé les dépendances, etc sans résultat.
Je n’ai lancé les mises à jour disponibles qu’après.
J’ai testé les différentes manipulations mais c’est toujours le même problème
Voila le retour :
jeedom@jeedom:/opt/zigbee2mqtt $ sudo git checkout HEAD -- npm-shrinkwrap.json
jeedom@jeedom:/opt/zigbee2mqtt $ sudo git fetch
jeedom@jeedom:/opt/zigbee2mqtt $ sudo git checkout dev
Déjà sur 'dev'
Votre branche est à jour avec 'origin/dev'.
jeedom@jeedom:/opt/zigbee2mqtt $ sudo git pull
Déjà à jour.
jeedom@jeedom:/opt/zigbee2mqtt $ sudo npm ci
npm WARN prepare removing existing node_modules/ before installation
> @serialport/bindings@9.2.0 install /opt/zigbee2mqtt/node_modules/zigbee-herdsman-converters/node_modules/zigbee-herdsman/node_modules/@serialport/bindings
> prebuild-install --tag-prefix @serialport/bindings@ || node-gyp rebuild
prebuild-install WARN install EACCES: permission denied, access '/root/.npm/_cacache'
gyp WARN EACCES current user ("jeedom") does not have permission to access the dev dir "/root/.cache/node-gyp/14.16.1"
gyp WARN EACCES attempting to reinstall using temporary dev dir "/opt/zigbee2mqtt/node_modules/zigbee-herdsman-converters/node_modules/zigbee-herdsman/node_modules/@serialport/bindings/.node-gyp"
gyp WARN install got an error, rolling back install
gyp WARN install got an error, rolling back install
gyp ERR! configure error
gyp ERR! stack Error: EACCES: permission denied, mkdir '/opt/zigbee2mqtt/node_modules/zigbee-herdsman-converters/node_modules/zigbee-herdsman/node_modules/@serialport/bindings/.node-gyp'
gyp ERR! System Linux 5.10.17-v7+
gyp ERR! command "/usr/bin/node" "/usr/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js" "rebuild"
gyp ERR! cwd /opt/zigbee2mqtt/node_modules/zigbee-herdsman-converters/node_modules/zigbee-herdsman/node_modules/@serialport/bindings
gyp ERR! node -v v14.16.1
gyp ERR! node-gyp -v v5.1.0
gyp ERR! not ok
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! @serialport/bindings@9.2.0 install: `prebuild-install --tag-prefix @serialport/bindings@ || node-gyp rebuild`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the @serialport/bindings@9.2.0 install script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.
npm ERR! A complete log of this run can be found in:
npm ERR! /root/.npm/_logs/2021-08-05T06_48_23_219Z-debug.log
jeedom@jeedom:/opt/zigbee2mqtt $
Faut se logguer avec le profil Jeedom ou un autre ?