Announcement

Collapse
No announcement yet.

Exception adding record(s) to the ENERGY database(0): SQL logic error or missing data

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

    Exception adding record(s) to the ENERGY database(0): SQL logic error or missing data

    Hi there... I am getting the following error all the time - every few seconds:

    feb.-15 19:49:14 Energy DB SQL statments completed. Modifying database for Ref 172.
    feb.-15 19:49:14 Error Exception adding record(s) to the ENERGY database(0): SQL logic error or missing database 9 values for 8 columns
    Sorry for not being able to tell you, when such errors started, since the system is working OK - therefore I did not check the log lately...

    My system:
    Current Date/Time: 15. 02. 2018 19:44:45
    HomeSeer Version: HS3 Pro Edition 3.0.0.368
    Operating System: Microsoft Windows 10 Pro - Work Station
    System Uptime: 11 Days 0 Hours 53 Minutes 4 Seconds
    IP Address: 192.168.80.4
    Number of Devices: 177
    Number of Events: 6
    Available Threads: 399

    Enabled Plug-Ins
    2.0.29.0: BLBackup
    2.0.5.0: BLLatestImage
    5.0.0.56: Global Cache Pro
    3.0.0.11: NetCAM
    1.0.0.5: Restart
    30.0.0.36: RFXCOM
    3.0.0.63: weatherXML
    0.1.54.0: WU Weather
    3.0.1.190: Z-Wave

    I added two z-wave devices lately, but as it seems, they are working OK....

    #2
    Looks like your database is corrupted.

    Comment


      #3
      Originally posted by concordseer View Post
      Looks like your database is corrupted.
      How can I manage it?

      Comment


        #4
        Help please....

        Comment


          #5
          At this point I would recommend shutting down HS3 and deleting your energy db and restart HS3 which will recreate the db and start logging again.
          💁‍♂️ Support & Customer Service 🙋‍♂️ Sales Questions 🛒 Shop HomeSeer Products

          Comment


            #6
            Dear all,

            I have exactly the same problem and it keeps returning. I shutdown homeseer and deleted the energy.hsd file. I restarted homeseer but after a few minutes the problem re-occurred:


            apr-02 11:45:12 Energy DB Compaction of remaining data completed, rechecking database size...
            apr-02 11:45:12 Error Exception adding record(s) to the ENERGY database(0): SQL logic error or missing database 9 values for 8 columns
            apr-02 11:45:12 Energy DB SQL statments completed. Modifying database for Ref 383.
            apr-02 11:45:12 Error Exception adding record(s) to the ENERGY database(0): SQL logic error or missing database all VALUES must have the same number of terms
            apr-02 11:45:11 Energy DB SQL statments completed. Modifying database for Ref 1058.
            apr-02 11:45:11 Error Exception adding record(s) to the ENERGY database(0): SQL logic error or missing database all VALUES must have the same number of terms
            apr-02 11:45:11 Energy DB SQL statments completed. Modifying database for Ref 1068.
            apr-02 11:45:09 Z-Wave Device: Ground Floor Dining Room Dining table lamp - Volts Set to 241,23 (241,23 Volts)
            apr-02 11:45:08 Error Exception adding record(s) to the ENERGY database(0): SQL logic error or missing database all VALUES must have the same number of terms
            apr-02 11:45:07 Energy DB SQL statments completed. Modifying database for Ref 1109.

            Any thoughts how I could fix this?

            I am using HS Versio version 3.0.0.368 on windows 7

            Comment


              #7
              Have you checked your disk storage recently. Sounds like SQL is trying to write to bad sectors and trying to repair the inconsistencies.

              Comment


                #8
                Hi Concordseed. I checked the SSD on the Win7 system and all seems ok so I don't think it is storage related. Any other ideas?

                Comment


                  #9
                  Those messages indicate there are more values than columns. You guys across the pond use a comma instead of a decimal point for values and since the SQL statement uses commas, it's likely getting off by 1 or more values.

                  The best fix would be for HS to modify their energy code to paramaterize those SQL statements. In the interim, can you change your locale to use decimals instead of commas?
                  HS4Pro on a Raspberry Pi4
                  54 Z-Wave Nodes / 21 Zigbee Devices / 108 Events / 767 Devices
                  Plugins: Z-Wave / Zigbee Plus / EasyTrigger / AK Weather / OMNI

                  HSTouch Clients: 1 Android

                  Comment


                    #10
                    Dear all, I have reset my locale to US International so my decimal separator is . instead of ,. I will report back if this solves the issue.

                    Comment


                      #11
                      I have run for over a day now without issues, so I guess the errors are indeed related to the locale. Thanks for the help!

                      Comment


                        #12
                        Originally posted by mroovers View Post
                        I have run for over a day now without issues, so I guess the errors are indeed related to the locale. Thanks for the help!
                        cool!

                        Yeah, the commas cause database updates since that is the delimiter. You have to parmameterize the values so that the data gets encoded to *include* the comma - the HS code is not doing this.

                        Glad you are running now!
                        HS4Pro on a Raspberry Pi4
                        54 Z-Wave Nodes / 21 Zigbee Devices / 108 Events / 767 Devices
                        Plugins: Z-Wave / Zigbee Plus / EasyTrigger / AK Weather / OMNI

                        HSTouch Clients: 1 Android

                        Comment

                        Working...
                        X