5 Replies Latest reply on Aug 4, 2017 3:26 PM by intercap

    Pi Web Api connection forcibly closed by remote host

    intercap

      Hi:

       

      We have an application that uses Pi Web Api to download data from Pi. The application was working fine until 7/28. On 7/29 the remote host began forcibly closing the connection. We have not been able to identify any configuration changes, and there have been no software changes. I do not see any errors in the Pi message log.

       

      Does anyone know where else we should look, or have any suggestions?

        • Re: Pi Web Api connection forcibly closed by remote host
          rsun

          Hi Keith,

          Could you use a web browser (Chrome or IE) to try to see if you are able to get something from PI Web API by typing the following URL https://<<PI Web API Machine FQDN>>/piwebapi

          Thanks,

          Ricky

            • Re: Pi Web Api connection forcibly closed by remote host
              intercap

              Hi Ricky:

               

              It connects. I should have specified, I used this test to verify that passwords and/or user names had not changed.

                • Re: Pi Web Api connection forcibly closed by remote host
                  rsun

                  Hi Keith,

                  Are you able to GET data from the PI Server and POST data to the PI Server? If there is nothing wrong, I would suspect there is network issue. Try to look at the Applications and Service Log in event viewer with PIWebAPI/Admin. Do you see exception there?

                  Thanks,

                  Ricky

                  • Re: Pi Web Api connection forcibly closed by remote host
                    gregor

                    Hello Keith,

                     

                    I see that you have an open case with OSIsoft Technical Support for your issue with PI Web API. Because troubleshooting of connection issues usually involves exchanging log files for review, Technical Support is likely the better resource to work with.

                     

                    I did some Internet research since "An existing connection was forcibly closed by the remote host" looked pretty familiar to me. I was not able to find a corresponding HTTP error code which is indicating to me that the error isn't thrown by PI Web API. Hence I doubt you will see evidence what's causing this in the PI Web API logs but checking them cannot harm. Searching the internet for the error text (enclosed into double quotes) returns some discussions suggesting the issue is with the connections socket. A common reason for the message is when the Windows firewall rejects an incoming connection because of active rules. Well, this would be something to rule out when you can connect using a browser from the same client machine. On the other hand, by disabling the firewall on the server and client for a minute you would be able to quickly confirm the issue is due to firewall settings or not.

                     

                    A more conservative approach is looking into some details of your setup first:

                    • Server OS and version?
                    • Client OS and version?
                    • PI Web API version?
                    • How is your client application supposed to authenticate?
                    • I understand your application is just reading. Is it logging the queries to a file, so you could pick them and test them in a browser? If you do so on the client application host, does the query succeed or fail in the browser?
                    • What are the supported authentication methods?
                    • What authentication method(s) is/are enabled?
                    • Is there a specific account used by your application e.g. for Basic authentication. Can you verify the account password is still valid?
                    • Are you operating in a domain environment? If so, are PI Web API host and client member of the same domain?
                    • Is the PI Web API server service running?
                    • Is PI Web API set up with a service account? If so, has the password potentially expired?
                    • ...
                • Re: Pi Web Api connection forcibly closed by remote host
                  intercap

                  The issue turned out to be that the certificate used by the Pi Web API server had expired. We'll improve the logging and fault tolerance in our application to better handle this in the future.

                  1 of 1 people found this helpful