Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

SSH Remote fails on the remote connection if the noclobber shell option is set #4240

Closed
cwwalter opened this issue Dec 29, 2020 · 3 comments
Closed
Assignees
Labels
bug Issue identified by VS Code Team member as probable bug ssh Issue in vscode-remote SSH verified Verification succeeded
Milestone

Comments

@cwwalter
Copy link

  • VSCode Version: 1.52.1
  • Local OS Version: MacOS
  • Remote OS Version: SUSE Linux Enterprise Server 15 (Cori computing system at NERSC)
  • Remote Extension/Connection Type: SSH

Steps to Reproduce:

  1. Set noclobber in the remote .bashrc with set -o noclobber
  2. Try to make a remote connection

If you have connected before, and a previous log file exists, then starring the remote process fails.

The connection fails because the server code assumes it can overwrite the existing file. This is demonstrated in my log file as follows. Here we see the server being started:

[01:13:06.508] > Starting server with command... /global/homes/c/cwalter/.vscode-server/bin/ea3859d4ba2f3e577a159bc91e3074c5d85c0523/server.sh --start-server --host=127.0.0.1 --enable-remote-auto-shutdown  --port=0  &> "/global/homes/c/cwalter/.vscode-server/.ea3859d4ba2f3e577a159bc91e3074c5d85c0523.log" < /dev/null

But since I have set noclobber, and the file exists, it can't overwrite it as shown here:

01:13:06.616] stderr> main: line 476: /global/homes/c/cwalter/.vscode-server/.ea3859d4ba2f3e577a159bc91e3074c5d85c0523.pid: cannot overwrite existing file
[01:13:06.616] stderr> main: line 475: /global/homes/c/cwalter/.vscode-server/.ea3859d4ba2f3e577a159bc91e3074c5d85c0523.log: cannot overwrite existing file

But, the script continues anyway and the remote connection fails. Before determining the root cause of this issue, I had noted that if I only deleted the log file in the server directory I could connect. This was puzzling but similar behavior was reported in #2828 and worked on by @roblourens . I suspect some of those people may also have either set the option or had it set for them.

The solution for this problem is for the script to either turn off the option locally or use the '>|' method. Searching older issues for noclobber it looks like the container extension already does this.

Does this issue occur when you try this locally?: NA
Does this issue occur when you try this locally and all extensions are disabled?: NA

@github-actions github-actions bot added the ssh Issue in vscode-remote SSH label Dec 29, 2020
@roblourens roblourens self-assigned this Jan 2, 2021
@roblourens roblourens added the bug Issue identified by VS Code Team member as probable bug label Jan 2, 2021
@roblourens roblourens added this to the January 2021 milestone Jan 2, 2021
@roblourens
Copy link
Member

Good point, I can disable noclobber. Can you point me to the issue where you see this? I don't see it and would like to see what we did for containers

Searching older issues for noclobber it looks like the container extension already does this.

@cwwalter
Copy link
Author

cwwalter commented Jan 3, 2021

Thanks! That will help.

Actually I see now I accidentally misread the other issues.. they are actually turning it on, not off, in the container case. If you do an issue search for "noclobber" about 10 or so issues will come up, most related to containers. That isn't the point of those issues, but if you look in the logs posted in those issues you will see entries like this:

10713 ms] Start: Run in container: set -o noclobber ; mkdir -p '/home/gidev/.vscode-server-insiders/data/Machine' && { > '/home/gidev/.vscode-server-insiders/data/Machine/.writeMachineSettingsMarker' ; } 2> /dev/null

That is what I was seeing.

@roblourens roblourens modified the milestones: January 2021, On Deck Jan 28, 2021
@joshspicer joshspicer assigned joshspicer and unassigned roblourens Jul 22, 2024
@joshspicer
Copy link
Member

This doesn't seem to repro in the extension anymore with default settings.

To attempt to repro, I added set -o noclobber to the remote machine's .bashrc and was able to connect multiple times without error (either visible, or in the logs). Upon connection it does appear noclobber is set:

Image

Please feel free to re-open if able to repro!

@joshspicer joshspicer closed this as not planned Won't fix, can't repro, duplicate, stale Jul 22, 2024
@joshspicer joshspicer modified the milestones: On Deck, July 2024 Jul 22, 2024
@chrmarti chrmarti added the verified Verification succeeded label Jul 26, 2024
@vs-code-engineering vs-code-engineering bot locked and limited conversation to collaborators Sep 5, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
bug Issue identified by VS Code Team member as probable bug ssh Issue in vscode-remote SSH verified Verification succeeded
Projects
None yet
Development

No branches or pull requests

4 participants