portray icon indicating copy to clipboard operation
portray copied to clipboard

Portray should handle errors when starting the shell

Open radix opened this issue 6 years ago • 0 comments

OS: Windows 10 + WSL running Ubuntu Portray:

radix@DESKTOP-HOBTFB6:~/Juice/infrastructure$ portray version
Portray build info:

  Version:
  Git Commit:
  Build Time:
  Go Version:

so I guess I'm not sure which portray version, but I'm pretty sure it's 1.1.2.

Anyway, here's a session showing that often the first time I run portray switch, it silently fails to start a subshell.

Note that the very first line in my prompt is $PORTRAY_PROMPT (my PS1 is set to $PORTRAY_PROMPT\n...).

radix@DESKTOP-HOBTFB6:~/Juice/infrastructure$ portray auth
Using default profile default with AccountId XXXXXX and UserName chris.armstrong
Enter token: …...
Setting ENV VARS
Starting shell with Session in: 423681189101

XXXXXX:default
radix@DESKTOP-HOBTFB6:~/Juice/infrastructure$ portray switch -p dev
Found profile dev in config
No session cache found or cache expired. Assuming role ExternalAdmin in account YYYYYY
Setting ENV VARS
Starting shell with Session in: YYYYYY

Notice that in this next snippet, my prompt is still XXXXXX:default, so apparently starting the subshell failed.

XXXXXX:default
radix@DESKTOP-HOBTFB6:~/Juice/infrastructure$ portray switch -p dev
Found profile dev in config
Using cached session credentials
Session valid for 59m59s
Setting ENV VARS
Starting shell with Session in: YYYYYY

YYYYYY:ExternalAdmin:dev
radix@DESKTOP-HOBTFB6:~/Juice/infrastructure$

but when I ran it again, the subshell was started successfully.

Caveats: this is in a WSL environment in Windows 10, and this is the only environment I've noticed this behavior. However, it seems that portray is not doing error checking when starting the subshell. I don't have the time right now to set up a dev environment and submit a patch, so I just wanted to get this ticket filed.

radix avatar Sep 18 '18 18:09 radix