Repository navigation
Description
When executing the command DEBUG=1 scalingo apps:
[DEBUG]2022/09/28 14:04:06 [Regions] Get the list of regions to fill the cache
[DEBUG]2022/09/28 14:04:06 [API] POST https://auth.scalingo.com/v1/tokens/exchange
[DEBUG]2022/09/28 14:04:06 User Agent: Scalingo CLI v1.25.1
[DEBUG]2022/09/28 14:04:06 Headers: map[User-Agent:[Scalingo CLI v1.25.1]]
[DEBUG]2022/09/28 14:04:06 Params: map[]
[DEBUG]2022/09/28 14:04:07 Request ID: 25b4025f-c8d4-45d8-9af8-45927548f6da
[DEBUG]2022/09/28 14:04:07 Duration: 321.7573ms
[DEBUG]2022/09/28 14:04:07 [API] GET https://auth.scalingo.com/v1/regions?
[DEBUG]2022/09/28 14:04:07 User Agent: Scalingo CLI v1.25.1
[DEBUG]2022/09/28 14:04:07 Headers: map[User-Agent:[Scalingo CLI v1.25.1]]
[DEBUG]2022/09/28 14:04:07 Params: map[]
[DEBUG]2022/09/28 14:04:07 Request ID: 8d17bea5-d893-4057-891c-f3c9ae81e4fe
[DEBUG]2022/09/28 14:04:07 Duration: 145.8675ms
[DEBUG]2022/09/28 14:04:07 {"regions":[{"name":"osc-fr1","display_name":"Paris - Outscale","api":"https://api.osc-fr1.scalingo.com/","database_api":"https://db-api.osc-fr1.scalingo.com/","dashboard":"https://dashboard.scalingo.com/","ssh":"ssh.osc-fr1.scalingo.com:22","default":true}]}
Then it hangs forever. The execution of any command will actually hang except if the region name is explicitly mentioned with --region my-region.
If the cache already contains data, the CLI also hangs forever but the logs are:
[DEBUG]2022/06/23 18:22:21 [Regions] Use the cache
The second issue is that login does not work with the following error between the username being entered, and the prompt for the password:
! Fail to login (1/3): fail to read the password on stdin: The handle is invalid.
Reported to the Go team: golang/go#34612
This issue supersedes #734 and #735. SRE issue is SRE-573.
Customers impacted we need to contact when releasing the fix:
https://app.intercom.com/a/apps/w4oogu7s/inbox/inbox/3379738/conversations/12375700071636
https://app.intercom.com/a/inbox/w4oogu7s/inbox/shared/all/conversation/12375700080025
https://app.intercom.com/a/apps/w4oogu7s/inbox/inbox/3379738/conversations/12375700081105
https://app.intercom.com/a/inbox/w4oogu7s/inbox/shared/all/conversation/12375700072124
https://app.intercom.com/a/apps/w4oogu7s/inbox/inbox/all/conversations/12375700129807
https://app.intercom.com/a/inbox/w4oogu7s/inbox/shared/all/conversation/12375700403752
Activity
[-][Windows] Interacting with the regions cache hangs forever[/-][+][Windows] Interacting with the regions cache hangs forever + Impossible to read stdin[/+]EtienneM commentedon Oct 7, 2022
Cross post with the following issue: golang/go#34612 (comment)
We are facing the same issue but found out something slightly odd. First, we use the new
golang.org/x/termpackage rather thanx/crypto/ssh/terminalas mentioned in the title of this issue.We face the same issue as described in this issue in Git Bash. The code is here: https://github.com/Scalingo/cli/blob/master/term/password.go#L13
But if we run Git Bash from within the terminal tab of VS Code, we no longer face the same issue, everything works as expected.
Does anyone know what is the difference between Git Bash and Git Bash inside VS Code?
I uploaded the smallest example which reproduces the issue here: https://github.com/EtienneM/mwe_read_password/blob/master/main.go
I'm not exactly sure about what information may be needed. My OS version:
The Go version:
The
golang.org/x/termversion is:With this example, in Git Bash in VS Code I can type a password and the output is:
In Git Bash outside of VS Code, I can't type the password and immediately get the error:
Barokai commentedon Nov 4, 2022
Having the same issue on Windows 11, with PowerShell 7.2.7 and cmd.exe in Windows Terminal.
Using Scalingo Client version 1.26.0
EtienneM commentedon Dec 1, 2022
A workaround could be to disable the regions cache on Windows.
yanjost commentedon Jul 27, 2023
Still hangs with version 1.29.1 in Git Bash on Windows.
Authentication via SSH keys, so I think terminal interaction is to exclude as source of the issue
Given workaround (passing region as parameter is working)
yanjost commentedon Jul 27, 2023
IMHO it's related to trying to write the cache file. The code seems to hang when trying to store a file in the user home directory
Maybe related to Windows security, which is quite paranoid with the access rights on user directories
I would sugget using os.UserHomeDir() and os.UserCacheDir() to get the right paths to write to