Closed datakurre closed 2 years ago
@datakurre
Can you share how you are setting up that chroot shell, so that we are able to repeat this. And I hope it does not require nix environment.
Could you also try to give path to robot.yaml from commandline: rcc task shell --robot path/to/robot.yaml
and see if that makes difference?
Other thing to try out is this: https://github.com/robocorp/rcc/blob/master/docs/recipes.md#how-to-activate-holotree-environment
@vjmp
Thanks for the tips!
There's too much nix in the chroot sandbox, but rcc holotree variables
did show the reason for broken shell:
$ rcc holotree variables --space mine /home/vagrant/Desktop/RCC/conda.yaml
export PYTHON_EXE=/home/vagrant/.robocorp/holotree/72de99c_5a1fac3_0404cee4/bin/python3
export CONDA_DEFAULT_ENV=rcc
export CONDA_PREFIX=/home/vagrant/.robocorp/holotree/72de99c_5a1fac3_0404cee4
export CONDA_PROMPT_MODIFIER=(rcc)
export CONDA_SHLVL=1
export PYTHONHOME=
export PYTHONSTARTUP=
export PYTHONEXECUTABLE=
export VIRTUAL_ENV=/home/vagrant/.robocorp/holotree/72de99c_5a1fac3_0404cee4
export PYTHONNOUSERSITE=1
export PYTHONDONTWRITEBYTECODE=x
export PYTHONPYCACHEPREFIX=/home/vagrant/.robocorp/temp/4d65822107fc5f74
export ROBOCORP_HOME=/home/vagrant/.robocorp
export RCC_ENVIRONMENT_HASH=fed4177fee2e86eb
export RCC_INSTALLATION_ID=686dfaed-eeab-527e-f8d0-c5dbc70a9d2e
export RCC_TRACKING_ALLOWED=false
export RCC_EXE=/nix/store/2i789311n1z5rnazand7zavxkbg6p78n-rcc-v11.25.0/bin/rcc
export RCC_VERSION=v11.25.0
export TEMP=/home/vagrant/.robocorp/temp/4d65822107fc5f74
export TMP=/home/vagrant/.robocorp/temp/4d65822107fc5f74
export PATH=/home/vagrant/.robocorp/holotree/72de99c_5a1fac3_0404cee4/bin:/run/wrappers/bin:/usr/bin:/usr/sbin:/run/wrappers/bin:/home/vagrant/.nix-profile/bin:/etc/profiles/per-user/vagrant/bin:/nix/var/nix/profiles/default/bin:/run/current-system/sw/bin
export PS1=
export SHLVL=4
export _=/nix/store/4s1mmhh1bznfhrpsyg17pl5ddbww57xl-rcc-v11.25.0/bin/rcc
export CONDA_BACKUP_GOROOT=
export GOROOT=/home/vagrant/.robocorp/holotree/72de99c_5a1fac3_0404cee4/go
export MAMBA_ROOT_PREFIX=/home/vagrant/.robocorp
export MAMBA_SSL_VERIFY=false
export PATH=/home/vagrant/Desktop/RCC/bin:/home/vagrant/.robocorp/holotree/72de99c_5a1fac3_0404cee4/bin:/run/wrappers/bin:/usr/bin:/usr/sbin:/run/wrappers/bin:/home/vagrant/.nix-profile/bin:/etc/profiles/per-user/vagrant/bin:/nix/var/nix/profiles/default/bin:/run/current-system/sw/bin
export PYTHONPATH=
export ROBOT_ROOT=/home/vagrant/Desktop/RCC
export ROBOT_ARTIFACTS=/home/vagrant/Desktop/RCC/output
The shell is broken, because of line export PS1=
even that variable is not empty in the parent shell calling RCC. I'm not sure, where RCC inherits that from, but if I patch RCC to set PS1 to any value, shell starts working.
I can now patch this to work for me, and can close this issue.
I have no idea, where go gets that PS1=
, but feel free to re-open, if you want to try to figure that out.
Oh, it is coming from the holotree
$ cat /home/vagrant/.robocorp/holotree/72de99c_5a1fac3_0404cee4/rcc_activate.json
{
"CONDA_BACKUP_GOROOT": "",
"GOROOT": "/home/vagrant/.robocorp/holotree/72de99c_5a1fac3_0404cee4/go",
"MAMBA_ROOT_PREFIX": "/home/vagrant/.robocorp",
"PS1": "",
"SHLVL": "4",
"_": "/nix/store/4s1mmhh1bznfhrpsyg17pl5ddbww57xl-rcc-v11.25.0/bin/rcc"
}
@datakurre
If it is that, then that is coming from some dependency, that is setting it. What does your conda.yaml looks like?
That rcc_activate.json
is just "diff" of "vanilla" and activated environment ... (the addition ...)
@vjmp
The content of conda.yaml
does not seem to matter.
I tried to debug the creation of rcc_activate.json
:
PS1
is present at the captured output before the activationPS1
is no longer present at the capture output after the activationPS1
by setting it to empty string in rcc_activate.json
, breaking shellAnd the difference in 1. and 2. is probably because 2. is generated through a rcc_activate.sh
script, and bash may not export PS1 in non-interactive shell like scripts.
I can "reproduce" this myself with my bash by echo $PS1
echoing from prompt, but not from a script (unlike other exported environment variables, which always echo).
But why, oh why, this happens only on my bash + rcc :flushed:
(But as said, I have now patched this for myself š)
@vjmp You were correct. I just misinterpreted emptied PS1= environment variable as broken shell. I retried now, and shell was properly activated. Just with empty prompt. I thought it was broken, because empty enter` did not add new line, but never tried entering commands :see_no_evil:
Thanks again.
I don't believe that this is a bug in RCC, but a glitch caused by my environment.
I have a reason to run RCC in a chroot based sandbox. While everything else I haved tried so far has been working (e.g. even a Firefox installed by RCC in a robot execution works), interactive shell does not.
Executes shell, but without input or output.
Effectively, the command waits until shell process gets killed from the outside.
Running the same shell command manually outside RCC works.
Any tips, how to debug this more and get RCC shell to work in my weird environment? For example, maybe my chroot based env is just missing some environment variables required for interactive shell through RCC.