Navigation

    Logo
    • Register
    • Login
    • Search
    • Recent
    • Tags
    • Unread
    • Categories
    • Unreplied
    • Popular
    • GitHub
    • Docu
    • Hilfe
    1. Home
    2. Deutsch
    3. Error/Bug
    4. Log Error: maxContentLength size of -1 exceeded

    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

    Log Error: maxContentLength size of -1 exceeded

    This topic has been deleted. Only users with topic management privileges can see it.
    • bahnuhr
      bahnuhr Forum Testing Most Active last edited by

      Hallo im log kommt:

      	script.js.Scripte.Geraete.Photovoltaik_2012: maxContentLength size of -1 exceeded
      

      Grundlage ist dieses Script:

      
      // Photovoltaik: Piko 5.5 Anlage (alte Firmware)
      // Danke an homoran für den regex
      // @bahnuhr; 03/2019 Dieter Müller
      
      //Variaben
          var idaktuell = 'javascript.0.Geräte.Photovoltaik.2012_Leistung_alt_aktuell';
          var idTag = 'javascript.0.Geräte.Photovoltaik.2012_Tagesleistung';
          var idall = 'javascript.0.Geräte.Photovoltaik.2012_Leistung_alt_gesamt';
          var idP1 = 'javascript.0.Geräte.Photovoltaik.2012_Leistung_Strang1';
          var idP2 = 'javascript.0.Geräte.Photovoltaik.2012_Leistung_Strang2';
      
          var NameAnlage = 'SN-Login';        // Nutzername der Photovoltaik-Anlage
          var PassAnlage = 'xxx';         // Password der Photovoltaik-Anlage
          var IPAnlage = '192.168.243.130';    // IP der Photovoltaik-Anlage
      
          var logging = false;
      
      
       function Piko() {
          log("Piko 5.5 auslesen");
          var results = [];
          httpGet('http://' + NameAnlage + ':' + PassAnlage +'@' + IPAnlage, { responseType: 'text' }, (err, response) => { 
          if (err) { console.error(err); }
          else { 
              var d = (response.data).toString();
              if (logging) log (d);
              var reg = /#FFFFFF">[^\d]+([^<]+)/g
              var z = reg.exec(d);
      
              while(z != null) {
                  if (isNaN(z[1])) {
                      if (logging) log("keine Zahl= "+ z[1]);
                      z[1] = 0;
                  } else {
                      if (logging) log("Zahl= "+ z[1]);
                      parseFloat(z[1]);
                  }
                  results[results.length] = z[1];
                  z = reg.exec(d);
              }
              if (logging) log("results= "+ results);
      
          // Werte zuordnen
              var pwr = results[0];           // Energie aktuell in W
              var day = results[2];           // Tagesenergie in kWh
              var all = results[1];           // Gesamtenergie in kWh
              var v1 = results[3];            // PV Generator Nr. 1 - Spannung in V
              var i1 = results[5];            // PV Generator Nr. 1 - Strom in A
              var p1 = parseInt(v1 * i1);
              var v2 = results[7];            // PV Generator Nr. 2 - Spannung in V
              var i2 = results[9];            // PV Generator Nr. 2 - Strom in A
              var p2 = parseInt(v2 * i2);
              // Tagesenergie auf 0 setzen wenn es Nacht ist
                  var Zeit1 = isTimeInRange('00:01:00', '09:00:00');
                  if (Zeit1 && pwr == 0 && p1 == 0 && p2 == 0) { day = 0; }
              // geändert: in pwr wird die aktuelle Energie angezeigt; dies passt aber nicht mit p1 + p2 überein.
              // vermutlich wird die W des Wechselrichters abgezogen. neu habe ich nun pwr = p1 + p2
                  pwr = p1 + p2;
      
              log("aktuell -> Leistung aktuell= " + pwr + " W // Tagesleistung= " + day + " kWh // Leistung alt gesamt= " + all + " kWh // Leistung Strang 1= " + p1 + " W // Leistung Strang 2= " + p2 + " W");
      
              setState(idaktuell, parseFloat(pwr));
              setState(idTag, parseFloat(day));
              setState(idall, parseFloat(all));
              setState(idP1, parseFloat(p1));
              setState(idP2, parseFloat(p2));
          } });
      }
      
      schedule('5 * * * * *', function () {
          log ("Auslöser: Schedule");
      	Piko();
      });
      
      

      Habe den request geändert auf httpget. Seit dem kommt immer mal wieder o.g. Error.

      Frage:
      Was kann man tun um den error weg zu bekommen ?

      mfg
      Dieter

      arteck 1 Reply Last reply Reply Quote 0
      • arteck
        arteck Developer Most Active @bahnuhr last edited by arteck

        @bahnuhr sagte in Log Error: maxContentLength size of -1 exceeded:

        { responseType: 'text' }

        pack da noch timeout rein

        { timeout: 2000, responseType: 'text' }
        

        .. -1 würde ich als keine Antwort interpretieren

        bahnuhr paul53 2 Replies Last reply Reply Quote 0
        • bahnuhr
          bahnuhr Forum Testing Most Active @arteck last edited by

          @arteck sagte in Log Error: maxContentLength size of -1 exceeded:

          pack da noch timeout rein

          probier ich aus, Danke.

          1 Reply Last reply Reply Quote 0
          • paul53
            paul53 @arteck last edited by paul53

            @arteck sagte: pack da noch timeout rein

            2000 ist default. Aus lib/tools.js:

                const config = {
                    method: 'get',
                    url,
                    validateStatus: (status) => status >= 200,
                    responseType: (options && options.responseType) ? options.responseType : 'text',
                    responseEncoding: 'utf8',
                    timeout: (options && !isNaN(options.timeout)) ? options.timeout : 2000
                };
            
            bahnuhr 1 Reply Last reply Reply Quote 0
            • bahnuhr
              bahnuhr Forum Testing Most Active @paul53 last edited by

              @paul53 sagte in Log Error: maxContentLength size of -1 exceeded:

              2000 ist default. Aus lib/tools.js:

              Und das heißt jetzt ?

              Also eher hoch setzen auf 3000 oder 4000.
              richtig ?

              paul53 1 Reply Last reply Reply Quote 0
              • paul53
                paul53 @bahnuhr last edited by paul53

                @bahnuhr sagte: eher hoch setzen auf 3000 oder 4000.

                Keine Ahnung, ob es bei diesem Fehler hilft.

                EDIT: Ich würde es eher mit {responseType: 'document'} versuchen.

                bahnuhr 1 Reply Last reply Reply Quote 0
                • bahnuhr
                  bahnuhr Forum Testing Most Active @paul53 last edited by

                  @paul53 sagte in Log Error: maxContentLength size of -1 exceeded:

                  Ich würde es eher mit {responseType: 'document'} versuchen.

                  Kann ich auch ausprobieren.
                  Danke für deine Info.

                  1 Reply Last reply Reply Quote 0
                  • bahnuhr
                    bahnuhr Forum Testing Most Active last edited by

                    Der Fehler kam heute wieder:

                    javascript.0
                    2024-05-16 10:32:09.412	error	script.js.Scripte.Geraete.Photovoltaik_2012: maxContentLength size of -1 exceeded
                    
                    javascript.0
                    2024-05-16 10:00:09.413	error	script.js.Scripte.Geraete.Photovoltaik_2012: maxContentLength size of -1 exceeded
                    

                    Eingestellt habe ich nun:

                    timeout: 4000, responseType: 'document'
                    

                    Gibts noch Ideen was man ändern könnte.

                    arteck 1 Reply Last reply Reply Quote 0
                    • arteck
                      arteck Developer Most Active @bahnuhr last edited by

                      @bahnuhr das Ding gibt dir ab und an nix zurück..

                      bahnuhr 1 Reply Last reply Reply Quote 0
                      • bahnuhr
                        bahnuhr Forum Testing Most Active @arteck last edited by bahnuhr

                        @arteck sagte in Log Error: maxContentLength size of -1 exceeded:

                        @bahnuhr das Ding gibt dir ab und an nix zurück..

                        ok, dann lasse ich es jetzt so.

                        Nachtrag:
                        Bei request kam eine solche Meldung nicht.

                        arteck 1 Reply Last reply Reply Quote 0
                        • arteck
                          arteck Developer Most Active @bahnuhr last edited by

                          @bahnuhr

                          mach das weg

                          console.error(err);
                          

                          dann kommt die Maldung auch nicht

                          bahnuhr 1 Reply Last reply Reply Quote 0
                          • bahnuhr
                            bahnuhr Forum Testing Most Active @arteck last edited by

                            @arteck sagte in Log Error: maxContentLength size of -1 exceeded:

                            @bahnuhr

                            mach das weg

                            console.error(err);
                            

                            dann kommt die Maldung auch nicht

                            Ja, genau.
                            Hätte ich auch selber drauf kommen können.
                            Danke.

                            1 Reply Last reply Reply Quote 0
                            • bahnuhr
                              bahnuhr Forum Testing Most Active last edited by

                              Habe es mal so geändert:

                                  if (err) { 
                                      if (err.indexOf("size of -1") != -1) {
                                          log ("size -1 enthalten");
                                      } else {
                                          console.error(err); 
                                      }
                                  } else { 
                              

                              Mal schauen ob dies funktioniert. Wenn ja, dann mach ich log("size... weg.

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

                              Support us

                              ioBroker
                              Community Adapters
                              Donate

                              597
                              Online

                              31.8k
                              Users

                              80.0k
                              Topics

                              1.3m
                              Posts

                              error httpget maxcontentlength
                              3
                              13
                              385
                              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