PowerShell / Polaris

A cross-platform, minimalist web framework for PowerShell
https://powershell.github.io/Polaris/
MIT License
512 stars 114 forks source link

Error Starting Polaris in a Nano Docker Container #124

Closed jeremymcgee73 closed 6 years ago

jeremymcgee73 commented 6 years ago

I am getting an error when I try to Start Polaris in a nano docker container. I believe the issue is because the RequestQueue property is not set when a HttpListener object is created. I'm not sure if this is a bug with the nano powershell build, corefx, or Polaris. I do not believe it is a Polaris bug, because when I create the object in the console of the container, the parameter is still missing. I have included a couple screenshots below. I have created a repo for the docker image I was testing with. Docker Repo

The property 'RequestQueue' cannot be found on this object. Verify that the property exists and can be set.
At C:\temp\Polaris\lib\Polaris.Class.ps1:250 char:13
+             $this.Listener.TimeoutManager.RequestQueue = [timespan]:: ...
+             ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo          : InvalidOperation: (:) [], RuntimeException
+ FullyQualifiedErrorId : PropertyNotFound

TimeOutManager

PolarisError

Tiberriver256 commented 6 years ago

Thanks for posting up the issue and the Docker repo. I don't believe the timeoutmanager was ever added to the .net core version of HttpListener. My logic for using it was a bit flawed.

@tylerl0706 - Do you know if it's easy to add a nano image to run our tests in?

Tiberriver256 commented 6 years ago

Once Tyler clears me on this one it should be available for testing - @jeremymcgee73

TylerLeonhardt commented 6 years ago

It is done 🎉

@Tiberriver256 PM me about nano server when you get a chance :)

jeremymcgee73 commented 6 years ago

Thanks for fixing that issue! I'm getting another error now. I believe it has something to do with windows networking in docker. I'm going to see if I can fix it.. Should I close this issue and open another?

Exception calling "Start" with "0" argument(s): "Cannot access a disposed object.
Object name: 'System.Net.HttpListener'."
At C:\temp\Polaris\lib\Polaris.Class.ps1:256 char:9
+         $this.Listener.Start()
+         ~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo          : NotSpecified: (:) [], MethodInvocationException
+ FullyQualifiedErrorId : ObjectDisposedException
Tiberriver256 commented 6 years ago

Cool! Yes, please it helps to have them tracked separately and an accurate title.