Announcement

Collapse
No announcement yet.

Database errors

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

    Database errors

    Recently I started to see some "Info" messages in the log, about failing SELECT statements. I didn't pay much attention to it, assuming it was an incident. Just not I restarted the plugin, and I have hundreds of those messages in the log. Should I be worried? Is my database corrupt? A few examples:


    1-31-2021 22:02:34
    mcsMQTT
    Info
    ExecuteScalar SELECT count(Source) as extant FROM MQTT_MESSAGE WHERE (Source='stat/SlaapkamerKast/STATUS11:StatusSTS:Wifi:0�tele/SlaapkamerKast/STATE{Time') Line 0 SQLite error unrecognized token: "'stat/SlaapkamerKast/STATUS11:StatusSTS:Wifi:0�"


    1-31-2021 22:02:34
    mcsMQTT
    Info
    ExecuteCommand INSERT INTO MQTT_MESSAGE (Source, Topic, Payload, Template, Pattern, Replace, Match, LastDate, Reject, Express, Elevate, ElevateKeys, URIEncode, Accept, RetainFlag, PluginDevice, Subscribe, History, StorePayload, Ref, Misc, QOS, StatusType, Chart, ChangeType, Broker, RefList, Energy, VgpMax) Values ('stat/SlaapkamerRolluikZijkant/STATUS10:StatusSNS:ENERGY:Factor0�&stat/SlaapkamerRolluikZijkant/STATUS11{StatusSTS:UptimeSec','','98785','','','','0','2021-01-31 17:16:56',0,0,0,'',0,0,0,1,0,0,0,-1,4112,0,0,0,1,0,'',0,12) Line 0 SQLite error unrecognized token: "'stat/SlaapkamerRolluikZijkant/STATUS10:StatusSNS:ENERGY:Factor0�"


    1-31-2021 22:02:34
    mcsMQTT
    Info
    ExecuteScalar SELECT count(Source) as extant FROM MQTT_MESSAGE WHERE (Source='stat/SlaapkamerRolluikZijkant/STATUS10:StatusSNS:ENERGY:Factor0�&stat/SlaapkamerRolluikZijkant/STATUS11{StatusSTS:UptimeSec') Line 0 SQLite error unrecognized token: "'stat/SlaapkamerRolluikZijkant/STATUS10:StatusSNS:ENERGY:Factor0�"


    1-31-2021 22:02:34
    mcsMQTT
    Info
    ExecuteCommand INSERT INTO MQTT_MESSAGE (Source, Topic, Payload, Template, Pattern, Replace, Match, LastDate, Reject, Express, Elevate, ElevateKeys, URIEncode, Accept, RetainFlag, PluginDevice, Subscribe, History, StorePayload, Ref, Misc, QOS, StatusType, Chart, ChangeType, Broker, RefList, Energy, VgpMax) Values ('stat/SlaapkamerRolluikZijkant/STATUS10:StatusSNS:ENERGY:Factor0�&stat/SlaapkamerRolluikZijkant/STATUS11{StatusSTS:Uptime','','1T03:26:25','','','','0','202 1-01-31 17:16:56',0,0,0,'',0,0,0,1,0,0,0,-1,4112,0,0,0,1,0,'',0,12) Line 0 SQLite error unrecognized token: "'stat/SlaapkamerRolluikZijkant/STATUS10:StatusSNS:ENERGY:Factor0�"

    Thanks!
    stefxx

    #2
    Opening the database with SQLite DB Browser doesn't reveal anything obvious.
    stefxx

    Comment


      #3
      I did a google search on "sqlite unrecognized token" and first up was python - Unrecognized token in SQLite statement - Stack Overflow . I do not yet know what it means now for use of the .NET library, but the diagnosis seems to indicate there is something in the data that confuses it. Perhaps some of the special characters are being interpreted. I do protect against the quotes, but maybe there are others such as those symbols that are showing up in the string.

      Comment


        #4
        I don't recall changing anything.. except updating the firmware on most of my Tasmota devices to 9.2. Could that be related?
        stefxx

        Comment


          #5
          Based upon the one site it looks to be data-related. The symbol ending with Factor0 or WiFi:0 would be my first guess. When I try to save it to file I get the following. Could be the same type of thing that SQLite is experiencing. Do you know what this symbol is"?

          Click image for larger version

Name:	Capture.PNG
Views:	113
Size:	4.5 KB
ID:	1452935

          Comment


            #6
            I am running an external Mosquitto MQTT broker on a Raspberry Pi. It seems to be the cause of some corruption in the messages. I am currently updating it, hopefully that will resolve it.

            The "special" characters seems to be random.
            stefxx

            Comment


              #7
              Update didn't help.

              I can reproduce it by sending a cmnd/tasmotas/status=0 to all devices. I guess something gets overloaded. Not sure if it is the broker or the plugin...
              stefxx

              Comment


                #8
                It is always the same "block" character (U+2592). By now I am confident it is NOT the plugin, but the device and/or the Mosquitto broker. The message is corrupted. I see the same when I subscribe to the topic with mosquitto_sub.

                No clue on what to do next
                stefxx

                Comment

                Working...
                X