Announcement

Collapse
No announcement yet.

Plug-ins fail to initialize.

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

    Plug-ins fail to initialize.

    I have been fighting this for a week. I have a perfectly functional system running under windows 10 on a stand alone SuperMicro server

    I was going to do some maintenance on the server so I moved HS# back to a VM running Windows 10. I move HS3 by shutting it down and copying the entire directory structure to the backup machine. This VM is running under Hyper-v on a Windows Server 2012r2 machine. I have used this same VM in the past and was able to freely move the HS system back and forth between the physical machine and VM. I have done this between these same two machines dozens of times in the past, without issue. The last time I did this was about June last year.

    Now when I try to bring up HS3 on the VM, I get 1-3 plug-ins that fail to initialize. It is not always the same plug-ins, but at least 1 fails to initialize. In developer mode I captured this for the Arduino plug-in
    Code:
    Unhandled Exception: System.TypeInitializationException: The type initializer fo
    r 'HSPI_Arduino.Util' threw an exception. ---> System.Net.Sockets.SocketExceptio
    n: Only one usage of each socket address (protocol/network address/port) is norm
    ally permitted
       at System.Net.Sockets.Socket.DoBind(EndPoint endPointSnapshot, SocketAddress
    socketAddress)
       at System.Net.Sockets.Socket.Bind(EndPoint localEP)
       at System.Net.Sockets.UdpClient..ctor(Int32 port, AddressFamily family)
       at HSPI_Arduino.UDPboard..ctor()
       at HSPI_Arduino.Util..cctor()
       --- End of inner exception stack trace ---
       at HSPI_Arduino.Main.Main()
    I checked permissions, disabled UAC and disabled the firewall, always with the same results.

    I built a fresh VM, reinstalled HS3 and all of the plug-ins and tried again with the same result.

    I decided I would try to run it under FireDaemon Pro on the Windows Server 2012r2 and the results are the same. Again I installed HS3, all plug-ins, double checked UAC settings, permissions, etc. Then I started HS bare, without my data, configurations and scripts. All plug-ins loaded fine.

    As a last resort I tried to bring it up on the Server 2012 while logged in as a user - same results.

    I restored my original machine from the same files as I was trying to run on the VMs and server and it runs fine on it (Windows 10 stand alone).

    I am running fine on the original server, but have exhausted everything I can think of.

    Any ideas?
    HS4 Pro, 4.2.19.0 Windows 10 pro, Supermicro LP Xeon

    #2
    What are the differences related to .net?


    Sent from my iPhone using Tapatalk

    Comment


      #3
      It could be a licensing issue.
      💁‍♂️ Support & Customer Service 🙋‍♂️ Sales Questions 🛒 Shop HomeSeer Products

      Comment


        #4
        Originally posted by Kerat View Post
        What are the differences related to .net?


        Sent from my iPhone using Tapatalk
        Both VMs and the server have .net 3.5 and 4.5 on the Windows 10 machines .net 2.0 and 3.0 are included and on the server they are added features. Server Essentials relies heavily on.net for the dashboard and remote app functions. They all work fine.

        The second VM was a fresh install of Windows 10, a fresh install of all .net, a fresh install of HS3, a fresh install of all plug-ins.

        Understand that the first VM I went to was running HS3 in May of last year without issue, so it would seem to me it is something that changed in HS3 since then. This VM and the physical machine were alternated back and forth from May 2015 several dozen times until May of 2016.
        HS4 Pro, 4.2.19.0 Windows 10 pro, Supermicro LP Xeon

        Comment


          #5
          Originally posted by Rupp View Post
          It could be a licensing issue.
          I find it difficult to believe that, since it is a socket error that causes plug-ins to fail. It is not always the same plug-in either, it can be any 1 or more of the 30 plug-ins I am running. If I change the order the plug-ins are loaded, it will change the one or two that fail to initialize. The ones that fail are always among the last 10 loaded. Additionally on the management page all licenses are there and valid, with no licensing errors on the management page or in the log.

          The server has 64GB of RAM and a Xeon E3-1270 processor, the VMs had 8GB and 8 virtual cores assigned. The physical machine I run HS3 on daily is an E3-1230 with 8GB RAM running Windows 10 Pro.

          Lastly, I reinstalled HS3 and all the plug-ins fresh on the Server - it had never had HS3 or any plug-ins installed. I reinstalled all licenses on the fresh install (it was tedious and time consuming), but the problem persists on that installation as well.

          I will say that if there has been a change that prevents me from bringing up a computer, restored from a current backup of a running system, then there is no viable disaster recovery plan. The full directory restore is the only way to go, because the built in backup only backs up data, config and scripts folders, ignoring all of the databases and other configurations created in the bin and html directories by plug-ins.
          HS4 Pro, 4.2.19.0 Windows 10 pro, Supermicro LP Xeon

          Comment


            #6
            I removed 6 plug-ins, reducing the count to 25 and it starts just fine. I restored from my current backup again and removed 5 different plug-ins and it starts fine. This would indicate that it might be Port Exhaustion, but I don't understand why one machine is not affected, but the two VMs and the much more powerful server are.

            According to what I have found the socket error I get
            Code:
            System.Net.Sockets.SocketException: Only one usage of each socket address (protocol/network address/port) is normally permitted
            on plug-ins that fail to initialize, can indicate that sockets are not being released quickly enough. It is TCP/IP Port Exhaustion. I added a registry keyword "TcpTimedWaitDelay" with a value of 30 to "HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\Tcpip\ Parameters". This reduces the time before a port is released. None of the machines had this entry. It made no difference. Another registry dword under the same key is "MaxUserPort" which can be set from 5001 to 65534. It was already at the maximum on all three machines.
            HS4 Pro, 4.2.19.0 Windows 10 pro, Supermicro LP Xeon

            Comment


              #7
              The snippet you posted indicates this problem occurred on a UDP socket; note call to
              System.Net.Sockets.UdpClient..ctor(Int32 port, AddressFamily family)

              Is this issue limited to UDP connections?

              Comment


                #8
                Originally posted by zwolfpack View Post
                The snippet you posted indicates this problem occurred on a UDP socket; note call to
                System.Net.Sockets.UdpClient..ctor(Int32 port, AddressFamily family)

                Is this issue limited to UDP connections?
                I have not read all of the command windows as plug-ins fail, but the two or three different plug-ins that failed where I had it in Developer Mode had similar error messages, but for different plug-ins.

                It is also stone reliable with 25 plug-ins, but ALWAYS has at least one plug-in failing to initialize on startup if I run all 31. If I go in and disable/enable the failing plug-in after HomeSeer starts up it will initialize and work properly. The system will run properly after that, the problem only occurs on HS startup.

                On my primary HS server it works without issue with all 31 plug-ins. That server has not had a hiccup in a year. It has been shutdown and restarted frequently because I do a lot of testing for a couple of plug-in developers.
                HS4 Pro, 4.2.19.0 Windows 10 pro, Supermicro LP Xeon

                Comment


                  #9
                  It is strange alright. What are you running as a firewall? Try disabling that?

                  Comment


                    #10
                    Originally posted by zwolfpack View Post
                    It is strange alright. What are you running as a firewall? Try disabling that?
                    On the machines it is just Windows firewall, which I disabled. I also completely disabled UAC by editing the registry. The server doesn't run antivirus and the 2 VMs run Windows Defender, which I have also disabled.

                    The really puzzling thing is that the plug-ins will all run fine, if I restart the plug-in(s) that fail to initialize at startup. If it was a firewall or similar issue, I wouldn't see it working after a plug-in is restarted. I really, really think it is something that is not starting cleanly, but that doesn't explain why it all works fine on the original machine.

                    Since the problems occur on the WSE 2012r2 machine and the 2 VMs that are also running on the same platform, I am going to try another desktop computer tomorrow. I don't see how a problem in the server could trickle down to the VMs, but it is the only common denominator.
                    HS4 Pro, 4.2.19.0 Windows 10 pro, Supermicro LP Xeon

                    Comment


                      #11
                      Here's something I just saw that might help - not sure if you've seen this or not:
                      https://support.socketlabs.com/index...ally-permitted
                      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


                        #12
                        Originally posted by rmasonjr View Post
                        Here's something I just saw that might help - not sure if you've seen this or not:
                        https://support.socketlabs.com/index...ally-permitted
                        Thanks. I covered that in post #6 above. By default the MaxUserPort is already set to 65534 on all of my Windows 10 machines and the Server 2012. I did create the DWord for TcpTimedWaitDelay and set the value to 30, but it made no difference.

                        I am going to try to move HomeSeer to my desktop computer today, just to try different hardware.
                        HS4 Pro, 4.2.19.0 Windows 10 pro, Supermicro LP Xeon

                        Comment


                          #13
                          Ah, gotcha... Please do post back what you find.

                          This reminds me of the old unix days chasing down semaphores and file descriptors.
                          Those were always fun easter eggs (not).
                          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