Skip to content
This repository was archived by the owner on Dec 8, 2021. It is now read-only.
This repository was archived by the owner on Dec 8, 2021. It is now read-only.

Polaris http requests hang when retrieved from client #177

Closed
@suglasp

Description

@suglasp

Polaris Bug Report

Description of the bug

Running Powershell Core 6.1.1 on CentOS Linux ("CentOS Linux release 7.6.1810 (Core)")
Installed powershell core from ms repo and did a Install-Module Polaris.
Eventually after running into problems, started off to Install-Module -Scope CurrentUser Polaris for debugging and troubleshooting.
Tested same problem with v0.1.0 and 0.2.0 module versions.


A clear and concise description of what the bug is.

Steps to reproduce

SSH Session #1:
Import-Module Polaris
New-PolarisGetRoute -Path '/helloworld' -Scriptblock { $Response.Send("Hi"); return }
Stop-Polaris; Start-Polaris -Port 8080

SSH Session #2:
Invoke-RestMethod -Method GET -Uri http://machine:8080/helloworld -Verbose
VERBOSE: GET http://machine:8080/helloworld with 0-byte payload
--> // hangs here

SSH Session #1:
had to stop-polaris. Got no response at all in Browser or in session #2

So went troubleshooting. Seems in first place the $Polaris.Log() statements are blocking the I/O.
SSH Session #1:
$env:PSModulePath
/username/.local/share/powershell/Modules:/usr/local/share/powershell/Modules:/opt/microsoft/powershell/6/Modules
cd /usr/local/share/powershell/Modules/Polaris/0.2.0/lib
edited file Polaris.Class.ps1 and commented all line statements with "$Polaris.Log(" ...

Stop-Palaris
Remove-Module Polaris
Remove-Module Polaris.Class
Import-Module Polaris
New-PolarisGetRoute -Path '/helloworld' -Scriptblock { $Response.Send("Hi"); return } -Force
Start-Polaris -Port 8080

SSH Session #2:
Invoke-RestMethod -Method GET -Uri http://machine:8080/helloworld -Verbose
VERBOSE: GET http://machine:8080/helloworld with 0-byte payload
--> // hangs here (again)

Now, when i go to session #2 and do Stop-Polaris or Ctrl+C then it gives response in session #2:
VERBOSE: received 2-byte response of content type text/plain
VERBOSE: Content encoding: iso-8859-1

Expected behavior

Return me a value instant

Add any other context about the problem here.

Version Information

tested behaviour with Polaris v0.1.0 and v0.2.0


NameVersion
Polaris0.2.0
WSManStackVersionPSVersionPSEditionPSCompatibleVersionsPlatformGitCommitIdOSPSRemotingProtocolVersionSerializationVersion
3.06.1.1Core1.0.-1.-1, 2.0.-1.-1, 3.0.-1.-1, 4.0.-1.-1, 5.0.-1.-1, 5.1.10032.0, 6.1.1.-1Unix6.1.1Linux 3.10.0-957.1.3.el7.x86_64 #1 SMP Thu Nov 29 14:49:43 UTC 20182.31.1.0.1

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions