Giter Club home page Giter Club logo

Comments (8)

cppforlife avatar cppforlife commented on August 20, 2024

inline

Sent from my iPhone

On Nov 9, 2016, at 2:14 AM, Sven Schmidt [email protected] wrote:

Hello,

I built the cli 2 days ago. Today I sshed into an uaa on vsphere.

First I tried gobosh -e overbosh ssh uaa 0 -d cf to connect to the uaa/0 instance which threw this error:

new cli always requires slashes for instance identifiers. uaa/0 for example instead of a space. in this case 0 became the command that was being run as shown below by the error from bash.
Using environment '172.27.1.6' as user 'admin'

Using deployment 'cf'

Task 6471. Done
?/0: stderr | Unauthorized use is strictly prohibited. All access and activity
?/0: stderr | is subject to logging and monitoring.
?/0: stdout | bash: 0: command not found
?/0: stderr | Connection to 172.27.1.53 closed.

Running SSH:
1 error(s) occurred:

  • Running command: 'ssh -tt -o ServerAliveInterval=30 -o ForwardAgent=no -o PasswordAuthentication=no -o IdentitiesOnly=yes -o IdentityFile=/home/vcap/.bosh/tmp/ssh-priv-key146955521 -o StrictHostKeyChecking=yes -o UserKnownHostsFile=/home/vcap/.bosh/tmp/ssh-known-hosts880087660 172.27.1.53 -l bosh_0c902fee64414437 0', stdout: '', stderr: '': exit status 127

Exit code 1```

after leaving out the id, I was able to connect, but when I close the SSH session I will get the error with another exit status

  1 error(s) occurred:
- Running command: 'ssh -tt -o ServerAliveInterval=30 -o ForwardAgent=no -o PasswordAuthentication=no -o IdentitiesOnly=yes -o IdentityFile=/home/vcap/.bosh/tmp/ssh-priv-key436948954 -o StrictHostKeyChecking=yes -o UserKnownHostsFile=/home/vcap/.bosh/tmp/ssh-known-hosts249189745 172.27.1.53 -l bosh_941e632f2cc94387', stdout: '', stderr: '': exit status 130

Exit code 1```

Please let me know if I can provide logs/more output to help pinning down this error. 
were you using this interactively or running a specific command? it looks like in either case it resulted in exit code 130.
—
You are receiving this because you are subscribed to this thread.
Reply to this email directly, view it on GitHub, or mute the thread.

from bosh-cli.

schmidtsv avatar schmidtsv commented on August 20, 2024

Hi, I was running it interactively, grabbing some logs at the first time. I tried it again, getting the same error when opening the session and then closing it again immediately with ctrl-d

from bosh-cli.

dpb587-pivotal avatar dpb587-pivotal commented on August 20, 2024

It's worth noting that when you Ctrl-C a command, that command will exit with a 130 status by default. Standard ssh will return the exit code of the last command executed. The CLI interprets the exit code that ssh gives (130) as a failure and propagates the exit code, too.

If you're seeing exit code 130, it probably means one of the following happened before exiting...

  1. a login shell command errored (unlikely unless you've patched your BOSH VM with some special commands)
  2. you ran a command like tail -f /var/vcap/sys/log/**/*.log and Ctrl-C'd it

Do either of those sound familiar?

@cppforlife, we chatted about this behavior a while ago. Perhaps a compromise for interactive mode might be to not raise an error in the UI, but still propagate the exit code. It would look normal and less alarming to users, but still provide the low-level behavior some automation may care about.

from bosh-cli.

schmidtsv avatar schmidtsv commented on August 20, 2024

I had Number 2 in one case, but the error also appears when I just ctrl-d my way out (Tested it right now with sshing onto the machine then immediately exiting with ctrl-d). Might me an idea to swallow that error.

from bosh-cli.

cppforlife avatar cppforlife commented on August 20, 2024

yeah i think it makes sense to be a bit more friendly with error message returned from terminated ssh sessions.

from bosh-cli.

shalako avatar shalako commented on August 20, 2024

Also had this issue

$ gosh --version
version 0.0.147-ba602d1-2017-01-11T20:05:06Z

Succeeded
router/388cc459-fcbe-4538-b82b-d37a3bee0ed9:~$ exit
logout
Connection to 10.0.16.5 closed.
Killed by signal 1.

Running SSH:
  1 error(s) occurred:

* Running command: 'ssh -tt -o ServerAliveInterval=30 -o ForwardAgent=no -o PasswordAuthentication=no -o IdentitiesOnly=yes -o IdentityFile=/Users/shannon/.bosh/tmp/ssh-priv-key685444168 -o StrictHostKeyChecking=yes -o UserKnownHostsFile=/Users/shannon/.bosh/tmp/ssh-known-hosts754332423 -o ProxyCommand=ssh -tt -W %!h(MISSING):%!p(MISSING) -l vcap 35.184.49.153 -o ServerAliveInterval=30 -o ForwardAgent=no -o ClearAllForwardings=yes -o StrictHostKeyChecking=no -o UserKnownHostsFile=/dev/null 10.0.16.5 -l bosh_ed49601128e04526', stdout: '', stderr: '': exit status 130

Exit code 1

from bosh-cli.

giner avatar giner commented on August 20, 2024

This happens if exit status of last command run is not 0 even if the shell is interactive. The current behavior is a bit confusing as it always feels as something went wrong.

  • Last command exits with status 0
    $ bosh ssh -d cf diego-cell; echo "EXIT CODE: $?"
    ...
    diego-cell/cf12e4ee-ad60-496d-bb34-9417fc054764:~$ exit
    logout
    Connection to 10.244.0.139 closed.
    
    Succeeded
    EXIT CODE: 0
    
  • Last command exits with status 42
    $ bosh ssh -d cf diego-cell; echo "EXIT CODE: $?"
    ...
    diego-cell/cf12e4ee-ad60-496d-bb34-9417fc054764:~$ exit 42
    logout
    Connection to 10.244.0.139 closed.
    
    Running SSH:
      1 error(s) occurred:
    
    * Running command: 'ssh -tt -o ServerAliveInterval=30 -o ForwardAgent=no -o PasswordAuthentication=no -o IdentitiesOnly=yes -o IdentityFile=/home/stas/.bosh/tmp/ssh-priv-key885911897 -o StrictHostKeyChecking=yes -o UserKnownHostsFile=/home/stas/.bosh/tmp/ssh-known-hosts536285924 10.244.0.139 -l bosh_e7ad4a2758354bd', stdout: '', stderr: '': exit status 42
    
    Exit code 1
    EXIT CODE: 1
    

What about mak*ing bosh cli do the same as openssh client and cf cli do, i.e. returning exit code of the last command without error message?

$ man ssh | grep "^EXIT STATUS" -A1
EXIT STATUS
     ssh exits with the exit status of the remote command or with 255 if an error occurred.
  • Example for openssh
    $ ssh -i /tmp/vbox.key jumpbox@$BOSH_ENVIRONMENT; echo "EXIT CODE: $?"
    ...
    $ exit 42
    Connection to 192.168.50.6 closed.
    EXIT CODE: 42
    

from bosh-cli.

mfine30 avatar mfine30 commented on August 20, 2024

Closing in favor of #434

from bosh-cli.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.