/usr/bin/env no such file or directory

terminal
rstudioserver

#1

Hi there we are having an issue with the terminal button via web browser.

When opening the terminal it briefly shows the: "/usr/bin/env No such file or directory"

When connecting to the server via ssh the notification doesn't appear. We changed our /home to a new partition and I think this might the problem cause it was running before.

Any idea how to fix this?


#2

I think the key here will be to trace differences in startup from both places.

Is the terinal in RStudio working at all, or does starting the terminal fail? You can do some exploration of the startup configuration files (.bashrc, .Rprofile, and the like). There is an article on R's startup that may be useful here:

If the terminal in RStudio is working, you can also navigate to / try to execute /usr/bin/env and see what the permissions are on the file ls -lha /usr/bin/env. Executing which env may be helpful as well. Lots of random debugging here that may be helpful!


#3

R seems to work. I just can't use the terminal via web browser. The error pop ups and the state is "busy" for a millisecond. the window is blank
The rights are:
-rwxr-xr-x 1 root root 31K Feb 22 2017 /usr/bin/env
which env gives out -> /usr/bin/env
Everything seems "normal"


#4

Did you read the article I mentioned? If /usr/bin/env is not able to be executed from R, then there is some difference in the two environments that you need to nail down.

Since the terminal is not working, you could always explore the environment through R with things like:

system("ls -lha /usr/bin/env")
system("id")
system("/usr/bin/env")
Sys.getenv()

Then determining the differences (and where they are originating from) will amount to comparing the two environments (comparing environment variables is a good place to start) and tracking down the startup differences (i.e. by looking at files like .Rprofile, RProfile.site, etc.).

Another important factor - are all users experiencing this issue or is it only your user? If only one user, I would focus on user-specific bash / R profiles. If system-wide, then you would probably be looking at system configuration and system startup files.


#5

rsession-no-profile=1 was the problem