PatrickLang / logslurp

This is a development tool to collect logs from Windows Kubernetes nodes deployed with acs-engine
5 stars 5 forks source link

PowerShell hanging disconnecting #3

Open PatrickLang opened 6 years ago

PatrickLang commented 6 years ago

PowerShell seems to be hanging trying to close remote sessions. I tried manually adding a Remove-PSSession line but that hangs.

https://github.com/PatrickLang/logslurp/blob/6c03734c4c81e585e49da07ab09f20514bb91068/logslurp.ps1#L45

$ docker run -i -t -v ~/.kube/config:/root/.kube/config -v $PWD:/opt/k/out logslurp

PowerShell credential request
Please enter an admin username & password to connect to the Windows nodes
User: azureuser
Password for user azureuser: ************

Connected to 13955k8s9000
Log "System" could not be read to completion due to the following error. This may have occurred because the log was cleared while still being read. Index 3
173 is out of bounds.
+ CategoryInfo          : ReadError: (:) [Get-EventLog], ArgumentException
+ FullyQualifiedErrorId : LogReadError,Microsoft.PowerShell.Commands.GetEventLogCommand
+ PSComputerName        : 13955k8s9000
File c:\k\debug\dumpVfpPolicies.ps1 already exists.
File c:\k\debug\hns.psm1 already exists.
File c:\k\debug\startpacketcapture.cmd already exists.
File c:\k\debug\stoppacketcapture.cmd already exists.
WARNING: The names of some imported commands from the module 'hns' include unapproved verbs that might make them less discoverable. To find the commands wi
th unapproved verbs, run the Import-Module command again with the Verbose parameter. For a list of approved verbs, type Get-Verb.
C:\k\debug\r1a2yxkz.b2c
File c:\k\debug\VFP.psm1 already exists.
Logs are available at C:\k\debug\r1a2yxkz.b2c
Compressing all logs to 13955k8s9000-20180803-123307_logs.zip
Copying out logs
Done with 13955k8s9000
Connected to 13955k8s9001
Log "System" could not be read to completion due to the following error. This may have occurred because the log was cleared while still being read. Index 4
34 is out of bounds.
+ CategoryInfo          : ReadError: (:) [Get-EventLog], ArgumentException
+ FullyQualifiedErrorId : LogReadError,Microsoft.PowerShell.Commands.GetEventLogCommand
+ PSComputerName        : 13955k8s9001
File c:\k\debug\dumpVfpPolicies.ps1 already exists.
File c:\k\debug\hns.psm1 already exists.
File c:\k\debug\startpacketcapture.cmd already exists.
File c:\k\debug\stoppacketcapture.cmd already exists.
WARNING: The names of some imported commands from the module 'hns' include unapproved verbs that might make them less discoverable. To find the commands wi
th unapproved verbs, run the Import-Module command again with the Verbose parameter. For a list of approved verbs, type Get-Verb.
C:\k\debug\no1rdnts.aah
File c:\k\debug\VFP.psm1 already exists.
Logs are available at C:\k\debug\no1rdnts.aah
Compressing all logs to 13955k8s9001-20180803-123320_logs.zip
Copying out logs
Done with 13955k8s9001

Workaround for now is ctrl-p, ctrl-q to detach from the container, then manually stop it. The log ZIPs are still intact.