Navigation

    Logo
    • Register
    • Login
    • Search
    • Recent
    • Tags
    • Unread
    • Categories
    • Unreplied
    • Popular
    • GitHub
    • Docu
    • Hilfe
    1. Home
    2. Deutsch
    3. ioBroker Allgemein
    4. Installing - and failing to install/upgrade adapters

    NEWS

    • Neuer Blog: Fotos und Eindrücke aus Solingen

    • ioBroker@Smart Living Forum Solingen, 14.06. - Agenda added

    • ioBroker goes Matter ... Matter Adapter in Stable

    Installing - and failing to install/upgrade adapters

    This topic has been deleted. Only users with topic management privileges can see it.
    • frankjoke
      frankjoke last edited by

      Dear all,

      Ups, das ist ein deutsches Forum… hab den ganzen Text schon in Englisch geschrieben gehabt 😞 und nochmal übersetzt...

      Ich hatte nach den letzten Updates von js-controller, admin und einigen anderen Adaptern vermehrt Probleme mit dem Installieren und upgraden von Adaptern.

      Ein Beispiel von heute: Ich hatte sayit erfolgreich auf meinem Testsystem installiert (which is node 6.9.2 and npm 4.0.5) und wollte es dan auch am Produktionssystem updaten.

      Im Admin blieb die Installation immer hängen, also auf in die kommandozeile

      Das hat node 4.7 uns npm 2.15.11.

      pi@jessi3:/opt/iobroker $ iobroker upgrade sayit
      host.jessi3 Adapter "system.adapter.sayit.0" is stopped.
      npm install iobroker.sayit --production --prefix "/opt/iobroker" (System call)
      host.jessi3 Adapter "system.adapter.sayit.0" is started
      npm install --production --prefix "/opt/iobroker/node_modules/iobroker.sayit" (System call)
      
      

      Die Installation blieb aber in der letzten Zeile hängen.

      Dann hab ich mal gecheckt woran es liegen kann und hab NPM mal mit mehr debug ausgabe gestartet und einmal ohne und einmal mit sudo:

      ! pi@jessi3:/opt/iobroker $ npm install --production --loglevel silly --dry-run --prefix "/opt/iobroker/node_modules/iobroker.sayinpm info it worked if it ends with ok npm verb cli [ '/usr/bin/nodejs', npm verb cli '/usr/bin/npm', npm verb cli 'install', npm verb cli '--production', npm verb cli '--loglevel', npm verb cli 'silly', npm verb cli '--dry-run', npm verb cli '--prefix', npm verb cli '/opt/iobroker/node_modules/iobroker.sayit' ] npm info using npm@2.15.11 npm info using node@v4.7.0 npm verb readDependencies loading dependencies from /opt/iobroker/node_modules/iobroker.sayit/package.json npm verb install where, deps [ '/opt/iobroker/node_modules/iobroker.sayit', npm verb install [ 'jsftp', 'ivona-node' ] ] npm verb install where, peers [ '/opt/iobroker/node_modules/iobroker.sayit', [] ] npm verb installManyTop reading for lifecycle /opt/iobroker/node_modules/iobroker.sayit/package.json npm info preinstall iobroker.sayit@1.3.0 npm verb installManyTop reading scoped package data from /opt/iobroker/node_modules/iobroker.sayit/node_modules/ivona-node/package.json npm verb installManyTop reading scoped package data from /opt/iobroker/node_modules/iobroker.sayit/node_modules/jsftp/package.json npm verb readDependencies loading dependencies from /opt/iobroker/node_modules/iobroker.sayit/package.json npm verb targetResolver reading package data from /opt/iobroker/node_modules/iobroker.sayit/node_modules/ivona-node/package.json npm verb targetResolver reading package data from /opt/iobroker/node_modules/iobroker.sayit/node_modules/jsftp/package.json npm verb already installed skipping jsftp@^1.5.3 /opt/iobroker/node_modules/iobroker.sayit npm verb already installed skipping ivona-node@~0.2.0 /opt/iobroker/node_modules/iobroker.sayit npm sill install resolved [] npm info build /opt/iobroker/node_modules/iobroker.sayit npm info linkStuff iobroker.sayit@1.3.0 npm sill linkStuff iobroker.sayit@1.3.0 has /opt/iobroker/node_modules as its parent node_modules npm verb linkBins iobroker.sayit@1.3.0 npm verb linkMans iobroker.sayit@1.3.0 npm verb rebuildBundles iobroker.sayit@1.3.0 npm verb rebuildBundles [ 'ivona-node', 'jsftp' ] npm info install iobroker.sayit@1.3.0 ! > iobroker.sayit@1.3.0 install /opt/iobroker/node_modules/iobroker.sayit node main.js --install ! ^C pi@jessi3:/opt/iobroker $ sudo npm install --production --loglevel silly --dry-run --prefix "/opt/iobroker/node_modules/iobroker.sayit" npm info it worked if it ends with ok npm verb cli [ '/usr/bin/nodejs', npm verb cli '/usr/bin/npm', npm verb cli 'install', npm verb cli '--production', npm verb cli '--loglevel', npm verb cli 'silly', npm verb cli '--dry-run', npm verb cli '--prefix', npm verb cli '/opt/iobroker/node_modules/iobroker.sayit' ] npm info using npm@2.15.11 npm info using node@v4.7.0 npm verb readDependencies loading dependencies from /opt/iobroker/node_modules/iobroker.sayit/package.json npm verb install where, deps [ '/opt/iobroker/node_modules/iobroker.sayit', npm verb install [ 'jsftp', 'ivona-node' ] ] npm verb install where, peers [ '/opt/iobroker/node_modules/iobroker.sayit', [] ] npm verb installManyTop reading for lifecycle /opt/iobroker/node_modules/iobroker.sayit/package.json npm info preinstall iobroker.sayit@1.3.0 npm verb installManyTop reading scoped package data from /opt/iobroker/node_modules/iobroker.sayit/node_modules/ivona-node/package.json npm verb installManyTop reading scoped package data from /opt/iobroker/node_modules/iobroker.sayit/node_modules/jsftp/package.json npm verb readDependencies loading dependencies from /opt/iobroker/node_modules/iobroker.sayit/package.json npm verb targetResolver reading package data from /opt/iobroker/node_modules/iobroker.sayit/node_modules/ivona-node/package.json npm verb targetResolver reading package data from /opt/iobroker/node_modules/iobroker.sayit/node_modules/jsftp/package.json npm verb already installed skipping jsftp@^1.5.3 /opt/iobroker/node_modules/iobroker.sayit npm verb already installed skipping ivona-node@~0.2.0 /opt/iobroker/node_modules/iobroker.sayit npm sill install resolved [] npm info build /opt/iobroker/node_modules/iobroker.sayit npm info linkStuff iobroker.sayit@1.3.0 npm sill linkStuff iobroker.sayit@1.3.0 has /opt/iobroker/node_modules as its parent node_modules npm verb linkBins iobroker.sayit@1.3.0 npm verb linkMans iobroker.sayit@1.3.0 npm verb rebuildBundles iobroker.sayit@1.3.0 npm verb rebuildBundles [ 'ivona-node', 'jsftp' ] npm info install iobroker.sayit@1.3.0 npm WARN cannot run in wd iobroker.sayit@1.3.0 node main.js --install (wd=/opt/iobroker/node_modules/iobroker.sayit) npm info postinstall iobroker.sayit@1.3.0 npm verb validateInstall loading /opt/iobroker/node_modules/iobroker.sayit/package.json for validation npm verb exit [ 0, true ] npm info ok !

      Wie ihr sehen könnt hat es mit sudo funktioniert. ohne sudo bleibt es bei node main.js –install

      hängen (bei dieser original-npm-Version).

      Was ich mich aber frage ist warum iobroker upgrade/install immer 2x installiert?

      einmal: (da werden die benötighten sub-module in /opt/iobroker/node_modules gespeichert)
      npm install iobroker.sayit --production --prefix "/opt/iobroker" (System call)
      Dann startet iobroker den Adapter:
      host.jessi3 Adapter "system.adapter.sayit.0" is started
      Un dann wird nochmal in ein anderes Verzeignis installiert: (da werden die benötighten sub-module in /opt/iobroker/node_modules/iobroker.sayit/node_modules gespeichert)
      npm install --production --prefix "/opt/iobroker/node_modules/iobroker.sayit" (System call)
      
      

      Ich verstehe das nicht und glaube das war auch früher nicht so. fast alle der Installationsfehler treten bei der 2. Installation auf.

      Außerdem werden sub-module die der Adapter braucht eventuell doppelt geladen.

      Ach ja, übrigens wird der Adapter ja nach dem ersten install schon gestartet und er läuft auch! Das mag auch der Grund sein warum die 2. Installation dann nicht funktioniert da eine Datei oder ein Verzeichnis benutzt wird.

      Das neue npm scheint intelligenter zu sein da es die bestehenden und neuen Bäume überprüft und beim 2. Lauf nichts mehr installiert.

      ! pi@jessi1:/opt/iobroker $ sudo npm install --production --loglevel silly --dry-run --prefix "/opt/iobroker/node_modules/iobroker.sayit" npm info it worked if it ends with ok npm verb cli [ '/usr/bin/nodejs', npm verb cli '/usr/bin/npm', npm verb cli 'install', npm verb cli '--production', npm verb cli '--loglevel', npm verb cli 'silly', npm verb cli '--dry-run', npm verb cli '--prefix', npm verb cli '/opt/iobroker/node_modules/iobroker.sayit' ] npm info using npm@4.0.5 npm info using node@v6.9.2 npm sill loadCurrentTree Starting npm sill install loadCurrentTree npm sill install readLocalPackageData npm sill install normalizeTree npm sill loadCurrentTree Finishing npm sill loadIdealTree Starting npm sill install loadIdealTree npm sill cloneCurrentTree Starting npm sill install cloneCurrentTreeToIdealTree npm sill cloneCurrentTree Finishing npm sill loadShrinkwrap Starting npm sill install loadShrinkwrap npm sill loadShrinkwrap Finishing npm sill loadAllDepsIntoIdealTree Starting npm sill install loadAllDepsIntoIdealTree npm sill loadAllDepsIntoIdealTree Finishing npm sill loadIdealTree Finishing npm sill currentTree iobroker.sayit@1.3.0 npm sill currentTree ├── aws4@0.4.2 npm sill currentTree ├── core-util-is@1.0.2 npm sill currentTree ├── debug@2.5.1 npm sill currentTree ├── duplexer@0.1.1 npm sill currentTree ├── ftp-response-parser@1.0.1 npm sill currentTree ├── inherits@2.0.3 npm sill currentTree ├── isarray@0.0.1 npm sill currentTree ├── ivona-node@0.2.0 npm sill currentTree ├── jsftp@1.5.5 npm sill currentTree ├── lru-cache@2.3.1 npm sill currentTree ├── ms@0.7.2 npm sill currentTree ├── once@1.4.0 npm sill currentTree ├── parse-listing@1.1.3 npm sill currentTree ├── readable-stream@1.1.14 npm sill currentTree ├── stream-combiner@0.2.2 npm sill currentTree ├── string_decoder@0.10.31 npm sill currentTree ├── through@2.3.8 npm sill currentTree ├── unorm@1.4.1 npm sill currentTree └── wrappy@1.0.2 npm sill idealTree iobroker.sayit@1.3.0 npm sill idealTree ├── aws4@0.4.2 npm sill idealTree ├── core-util-is@1.0.2 npm sill idealTree ├── debug@2.5.1 npm sill idealTree ├── duplexer@0.1.1 npm sill idealTree ├── ftp-response-parser@1.0.1 npm sill idealTree ├── inherits@2.0.3 npm sill idealTree ├── isarray@0.0.1 npm sill idealTree ├── ivona-node@0.2.0 npm sill idealTree ├── jsftp@1.5.5 npm sill idealTree ├── lru-cache@2.3.1 npm sill idealTree ├── ms@0.7.2 npm sill idealTree ├── once@1.4.0 npm sill idealTree ├── parse-listing@1.1.3 npm sill idealTree ├── readable-stream@1.1.14 npm sill idealTree ├── stream-combiner@0.2.2 npm sill idealTree ├── string_decoder@0.10.31 npm sill idealTree ├── through@2.3.8 npm sill idealTree ├── unorm@1.4.1 npm sill idealTree └── wrappy@1.0.2 npm sill generateActionsToTake Starting npm sill install generateActionsToTake npm sill generateActionsToTake Finishing npm sill diffTrees action count 0 npm sill decomposeActions action count 0 npm sill install printInstalled npm verb exit [ 0, true ] npm info ok !

      Kann man sich das mal anschauen? Ich glaub da ist versucht worden ein Problem zu lösen und man hat damit andere geschaffen.

      1 Reply Last reply Reply Quote 0
      • frankjoke
        frankjoke last edited by

        Ein kurzes Update (gültig für Linux im Moment):

        Habe bemerkt dass nach updates des Raspi auf neues Pixel und auf Node 6.9.2/npm 4.0.5 einige Adapter nicht mehr richtig liefen.

        Speziell Adapter die Module kompilieren mussten waren betroffen (rpi2 z.B., GPIO lief nicht mehr).

        Die Adapter zeigten 'grün' aber funktionierten nicht.

        Na gut, also reinstall.sh

        Da bin ich draufgekommen dass reinstall.sh auch 2x installiert!

        #!/bin/bash
        iobroker stop
        ls -1 ./node_modules | grep iobroker. > list.txt
        cd node_modules;
        rm * -R
        cd ..
        while read in; do npm install $in --production; cd node_modules/$in/; npm install --production; cd ../..; done < list.txt
        chmod 777 * -R
        rm list.txt
        iobroker upload all
        
        

        Also schrieb ich mein eigenes reinstall:

        #!/bin/bash
        sudo iobroker stop
        ls -1 ./node_modules | grep iobroker. > list.txt
        cd node_modules;
        sudop rm * -R
        cd ..
        sudo rm  iobroker
        while read in; do npm install $in --production --prefix /opt/iobroker ; done < list.txt
        chmod 777 * -R
        #rm list.txt
        sudo npm install iobroker --unsafe-perm
        iobroker upload all
        sudo iobroker start
        
        

        Auf meinem Testsystem war nach dem originalem Reinstall im ioBroker-Verzeichnis 369MB verbraucht (gemessen mit du -sh .).

        Mit meinem script waren nur 207MB verbraucht!

        IoBroker lief genauso und das rebuild dauerte halb so lang.

        Wie man sehen kann installierte ich alle Adapter OHNE sudo, nur iobroker selbt braucht sudo.

        Dann hab ich einen anderen Test gestartet: Alles mit Sudo aber ohne –

        #!/bin/bash
        sudo iobroker stop
        #ls -1 ./node_modules | grep iobroker. > list.txt
        cd node_modules;
        sudop rm * -R
        cd ..
        sudo rm  iobroker
        while read in; do sudo npm install $in --production; done < list.txt
        chmod 777 * -R
        #rm list.txt
        sudo npm i iobroker --unsafe-perm
        sudo iobroker upload all
        sudo iobroker start
        
        

        Das Ergebnis waren 211MB Speicher (immer gemessen in ioborker-Verzeichnis).

        Diese Version lief etwas besser als die Vorige (erzeugte weniger Fehler da einige Adapter oder Module ihre subModule im node_modules Unterverzeichnis erwarten) UND Installationen unter Admin mir root (=sudo)-Rechten ablaufen!

        Meine Conclusio:

        Das Problem besteht durch die Unterschiedliche Nutzung von root und "–prefix /opt/iobroker".

        "--prefix /opt/iobroker" speichert die Module in opt/iobroker/node_modules und nicht im Unterverzeichnis vom Adapter.

        Da Adapter unterschiedlich (nicht nur mit Admin) installier werden sind sie oft als Benutzer oder root installiert was zusätzlich Probleme verursacht.

        Mein Vorschlag deshalb:

        • Adapter sollten ohne Root installierbar sein

        • Zweistufige Installation (mit submodulen im Adapter und Submodulen in iobroker sollten vermieden werden.

        • Alle batch-scripts sollten klar sudo/user-Rechte definieren

        • Möglicherweise sollte ioBroker unter einem eigenen User laufen (und nur Adapter die root brauchen darauf zurückgreifen)

        Momentan verwendet ioBroker verschiedene Strategien um einzelne Adapter-Probleme zu lösen. Meiner Meinung nach wäre es besser die Adapter an die ioBroker-Strategie zu binden.

        1 Reply Last reply Reply Quote 0
        • First post
          Last post

        Support us

        ioBroker
        Community Adapters
        Donate
        FAQ Cloud / IOT
        HowTo: Node.js-Update
        HowTo: Backup/Restore
        Downloads
        BLOG

        739
        Online

        31.9k
        Users

        80.3k
        Topics

        1.3m
        Posts

        1
        2
        1091
        Loading More Posts
        • Oldest to Newest
        • Newest to Oldest
        • Most Votes
        Reply
        • Reply as topic
        Log in to reply
        Community
        Impressum | Datenschutz-Bestimmungen | Nutzungsbedingungen
        The ioBroker Community 2014-2023
        logo