Announcement

Collapse
No announcement yet.

Failing to Start on Linux (System.Device.dll) - fixed

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

    Failing to Start on Linux (System.Device.dll) - fixed

    Hello,

    Thank you very much for the great plugin! Couple of days ago, I had to restart HS because it was unresponsive. Ever since the restart, the Volvo Plugin is failing the start. When i first start the plugin, I see " CRITICAL: Disconnected before response received." message, followed by "CRITICAL: Error on InitIO: Could not load file or assembly 'System.Device, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089' or one of its dependencies.". I have attempted to restart HS, uninstall and reinstall the plugin. I am running HS 4.2.16.0. Any suggestions on how to resolve the issue?

    Here is the log output when plugin is starting:

    Queuing plugin Volvo Plugin to load...
    12:42:25:9809:[Plug-In]->Finished initializing plug-in Volvo Plugin
    If you see this console window and you wonder why, go to HS4 > Setup > tab General > uncheck Developer Mode and Save.
    Connecting to HomeSeer...
    12:42:26:0951:[Info]->BeforeReturnStatus called, returning state = Ok -
    Connected to HomeSeer
    Waiting for initialization...
    12:42:26:2279:[Info]->Plugin VolvoPlugin with instance Volvo Plugin has connected. IP:127.0.0.1:47846
    12:42:26:4142:[Starting Plug-In]->Initializing plugin Volvo Plugin ...
    12:42:26:6431:[Error]->Initializing plug-in(1): Volvo Plugin Instance::Error on InitIO: Could not load file or assembly 'System.Device, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089' or one of its dependencies. Time to load: 228 milliseconds
    Disconnecting from HomeSeer...
    Error SendInvokeResponse: Unable to write data to the transport connection: Cannot access a disposed object.
    Object name: 'System.Net.Sockets.Socket'..
    Disconnected from HomeSeer
    Stat parse exception: Value was either too large or too small for an Int16.
    Error in IsEXERunning: Can't find process with ID 0​

    #2
    There are a few things I'm thinking of:

    1. First thought was that the Volvo cloud has been unresponsive several times the past days. At least, the European server I'm connecting to. But in between it seems to be working, so that is probably not it. But just to rule it out, could you check the Log, filter From Volvo Plugin and share what it says (but redact your VIN if it's in there, for privacy reasons.

    2. It seems to have something to do with a function I use for the position of the car. Have you set up a location trigger? And if so, can you try to disable the event(s) with that trigger and then see if you can get the plugin started? Let me know and we'll go from there to see how to fix it. And/or can you check if the values in the latitude and longitude feature makes sense?

    3. Since your HS was unresponsive (Was it working at all?) and you had to restart it.. Did you get to shutdown gracefully? Your devices.json may have been damaged otherwise. Do you have a backup from before the restart and would it be an option for you to restore from that backup? (Or did you add device/features later and would it make you loose those?).
    Plugins I developed for HS4: Somfy Local, MiLight (LimitlessLED), Updates, Volvo (VoC), OpenTherm Gateway (OTGW)
    Running HS4 Pro on Windows 10 Pro on a Synology VM, with Node-RED running as a container.

    Comment


      #3
      Originally posted by Bernold View Post
      There are a few things I'm thinking of:

      1. First thought was that the Volvo cloud has been unresponsive several times the past days. At least, the European server I'm connecting to. But in between it seems to be working,
      so that is probably not it. But just to rule it out, could you check the Log, filter From Volvo Plugin and share what it says (but redact your VIN if it's in there, for privacy reasons.

      2. It seems to have something to do with a function I use for the position of the car. Have you set up a location trigger? And if so, can you try to disable the event(s) with that trigger and then see if you can get the plugin started? Let me know and we'll go from there to see how to fix it. And/or can you check if the values in the latitude and longitude feature makes sense?

      3. Since your HS was unresponsive (Was it working at all?) and you had to restart it.. Did you get to shutdown gracefully? Your devices.json may have been damaged otherwise. Do you have a backup from before the restart and would it be an option for you to restore from that backup? (Or did you add device/features later and would it make you loose those?).
      Thank you for your response, Bernold! Second bullet point was the reason. I was just experimenting with location triggers. I've removed the events that are based on location triggers, and the plugin started right up. Disabling the events was not enough.

      Now that we have identified the issue, would you like me to experiment with things?

      Comment


        #4
        Sorry you had to remove your events. I have actually experimented with position already this morning. I managed to make the plugin crash during startup, but only if I corrupted a trigger location (so bullet 2 and 3). But it did not give me the same kind of error as you got. Yet. I still think it's the right direction to look for a fix. I may have to add an extra check for values somewhere to check for corrupted data (There are already checks in place for trigger locations you can enter and the Volvo api *should* only return valid positions..).

        Can you check your trigger location by going to Add/Modify Location and then picking it from the dropdown in Step 2?
        Plugins I developed for HS4: Somfy Local, MiLight (LimitlessLED), Updates, Volvo (VoC), OpenTherm Gateway (OTGW)
        Running HS4 Pro on Windows 10 Pro on a Synology VM, with Node-RED running as a container.

        Comment


          #5
          More questions for you:

          - Are you running HS4 on Windows or Linux?

          - Did you (re)install other plugins after you had to do the restart?

          - Can you check if there is a file called System.Device.dll in your HS4 root folder, bin folder and/or html folder?
          Plugins I developed for HS4: Somfy Local, MiLight (LimitlessLED), Updates, Volvo (VoC), OpenTherm Gateway (OTGW)
          Running HS4 Pro on Windows 10 Pro on a Synology VM, with Node-RED running as a container.

          Comment


            #6
            I removed all locations, and re-added my Home location. I did use one of the “Trip Suggestion” entries because it identified the address correctly, and recreated the event.

            Click image for larger version

Name:	image.png
Views:	86
Size:	36.2 KB
ID:	1574391
            After saving the location trigger, I got a similar message right on the event itself. I cannot recall if I experienced this last time.

            - Are you running HS4 on Windows or Linux?

            - Did you (re)install other plugins after you had to do the restart?

            - Can you check if there is a file called System.Device.dll in your HS4 root folder, bin folder and/or html folder?
            - I am running HS4 on a Linux ( in a container )
            - I did not need to reinstall any other plugins after restart.( I only reinstalled Volvo thinking the force restart of the plugin may resolve the issue)
            - I did not locate System.Device.dll file in HS4 root, bin or html folders.
            Attached Files

            Comment


              #7
              Thanks for your answers. Meanwhile I did some googling. I found some related issues on this forum with a search like "CRITICAL: Error on InitIO: Could not load file or assembly​". They turn out to be problems with either .dll files being installed by plugins in folders (root, bin, html) where they break other plugins. OR the dll file is missing. Which makes sense, because the error says it can't be loaded. Therefor, could you please check if System.Device.dll is in its default location? If I googled correctly (I'm not a Linux pro) it should be in usr/lib/mono/4.6.2-api/ But that's assuming Mono matches .Net Framework versions, so maybe you'll find a folder with another version number. Please check if System.Device.dll is there. And if it's not - or it seems corrupted, 0 file size or anything - would you be able to reinstall Mono and/or copy the file from another container instance?
              Plugins I developed for HS4: Somfy Local, MiLight (LimitlessLED), Updates, Volvo (VoC), OpenTherm Gateway (OTGW)
              Running HS4 Pro on Windows 10 Pro on a Synology VM, with Node-RED running as a container.

              Comment


                #8
                New question: Did you just recently set up the location trigger? Until now I was assuming it was working before you had to restart. But have you ever actually seen it work? I'm asking because I tried the container and got the exact same error right after setting up the location trigger. System.Device.dll seems to be missing from Mono folders.
                Plugins I developed for HS4: Somfy Local, MiLight (LimitlessLED), Updates, Volvo (VoC), OpenTherm Gateway (OTGW)
                Running HS4 Pro on Windows 10 Pro on a Synology VM, with Node-RED running as a container.

                Comment


                  #9
                  Yes, I have just set a trigger for Home (the easiest one to test), but it never worked. When I first configured the event, I did not pay attention to the IF statement like I did the second time. So, it may have given a similar error, and probably I have not noticed it.

                  I have been looking at other mono images, but I can't seem to locate the System.Device.dll. I am going to see if I can find it somewhere. Worst case, I will get a VM up and see if i can just install HS there and grab the System.Device.dll file.

                  Comment


                    #10
                    I think I have the answer. When I googled I saw that the reference file would be there, but after more googling it does not seem it actually is. So in order to make it work on Linux I have to modify the part where I use System.Device. Which is just a small part and no big deal. I already figured out some replacing code. I just need to test it thoroughly to make sure it does the same as current code. I'm expecting to have some time for it on Friday. And then probably release it as a beta for you to test, before releasing it as an update. Thanks for confirming it never worked.
                    Plugins I developed for HS4: Somfy Local, MiLight (LimitlessLED), Updates, Volvo (VoC), OpenTherm Gateway (OTGW)
                    Running HS4 Pro on Windows 10 Pro on a Synology VM, with Node-RED running as a container.

                    Comment


                      #11
                      I just uploaded beta version 1.0.3.1. It's been tested in the Docker container. Let me know if that fixes it for you, too.
                      Plugins I developed for HS4: Somfy Local, MiLight (LimitlessLED), Updates, Volvo (VoC), OpenTherm Gateway (OTGW)
                      Running HS4 Pro on Windows 10 Pro on a Synology VM, with Node-RED running as a container.

                      Comment


                        #12
                        Thank you Bernold!. Do I need to download it from a separate location, or do I wait until the update shows on the plugins page?

                        Comment


                          #13
                          No special location. It's available from the updater (Add Plugin page) when you enable Show Beta Plugins.
                          Plugins I developed for HS4: Somfy Local, MiLight (LimitlessLED), Updates, Volvo (VoC), OpenTherm Gateway (OTGW)
                          Running HS4 Pro on Windows 10 Pro on a Synology VM, with Node-RED running as a container.

                          Comment


                            #14
                            I updated to the Beta plugin, added a location and created an event. The event saved successfully, and did not show any errors. The plugin also started without issues after creating an event. So far, so good! I'll provide feedback when the events fire (entering geofence and exiting geofence).

                            Comment


                              #15
                              Good to hear. Thanks for confirming. I felt pretty confident, so I also submitted it as release 1.0.4.0, with another minor fix. As soon as HomeSeer approves it, I will let it know here as well.
                              Plugins I developed for HS4: Somfy Local, MiLight (LimitlessLED), Updates, Volvo (VoC), OpenTherm Gateway (OTGW)
                              Running HS4 Pro on Windows 10 Pro on a Synology VM, with Node-RED running as a container.

                              Comment

                              Working...
                              X