Announcement

Collapse
No announcement yet.

Concord trouble connecting to SQL Database

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

  • Concord trouble connecting to SQL Database

    Just developed this problem over the last couple of days. Any idea what might be causing this problem.



    May-10 12:14:32 * CONCORD Error An unexpected error occurred in the Timer1_Elapsed function/subroutine: [System.ObjectDisposedException: Cannot access a disposed object. Object name: 'SQLiteConnection'. at System.Data.SQLite.SQLiteConnection.CheckDisposed () [0x00017] in <11a72aa9b7eb459d9770aa264de2a0ab>:0 at System.Data.SQLite.SQLiteConnection.Close () [0x00000] in <11a72aa9b7eb459d9770aa264de2a0ab>:0 at (wrapper remoting-invoke-with-check) System.Data.SQLite.SQLiteConnection:Close () at HSPI_CONCORD.dbModule.updateTrackingTable () [0x00141] in :0 at HSPI_CONCORD.devModule.Timer1_Elapsed (System.Object sender, System.Timers.ElapsedEventArgs e) [0x0003b] in :0 ]

  • #2
    Originally posted by concordseer View Post
    Just developed this problem over the last couple of days. Any idea what might be causing this problem.



    May-10 12:14:32 * CONCORD Error An unexpected error occurred in the Timer1_Elapsed function/subroutine: [System.ObjectDisposedException: Cannot access a disposed object. Object name: 'SQLiteConnection'. at System.Data.SQLite.SQLiteConnection.CheckDisposed () [0x00017] in <11a72aa9b7eb459d9770aa264de2a0ab>:0 at System.Data.SQLite.SQLiteConnection.Close () [0x00000] in <11a72aa9b7eb459d9770aa264de2a0ab>:0 at (wrapper remoting-invoke-with-check) System.Data.SQLite.SQLiteConnection:Close () at HSPI_CONCORD.dbModule.updateTrackingTable () [0x00141] in :0 at HSPI_CONCORD.devModule.Timer1_Elapsed (System.Object sender, System.Timers.ElapsedEventArgs e) [0x0003b] in :0 ]
    Couple of things might cause this:
    Large number of log entries over a short period of time
    CPU is heavily loaded and can't keep up.

    The base problem is a race condition somewhere in the opening/closing of the SQL tracking database. Haven't ever tracked it down since it's so random/infrequent and restarting the PI usually makes it go away.

    Z

    Comment


    • #3
      Thanks vasrc. The reboot usually does the trick and as you say it's random and doesn't really have any effect on the system.

      Comment


      • #4
        Originally posted by concordseer View Post
        Thanks vasrc. The reboot usually does the trick and as you say it's random and doesn't really have any effect on the system.
        You shouldn't have to restart anything for it to stop, unless one of the conditions I mentioned previously is occurring. If you can replicate the problem and it's continuously reporting in the HS log (ie not just once every week/month or so), LMK and I'll have you gather some debug info to try and track it down.

        Z

        Comment


        • #5
          Originally posted by concordseer View Post
          Thanks vasrc. The reboot usually does the trick and as you say it's random and doesn't really have any effect on the system.
          Well this is timely. I just had several of these occur.
          Where there other errors listed in the log other than what you listed initially, specifically a "database Locked" error? If so, was there an OS update or a backup running at the same time?

          Thanks,
          Z

          Comment


          • #6
            Nothing unusual running in the background. No unscheduled updates as I'm running on a Raspberry PI3. I haven't been able to replicate the problem but I'm thinking it's a logging related issue too.

            I've always been a little suspicious of logging to an SD card owing to the possible deterioration of the card with all thatread/write activity.

            Comment


            • #7
              Ok I think I've tracked the error to x10 events. Immediately after three separate x10 events on tree different occasions that SQL error has appeared. I'm using a CM15 Pro (the Europeaan version of the CM15a) for x10. There hasn't been a recent update of the CM15a plugin as far as I'm aware and your last update of the Concord plugin was working fine up until now.

              I'm now wondering if the Events are causing the problem. My current version of HS3 is .318.

              Comment


              • #8
                Originally posted by concordseer View Post
                Ok I think I've tracked the error to x10 events. Immediately after three separate x10 events on tree different occasions that SQL error has appeared. I'm using a CM15 Pro (the Europeaan version of the CM15a) for x10. There hasn't been a recent update of the CM15a plugin as far as I'm aware and your last update of the Concord plugin was working fine up until now.

                I'm now wondering if the Events are causing the problem. My current version of HS3 is .318.
                I'm thinking it's a problem with the database being closed by another process. Let me look at the logging code to see if I can make it handle load/delay issues better.

                Z

                Comment


                • #9
                  Seems like the Concord plugin is having problems accessing the SQL databasse while another process is accessing it at the same time. Collision possibly. Does the Concord plugin have a way of dealing with this situation. Delayed read/write.

                  Comment


                  • #10
                    Originally posted by concordseer View Post
                    Seems like the Concord plugin is having problems accessing the SQL databasse while another process is accessing it at the same time. Collision possibly. Does the Concord plugin have a way of dealing with this situation. Delayed read/write.
                    Not exactly. I believe it's being closed by another routine before the logging routine can execute the write. All tracking data is written to an array/cache which is unspooled on a timer to minimize hitting the db too often. May just open the database on startup and close it on shutdown.

                    Z

                    Comment


                    • #11
                      Ok. Just another question for you. How much access does the virtual keypad have to the control panel. In other words which commands work/don't work from the virtual panel.

                      Comment


                      • #12
                        Originally posted by concordseer View Post
                        Ok. Just another question for you. How much access does the virtual keypad have to the control panel. In other words which commands work/don't work from the virtual panel.
                        Not sure what you mean by "how much access". The virtual keypad is just that, Virtual. It acts the same as a real keypad.

                        Z

                        Comment


                        • #13
                          Ok. It was just the note you have under the virtual keypad stating that "all commands may not work from this keypad"

                          The original post regarding the logging error is happening regularly now after each x10 event. Assuming the event is closing the SQLconnection and the Concord plugin cannot restart it.

                          Comment


                          • #14
                            Originally posted by concordseer View Post
                            Ok. It was just the note you have under the virtual keypad stating that "all commands may not work from this keypad"

                            The original post regarding the logging error is happening regularly now after each x10 event. Assuming the event is closing the SQLconnection and the Concord plugin cannot restart it.
                            The event doesn't have any access to the Concord PI, it's an internal problem.
                            Go to the Advanced Config page and turn on:
                            Log to CONCORD0.log and CONCORD2.log (Debug and Function/Sub)

                            Let it run through a couple failures, then turn off the debug and email them to me (you have my email already I believe)

                            Thanks,
                            Z

                            Comment


                            • #15
                              Originally posted by concordseer View Post
                              Ok. It was just the note you have under the virtual keypad stating that "all commands may not work from this keypad"

                              The original post regarding the logging error is happening regularly now after each x10 event. Assuming the event is closing the SQLconnection and the Concord plugin cannot restart it.
                              Also send me the loading on your PI (just enter "w" at the command prompt)
                              You can use "top" as well if you're familiar with that.

                              Are you leaving the Virtual keypad open all the time? It's a big resource hog.

                              Z

                              Comment

                              Working...
                              X