Navigation

    Logo
    • Register
    • Login
    • Search
    • Recent
    • Tags
    • Unread
    • Categories
    • Unreplied
    • Popular
    • GitHub
    • Docu
    • Hilfe
    1. Home
    2. Deutsch
    3. Tester
    4. Test ioBroker Fixer mit JSONL-Compression

    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

    Test ioBroker Fixer mit JSONL-Compression

    This topic has been deleted. Only users with topic management privileges can see it.
    • Thomas Braun
      Thomas Braun Most Active @mrjeschke last edited by Thomas Braun

      @mrjeschke

      Richtig, sollte es.
      Tut es auf meiner lokalen Version auch. Muss ich mal buddeln was da jetzt auf dem Server gelandet ist.

      echad@chet:~/iob_diag $ diff iob_diag diag.sh
      8c8
      < SKRIPTV="0.0.8"; #version of this script
      ---
      > SKRIPTV="2022-12-09"; #version of this script
      

      Bis auf der angepasste Versionsnummer ist das gleich. Keine Ahnung warum das nicht wie vorgesehen funktioniert.

      M 1 Reply Last reply Reply Quote 0
      • M
        mrjeschke @Thomas Braun last edited by

        @thomas-braun

        Seltsam, wenn ich das Script mit

        
        curl -sLf https://iobroker.net/diag.sh > diag.sh
        

        runterlade und lokal ausführe wartet es auf Tastendruck.
        Mit

        
        curl -sLf https://iobroker.net/diag.sh | bash -
        
        

        aber nicht.

        Thomas Braun 1 Reply Last reply Reply Quote 1
        • Thomas Braun
          Thomas Braun Most Active @mrjeschke last edited by Thomas Braun

          @mrjeschke

          Kannst du mal versuchen ob es so richtig herunterkommt:

          curl -sLf -o diag.sh https://iobroker.net/diag.sh && bash diag.sh
          

          Mit Ausgabe in ein log file:

          curl -sLf -o .diag.sh https://iobroker.net/diag.sh && bash .diag.sh | tee iob_diag.log
          
          M 1 Reply Last reply Reply Quote 0
          • M
            mrjeschke @Thomas Braun last edited by

            @thomas-braun

            Ja, das läuft jetzt wie es soll.

            Thomas Braun 2 Replies Last reply Reply Quote 0
            • Thomas Braun
              Thomas Braun Most Active @mrjeschke last edited by

              @mrjeschke

              Hmmm, danke. Dann muss ich mal schauen wie das richtig umgesetzt werden kann.

              1 Reply Last reply Reply Quote 0
              • Thomas Braun
                Thomas Braun Most Active @mrjeschke last edited by

                @mrjeschke

                Jetzt läuft iob diag, auch mit Warterei auf Tastatureingaben.

                O M 2 Replies Last reply Reply Quote 1
                • O
                  oFbEQnpoLKKl6mbY5e13 @Thomas Braun last edited by

                  @thomas-braun

                  Kann/darf man den Befehl auch bei laufenden iobroker ausführen?

                  Thomas Braun 1 Reply Last reply Reply Quote 0
                  • Thomas Braun
                    Thomas Braun Most Active @oFbEQnpoLKKl6mbY5e13 last edited by Thomas Braun

                    @ofbeqnpolkkl6mby5e13

                    Ja, der liest nur Werte aus und schreibt nichts in die Konfig.
                    Wenn der iobroker läuft geht es etwas schneller, weil dann schon viel im RAM ist, was bei gestopptem iobroker erst noch geladen werden müsste.

                    Bei einem Bestandssystem muss nur einmal per

                    iobroker fix
                    

                    der aktuelle Stand geladen werden. Dafür muss der ioBroker natürlich wie üblich gestoppt sein.

                    1 Reply Last reply Reply Quote 2
                    • M
                      mrjeschke @Thomas Braun last edited by

                      @thomas-braun
                      Wenn ich

                      iob diag
                      

                      eingebe, läuft das Script immer noch ohne Stop durch.

                      Thomas Braun 1 Reply Last reply Reply Quote 0
                      • Thomas Braun
                        Thomas Braun Most Active @mrjeschke last edited by

                        @mrjeschke
                        Vorher

                        iobroker fix
                        

                        damit der richtige Aufruf geladen wird.

                        M 1 Reply Last reply Reply Quote 0
                        • M
                          mrjeschke @Thomas Braun last edited by

                          @thomas-braun
                          Alles klar, jetzt läuft es.

                          Thomas Braun 1 Reply Last reply Reply Quote 0
                          • Thomas Braun
                            Thomas Braun Most Active @mrjeschke last edited by

                            @mrjeschke
                            Und legt dir auch ein Log nach

                            /home/iobroker/iob_diag.log

                            M 1 Reply Last reply Reply Quote 0
                            • M
                              mrjeschke @Thomas Braun last edited by

                              @thomas-braun
                              Ja, Log wird erstellt.

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

                                @apollon77 said in Test ioBroker Fixer mit JSONL-Compression:

                                Der Fixer ist jetzt auch unter Windows verfügbar! Wäre cool wenn ich da ggf auch Tester finden ...

                                Also, wie schon im anderen Thread geschrieben, bekomme auch ich unter Windows den schon bekannten Fehler:

                                F:\ioBrokerTest>npx @iobroker/fix
                                Need to install the following packages:
                                  @iobroker/fix@4.2.1
                                Ok to proceed? (y) y
                                "(" kann syntaktisch an dieser Stelle nicht verarbeitet werden.
                                

                                Wenn ich jetzt das Package nicht per npx ausführe, sondern installiere

                                F:\ioBrokerTest>npm install @iobroker/fix
                                

                                Und dann das Script direkt starte:

                                F:\ioBrokerTest>node node_modules\@iobroker\fix\lib-npx\install.js fix
                                

                                Läuft der Fixer erstmal los(!?), meldet am Ende aber einen Fehler:

                                Windows installation starting... (fixing = true)
                                NPM version: 8.19.3
                                Write "iobroker start" to start the ioBroker
                                npm install node-windows@1.0.0-beta.8 --force --loglevel error --production --save --prefix "F:/ioBrokerTest"
                                
                                up to date, audited 524 packages in 9s
                                
                                36 packages are looking for funding
                                  run `npm fund` for details
                                
                                20 vulnerabilities (2 low, 16 moderate, 2 high)
                                
                                To address issues that do not require attention, run:
                                  npm audit fix
                                
                                To address all issues (including breaking changes), run:
                                  npm audit fix --force
                                
                                Run `npm audit` for details.
                                
                                =============================
                                Running Admin shell
                                =============================
                                ioBroker wird beendet.
                                ioBroker wurde erfolgreich beendet.
                                
                                ioBroker service is already installed.
                                
                                =============================
                                Running Admin shell
                                =============================
                                ioBroker wird gestartet.
                                ioBroker wurde erfolgreich gestartet.
                                
                                ioBroker service installed and started. Go to http://localhost:8081 to open the admin UI.
                                To see the outputs do not start the service, but write "node node_modules/iobroker.js-controller/controller"
                                NPM version: 8.19.3
                                No path given, using F:\ioBrokerTest\iobroker-data
                                Compressing F:\ioBrokerTest\iobroker-data\states.jsonl
                                Cannot compress states.jsonl: Error: Failed to lock DB file "F:\ioBrokerTest\iobroker-data\states.jsonl"!
                                    at JsonlDB.open (C:\Users\OnkelAdmin\AppData\Local\npm-cache\_npx\36bee06d4228a674\node_modules\@alcalzone\jsonl-db\build\lib\db.js:185:19)
                                    at async compressDB (C:\Users\OnkelAdmin\AppData\Local\npm-cache\_npx\36bee06d4228a674\node_modules\@iobroker\jsonltool\index.js:37:9)
                                    at async main (C:\Users\OnkelAdmin\AppData\Local\npm-cache\_npx\36bee06d4228a674\node_modules\@iobroker\jsonltool\index.js:78:17)
                                Compressing F:\ioBrokerTest\iobroker-data\objects.jsonl
                                Cannot compress objects.jsonl: Error: Failed to lock DB file "F:\ioBrokerTest\iobroker-data\objects.jsonl"!
                                    at JsonlDB.open (C:\Users\OnkelAdmin\AppData\Local\npm-cache\_npx\36bee06d4228a674\node_modules\@alcalzone\jsonl-db\build\lib\db.js:185:19)
                                    at async compressDB (C:\Users\OnkelAdmin\AppData\Local\npm-cache\_npx\36bee06d4228a674\node_modules\@iobroker\jsonltool\index.js:37:9)
                                    at async main (C:\Users\OnkelAdmin\AppData\Local\npm-cache\_npx\36bee06d4228a674\node_modules\@iobroker\jsonltool\index.js:93:17)
                                No relevant JSONL files found to compress, skip
                                

                                Hilft das irgendwie weiter?

                                apollon77 1 Reply Last reply Reply Quote 0
                                • apollon77
                                  apollon77 @Gaspode last edited by

                                  @gaspode iobroker gestoppt vorher? Cannot lock db heißt das die dB offen ist. Fixer darf nur laufen wenn gestoppt ist.

                                  Jetzt kapiere ich aber nicht warum es so „zu Fuß“ geht aber nicht direkt per npx. Das sollte genaueste gleiche tun 😞

                                  Gaspode 1 Reply Last reply Reply Quote 0
                                  • Gaspode
                                    Gaspode @apollon77 last edited by

                                    @apollon77 said in Test ioBroker Fixer mit JSONL-Compression:

                                    iobroker gestoppt vorher?

                                    Ja, ioBroker vorher mit iobroker stop gestoppt. Allerdings scheint er, wenn ich das Log richtig verstehe, unmittelbar vor der Komprimierung wieder gestartet zu werden (Zeile 29ff):

                                    ...
                                    =============================
                                    Running Admin shell
                                    =============================
                                    ioBroker wird gestartet.
                                    ioBroker wurde erfolgreich gestartet.
                                    ioBroker service installed and started. Go to http://localhost:8081 to open the admin UI.
                                    To see the outputs do not start the service, but write "node node_modules/iobroker.js-controller/controller"
                                    NPM version: 8.19.3
                                    No path given, using F:\ioBrokerTest\iobroker-data
                                    Compressing F:\ioBrokerTest\iobroker-data\states.jsonl
                                    ...
                                    

                                    @apollon77 said in Test ioBroker Fixer mit JSONL-Compression:

                                    Jetzt kapiere ich aber nicht warum es so „zu Fuß“ geht aber nicht direkt per npx. Das sollte genaueste gleiche tun

                                    Ich hatte das ja nur "zu Fuß" gemacht, weil ich hoffte, so die Stelle zu finden, wo etwas schief läuft. Hätte nicht erwartet, dass der Fixer dann startet.

                                    Der npx Aufruf mit --verbose liefert übrigens das hier:

                                    F:\ioBrokerTest>iobroker status
                                    iobroker is not running on this host.
                                    
                                    Objects type: jsonl
                                    States  type: jsonl
                                    
                                    F:\ioBrokerTest>npx --verbose @iobroker/fix
                                    npm verb cli C:\Program Files\nodejs\node.exe C:\Program Files\nodejs\node_modules\npm\bin\npm-cli.js
                                    npm info using npm@8.19.3
                                    npm info using node@v16.19.0
                                    npm timing npm:load:whichnode Completed in 0ms
                                    npm timing config:load:defaults Completed in 2ms
                                    npm timing config:load:file:C:\Program Files\nodejs\node_modules\npm\npmrc Completed in 10ms
                                    npm timing config:load:builtin Completed in 11ms
                                    npm timing config:load:cli Completed in 2ms
                                    npm timing config:load:env Completed in 1ms
                                    npm timing config:load:file:F:\ioBrokerTest\.npmrc Completed in 1ms
                                    npm timing config:load:project Completed in 3ms
                                    npm timing config:load:file:C:\Users\OnkelAdmin\.npmrc Completed in 1ms
                                    npm timing config:load:user Completed in 1ms
                                    npm timing config:load:file:C:\Users\OnkelAdmin\AppData\Roaming\npm\etc\npmrc Completed in 0ms
                                    npm timing config:load:global Completed in 0ms
                                    npm timing config:load:validate Completed in 1ms
                                    npm timing config:load:credentials Completed in 1ms
                                    npm timing config:load:setEnvs Completed in 1ms
                                    npm timing config:load Completed in 25ms
                                    npm timing npm:load:configload Completed in 26ms
                                    npm timing npm:load:mkdirpcache Completed in 1ms
                                    npm timing npm:load:mkdirplogs Completed in 1ms
                                    npm verb title npm exec @iobroker/fix
                                    npm verb argv "exec" "--loglevel" "verbose" "--" "@iobroker/fix"
                                    npm timing npm:load:setTitle Completed in 2ms
                                    npm timing config:load:flatten Completed in 5ms
                                    npm timing npm:load:display Completed in 20ms
                                    npm verb logfile logs-max:10 dir:C:\Users\OnkelAdmin\AppData\Local\npm-cache\_logs
                                    npm verb logfile C:\Users\OnkelAdmin\AppData\Local\npm-cache\_logs\2023-01-14T08_15_41_665Z-debug-0.log
                                    npm timing npm:load:logFile Completed in 12ms
                                    npm timing npm:load:timers Completed in 0ms
                                    npm timing npm:load:configScope Completed in 0ms
                                    npm timing npm:load Completed in 67ms
                                    npm timing arborist:ctor Completed in 1ms
                                    npm verb shrinkwrap failed to load node_modules/.package-lock.json out of date, updated: node_modules/iobroker.js-controller
                                    "(" kann syntaktisch an dieser Stelle nicht verarbeitet werden.
                                    npm timing command:exec Completed in 938ms
                                    npm verb exit 255
                                    npm timing npm Completed in 1307ms
                                    npm verb code 255
                                    

                                    Hilf das evtl. weiter?

                                    apollon77 1 Reply Last reply Reply Quote 0
                                    • apollon77
                                      apollon77 @Gaspode last edited by

                                      @gaspode ok das mit dem Start ist gut zu wissen. Dann schiebe ich den fixer weiter nach vorn im Code. Das logfile gibt sonst leider nix her was helfen würde außer das dieser Fehler vom exec des fix kommt. Aber waasrruuuuuuuuuuuummm 😞

                                      Gaspode 1 Reply Last reply Reply Quote 0
                                      • Gaspode
                                        Gaspode @apollon77 last edited by Gaspode

                                        @apollon77
                                        Falls du vorab was zum lokal testen hast, kann ich das gerne erledigen.

                                        Zeile 42 (kann das Zufall sein, 42? 😄 ) ist nicht verdächtig? Kommt jedes Mal.

                                        1 Reply Last reply Reply Quote 0
                                        • qqolli
                                          qqolli @apollon77 last edited by

                                          @apollon77
                                          Anbei meine Ergebnis (npm: 8.19.3), keine Probleme, Kompression erfolgreich:

                                          olli@ioBroker:~$ iob stop
                                          olli@ioBroker:~$ ls -la /opt/iobroker/iobroker-data/*.jsonl 
                                          -rw-rw-r--+ 1 iobroker iobroker 27528654 Jan 14 09:12 /opt/iobroker/iobroker-data/objects.jsonl
                                          -rw-rw-r--+ 1 iobroker iobroker 11819686 Jan 14 09:12 /opt/iobroker/iobroker-data/states.jsonl
                                          olli@ioBroker:~$ curl -sLf https://raw.githubusercontent.com/ioBroker/ioBroker/dbcompress/fix_installation.sh | bash -
                                          library: loaded
                                          Library version=2022-12-09
                                          
                                          ==========================================================================
                                          
                                              Welcome to the ioBroker installation fixer!
                                              Script version: 2022-11-19
                                              
                                              You might need to enter your password a couple of times.
                                          
                                          ==========================================================================
                                          
                                          
                                          ==========================================================================
                                              Installing prerequisites (1/4)
                                          ==========================================================================
                                          
                                          [sudo] password for olli: 
                                          Get:1 http://security.debian.org bullseye-security InRelease [48.4 kB]
                                          Hit:2 http://ftp.debian.org/debian bullseye InRelease                                                                    
                                          Get:3 http://ftp.debian.org/debian bullseye-updates InRelease [44.1 kB]                                                   
                                          Hit:4 https://deb.nodesource.com/node_16.x bullseye InRelease                                  
                                          Get:5 http://security.debian.org bullseye-security/main amd64 Packages [214 kB]
                                          Get:6 http://security.debian.org bullseye-security/main Translation-en [139 kB]
                                          Fetched 445 kB in 0s (1154 kB/s)                          
                                          Reading package lists... Done
                                          Installed gcc-c++
                                          
                                          ==========================================================================
                                              Checking ioBroker user and directory permissions (2/4)
                                          ==========================================================================
                                          
                                          Created /etc/sudoers.d/iobroker
                                          Fixing directory permissions...
                                          
                                          ==========================================================================
                                              Database maintenance (3/4)
                                          ==========================================================================
                                          
                                          Checking for uncompressed JSONL databases... This might take a while!
                                          
                                          Compressing /opt/iobroker/iobroker-data/states.jsonl
                                          Compressing /opt/iobroker/iobroker-data/objects.jsonl
                                          Compressed 2 JSONL files. Done
                                          
                                          ==========================================================================
                                              Checking autostart (4/4)
                                          ==========================================================================
                                          
                                          Enabling autostart...
                                          Autostart enabled!
                                          
                                          ==========================================================================
                                          
                                              Your installation was fixed successfully
                                              Run iobroker start to start ioBroker again!
                                          
                                          ==========================================================================
                                          
                                          olli@ioBroker:~$ ls -la /opt/iobroker/iobroker-data/*.jsonl
                                          -rw-rw-r--+ 1 iobroker iobroker 16939782 Jan 14 09:13 /opt/iobroker/iobroker-data/objects.jsonl
                                          -rw-rw-r--+ 1 iobroker iobroker  2833129 Jan 14 09:13 /opt/iobroker/iobroker-data/states.jsonl
                                          olli@ioBroker:~$
                                          
                                          1 Reply Last reply Reply Quote 0
                                          • Gaspode
                                            Gaspode last edited by Gaspode

                                            @apollon77
                                            Nochmal zu Windows:
                                            Hab die Ursache gefunden, aber verstehen tu ich es nicht so richtig:
                                            Der Fehler

                                            "(" kann syntaktisch an dieser Stelle nicht verarbeitet werden.
                                            

                                            kommt aus dem Batch File iobroker.bat, das im ioBroker Verzeichnis liegt (ruft man iobroker.bat ohne Parameter auf, kommt genau dieser Fehler).
                                            Aus irgendeinem Grund wird bei

                                            npx @iobroker/fix
                                            

                                            iobroker.bat ausgeführt. Warum hab ich noch nicht rausbekommen.

                                            Folgendes startet den Fixer auch unter Windows:

                                            F:\ioBrokerTest>del iobroker.bat
                                            
                                            F:\ioBrokerTest>npx @iobroker/fix
                                            
                                            Windows installation starting... (fixing = true)
                                            NPM version: 9.3.0
                                            Write "iobroker start" to start the ioBroker
                                            npm install node-windows@1.0.0-beta.8 --force --loglevel error --production --save --prefix "F:/ioBrokerTest"
                                            
                                            up to date, audited 524 packages in 6s
                                            
                                            36 packages are looking for funding
                                              run `npm fund` for details
                                            
                                            20 vulnerabilities (15 moderate, 5 high)
                                            
                                            To address issues that do not require attention, run:
                                              npm audit fix
                                            
                                            To address all issues (including breaking changes), run:
                                              npm audit fix --force
                                            
                                            Run `npm audit` for details.
                                            
                                            =============================
                                            Running Admin shell
                                            =============================
                                            ioBroker wird beendet.
                                            ioBroker wurde erfolgreich beendet.
                                            
                                            ioBroker service is already installed.
                                            
                                            =============================
                                            Running Admin shell
                                            =============================
                                            ioBroker wird gestartet.
                                            ioBroker wurde erfolgreich gestartet.
                                            
                                            ioBroker service installed and started. Go to http://localhost:8081 to open the admin UI.
                                            To see the outputs do not start the service, but write "node node_modules/iobroker.js-controller/controller"
                                            NPM version: 9.3.0
                                            No path given, using F:\ioBrokerTest\iobroker-data
                                            Compressing F:\ioBrokerTest\iobroker-data\states.jsonl
                                            Cannot compress states.jsonl: Error: Failed to lock DB file "F:\ioBrokerTest\iobroker-data\states.jsonl"!
                                                at JsonlDB.open (C:\Users\ONKELA~1\AppData\Local\npm-cache\_npx\36bee06d4228a674\node_modules\@alcalzone\jsonl-db\build\lib\db.js:185:19)
                                                at async compressDB (C:\Users\ONKELA~1\AppData\Local\npm-cache\_npx\36bee06d4228a674\node_modules\@iobroker\jsonltool\index.js:37:9)
                                                at async main (C:\Users\ONKELA~1\AppData\Local\npm-cache\_npx\36bee06d4228a674\node_modules\@iobroker\jsonltool\index.js:78:17)
                                            Compressing F:\ioBrokerTest\iobroker-data\objects.jsonl
                                            Cannot compress objects.jsonl: Error: Failed to lock DB file "F:\ioBrokerTest\iobroker-data\objects.jsonl"!
                                                at JsonlDB.open (C:\Users\ONKELA~1\AppData\Local\npm-cache\_npx\36bee06d4228a674\node_modules\@alcalzone\jsonl-db\build\lib\db.js:185:19)
                                                at async compressDB (C:\Users\ONKELA~1\AppData\Local\npm-cache\_npx\36bee06d4228a674\node_modules\@iobroker\jsonltool\index.js:37:9)
                                                at async main (C:\Users\ONKELA~1\AppData\Local\npm-cache\_npx\36bee06d4228a674\node_modules\@iobroker\jsonltool\index.js:93:17)
                                            No relevant JSONL files found to compress, skip
                                            

                                            Mit dem von oben bekanntem Problem, dass ioBroker vor der Komprimierung gestartet wird. Aber das weißt du ja schon.
                                            Witzig: Der Fixer legt das gelöschte File iobroker.bat gleich wieder an, man macht sich durch das Löschen also nix kaputt. 😄

                                            Edit: Für die Fehlermeldung in iobroker.bat und iob.bat hab ich PRs angelegt. Das hilft bei diesem Problem zwar nicht weiter, aber wenn man es schon mal weiß ...

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

                                            Support us

                                            ioBroker
                                            Community Adapters
                                            Donate

                                            840
                                            Online

                                            31.9k
                                            Users

                                            80.1k
                                            Topics

                                            1.3m
                                            Posts

                                            15
                                            84
                                            5811
                                            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