You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When the Chocolatey server host is sitting behind a forwarded port, it may fail to access the install.ps1 script. When turning on more logging you would see the following error
<Error><Message>An error has occurred.</Message><ExceptionMessage>Unable to connect to the remote server</ExceptionMessage><ExceptionType>System.Net.WebException</ExceptionType><StackTrace> at System.Net.WebClient.DownloadDataInternal(Uri address, WebRequest& request)
at System.Net.WebClient.DownloadString(Uri address)
at System.Net.WebClient.DownloadString(String address)
at SimpleChocolateyServer.Contollers.InstallController.DownloadPowerShellInstallScript()
at lambda_method(Closure , Object , Object[] )
at System.Web.Http.Controllers.ReflectedHttpActionDescriptor.ActionExecutor.<>c__DisplayClass10.<GetExecutor>b__9(Object instance, Object[] methodParameters)
at System.Web.Http.Controllers.ReflectedHttpActionDescriptor.ActionExecutor.Execute(Object instance, Object[] arguments)
at System.Web.Http.Controllers.ReflectedHttpActionDescriptor.ExecuteAsync(HttpControllerContext controllerContext, IDictionary`2 arguments, CancellationToken cancellationToken)
--- End of stack trace from previous location where exception was thrown ---
at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
at System.Web.Http.Controllers.ApiControllerActionInvoker.<InvokeActionAsyncCore>d__0.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
at System.Web.Http.Controllers.ActionFilterResult.<ExecuteAsync>d__2.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
at System.Web.Http.Dispatcher.HttpControllerDispatcher.<SendAsync>d__1.MoveNext()</StackTrace><InnerException><Message>An error has occurred.</Message><ExceptionMessage>No connection could be made because the target machine actively refused it 127.0.0.1:8080</ExceptionMessage><ExceptionType>System.Net.Sockets.SocketException</ExceptionType><StackTrace> 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)</StackTrace></InnerException></Error>
A simple example of this is if Choco server is on a Virtualbox where port 80 is forwarded to port 8080 on the VB host. I would access the Chocolatey URL with http://127.0.0.1:8080/install.ps1 and the code would then try and access http://127.0.0.1:8080/chocolatey/Packages()?$filter=((Id%20eq%20%27chocolatey%27)%20and%20(not%20IsPrerelease))%20and%20IsLatestVersion which may not be valid on that actual host. This is a pretty niche case but I thought it best to add an issue about it.
The text was updated successfully, but these errors were encountered:
When the Chocolatey server host is sitting behind a forwarded port, it may fail to access the
install.ps1
script. When turning on more logging you would see the following errorThis is due to the code at https://github.com/chocolatey/simple-server/blob/master/src/SimpleChocolateyServer/Controllers/InstallController.cs#L44 where the IIS service tries to access itself using the URL the client used. In the case of a forwarded port, this may not be a valid URL service side.
A simple example of this is if Choco server is on a Virtualbox where port
80
is forwarded to port8080
on the VB host. I would access the Chocolatey URL withhttp://127.0.0.1:8080/install.ps1
and the code would then try and accesshttp://127.0.0.1:8080/chocolatey/Packages()?$filter=((Id%20eq%20%27chocolatey%27)%20and%20(not%20IsPrerelease))%20and%20IsLatestVersion
which may not be valid on that actual host. This is a pretty niche case but I thought it best to add an issue about it.The text was updated successfully, but these errors were encountered: