Question
SocketException while publishing to package server.
I have installed PackageServer on a local machine (Machine A), and have been trying to publish a package from DevStudio (on Machine B).
I am getting a SocketException, with MachineA refusing the connection.
Machine A: Win10, PackageServer version 3.1.3.0
Machine B: Win7, Dev Studio version 19.1.49.0
The ping from Machine B to Machine A, and vice versa is successful.
The error log is as follows:
-----------------------------------------------------------------------------------------------------------------
DEBUG | 2020-07-20 17:45:52,266 | 1 | 1 | 4844 | STA | Shell | | | Project 'Trial\Trial.osproj' build state changing to Default and status of True DEBUG | 2020-07-20 17:45:52,329 | 1 | 1 | 4844 | STA | Listener | | | Resolver: assembly 'Trial' is loaded successfully INFO | 2020-07-20 17:45:52,531 | 1 | 1 | 4844 | STA | UI Connectors | | | ExpressTranslatorService.ProjectAssemblyRefreshed() - Notified of assemby refresh. DEBUG | 2020-07-20 17:45:52,547 | 1 | 1 | 4844 | STA | Shell | | | Build state changing to Default DEBUG | 2020-07-20 17:45:52,578 | 1 | 1 | 4844 | STA | OSS | | | PackageServerClient.DeployPackageToServer: Executing request 'http://10.35.187.65:5000/api/v1/packages/8D82CC0F33729AE/1.8'. ERROR | 2020-07-20 17:45:53,842 | 1 | 1 | 4844 | STA | OSS | | | PackageServerClient.DeployPackageToServer: Error uploading package to Package Server. ERROR | 2020-07-20 17:45:53,873 | 1 | 1 | 4844 | STA | Exception | | | Unable to connect to the remote server, Verbose Message: General Information
Diagnostic Info: Diagnostic.MachineName: CLTT282 Diagnostic.FullName: OpenSpan, Version=19.1.0.0, Culture=neutral, PublicKeyToken=f5db91edc02d8c5e Diagnostic.AppDomainName: DefaultDomain Diagnostic.WindowsIdentity: RL\8027826 Diagnostic.ApplicationName: OpenSpan.Studio.Shell
Exception Information
1) Exception Information ********************************************* Exception Type: System.Net.WebException Status: ConnectFailure Response: NULL Message: "Unable to connect to the remote server" Data: IDictionary (System.Collections.ListDictionaryInternal) with 0 items TargetSite: System.IO.Stream GetRequestStream(System.Net.TransportContext ByRef) HelpLink: NULL Source: "System" HResult: -2146233079
StackTrace Information ********************************************* at System.Net.HttpWebRequest.GetRequestStream(TransportContext& context) at System.Net.HttpWebRequest.GetRequestStream() at OpenSpan.Server.Clients.RESTTransfer.ExecuteUploadRequestToPackageServer(String url, String acceptType, String packageFileParamName, String packageFileName, Byte[] packageBinary, String configFileParamName, String configFileExtension, NameValueCollection configFiles, NameValueCollection configNames) at OpenSpan.Server.Client.Services.PackageServerClient.DeployPackageToServer(Byte[] packageBinary, NameValueCollection configFiles, NameValueCollection configNames, Exception& exception, String& errorMessage)
2) Exception Information ********************************************* Exception Type: System.Net.Sockets.SocketException ErrorCode: 10061 Message: "対象のコンピューターによって拒否されたため、接続できませんでした。 10.35.187.65:5000" SocketErrorCode: ConnectionRefused NativeErrorCode: 10061 Data: IDictionary (System.Collections.ListDictionaryInternal) with 0 items TargetSite: Void DoConnect(System.Net.EndPoint, System.Net.SocketAddress) HelpLink: NULL Source: "System" HResult: -2147467259
StackTrace Information ********************************************* at System.Net.Sockets.Socket.DoConnect(EndPoint endPointSnapshot, SocketAddress socketAddress) at System.Net.ServicePoint.ConnectSocketInternal(Boolean connectFailure, Socket s4, Socket s6, Socket& socket, IPAddress& address, ConnectSocketState state, IAsyncResult asyncResult, Exception& exception) ERROR | 2020-07-20 17:45:53,889 | 1 | 1 | 4844 | STA | OSS | | | Error publishing package to Pega Server ERROR | 2020-07-20 17:45:53,904 | 1 | 1 | 4844 | STA | Exception | | | Unable to connect to the remote server, Verbose Message: General Information
Diagnostic Info: Diagnostic.MachineName: CLTT282 Diagnostic.FullName: OpenSpan, Version=19.1.0.0, Culture=neutral, PublicKeyToken=f5db91edc02d8c5e Diagnostic.AppDomainName: DefaultDomain Diagnostic.WindowsIdentity: RL\8027826 Diagnostic.ApplicationName: OpenSpan.Studio.Shell
Exception Information
1) Exception Information ********************************************* Exception Type: System.ApplicationException Message: "Unable to connect to the remote server" Data: IDictionary (System.Collections.ListDictionaryInternal) with 0 items TargetSite: Void PublishPackageToManagementConsole(System.String, Byte[], System.Collections.Generic.List`1[OpenSpan.Studio.Solution.DesignProject+DeploymentProfile], System.String) HelpLink: NULL Source: "OpenSpan.Studio" HResult: -2146232832
StackTrace Information ********************************************* at OpenSpan.Studio.Solution.DesignProject.PublishPackageToManagementConsole(String packageName, Byte[] packageData, List`1 profiles, String packageComment)
2) Exception Information ********************************************* Exception Type: System.Net.WebException Status: ConnectFailure Response: NULL Message: "Unable to connect to the remote server" Data: IDictionary (System.Collections.ListDictionaryInternal) with 0 items TargetSite: System.IO.Stream GetRequestStream(System.Net.TransportContext ByRef) HelpLink: NULL Source: "System" HResult: -2146233079
StackTrace Information ********************************************* at System.Net.HttpWebRequest.GetRequestStream(TransportContext& context) at System.Net.HttpWebRequest.GetRequestStream() at OpenSpan.Server.Clients.RESTTransfer.ExecuteUploadRequestToPackageServer(String url, String acceptType, String packageFileParamName, String packageFileName, Byte[] packageBinary, String configFileParamName, String configFileExtension, NameValueCollection configFiles, NameValueCollection configNames) at OpenSpan.Server.Client.Services.PackageServerClient.DeployPackageToServer(Byte[] packageBinary, NameValueCollection configFiles, NameValueCollection configNames, Exception& exception, String& errorMessage)
3) Exception Information ********************************************* Exception Type: System.Net.Sockets.SocketException ErrorCode: 10061 Message: "対象のコンピューターによって拒否されたため、接続できませんでした。 10.35.187.65:5000" SocketErrorCode: ConnectionRefused NativeErrorCode: 10061 Data: IDictionary (System.Collections.ListDictionaryInternal) with 0 items TargetSite: Void DoConnect(System.Net.EndPoint, System.Net.SocketAddress) HelpLink: NULL Source: "System" HResult: -2147467259
StackTrace Information ********************************************* at System.Net.Sockets.Socket.DoConnect(EndPoint endPointSnapshot, SocketAddress socketAddress) at System.Net.ServicePoint.ConnectSocketInternal(Boolean connectFailure, Socket s4, Socket s6, Socket& socket, IPAddress& address, ConnectSocketState state, IAsyncResult asyncResult, Exception& exception)
-----------------------------------------------------------------------------------------------------------------
What could be the problem?
Another thing, the installation guide for PackageServer says the following:
Before you begin • If it is not already installed, install the Microsoft .NET Core 2.2.3 Runtime and Hosting Bundle for Windows. This software is included in the download. • If it is not already present, add the SSL certificate to the Local Machine, and place the certificate in either the Personal or Web Hosting certificate store.
I think since I am using plain http it should work fine even if I haven't added the SSL certificate, or am I wrong in here?
I think in your case, the issue is likely a firewall restriction between machines. If you want to test the connection, open Chrome (or any non IE browser) and enter the address for your PackageServer in your browser URL. Add the following to the end; /api/v1/packages. That should load a page with a list of the packages on the server (yours will of course be empty). If the page doesn't load, something is blocking you from accessing it from your remote machine (either the local firewall, or the one on your package server).
In your case, the URL would be;
http://10.35.187.65:5000/api/v1/packages