-
-
Notifications
You must be signed in to change notification settings - Fork 579
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
ddev ssh
should return the exit code that is returned from docker-compose and not add extra output
#3738
Comments
Thanks for taking the time to create this issue. See also related Basically Here's the behavior I see:
|
It could report better info, like maybe "last command from ddev ssh returned 127" |
I think We are in this general area of command handling and exit codes I think: #3518 I would be in favor of completely removing the That Nota bene: |
People do things like this though: I'm not sure why they do that exactly instead of using |
@rfay Removing that |
Thank you!
I did not notice the issue.
But I agree: "Removing that Failed to ddev ssh web: exit status XX would
still be the right thing to do IMHO"
A) because of logic
B) to not confuse newbies like myself
Bye
Michael
Am Mi., 30. März 2022 um 16:18 Uhr schrieb Jonas Eberle <
***@***.***>:
… @rfay <https://github.com/rfay> Removing that Failed to ddev ssh web:
exit status XX would still be the right thing to do IMHO.
—
Reply to this email directly, view it on GitHub
<#3738 (comment)>, or
unsubscribe
<https://github.com/notifications/unsubscribe-auth/ADA37SA6GLSPILCN4QIGJ63VCRPC7ANCNFSM5SBHHBBQ>
.
You are receiving this because you were mentioned.Message ID:
***@***.***>
|
I would prefer I think an option to enable/disable might be a good comprimise. I would definately set it to disabled, |
No need for an option IMHO. People should check the exit code properly if they care about it ;) |
IIRC the problem was figuring out how to return the proper exit code. Shouldn't be that hard. |
ddev ssh
should return the exit code that is returned from docker-compose
ddev ssh
should return the exit code that is returned from docker-composeddev ssh
should return the exit code that is returned from docker-compose and not add extra output
This comment was marked as off-topic.
This comment was marked as off-topic.
This isn't related to this issue, please open a new one when you have an unrelated issue. The problem here is you have something in your .ssh directory that is not a valid key. |
AFAICT, this issue was closed by pull #1697 merged into v1.21.4. Running the same test @rfay from Mar 30, 2022, I get no additional output upon exit from
|
Also noting that this is a duplicate of #1681 unless I am misunderstanding. |
I think this is the situation we're talking about:
It did not fail in this situation, we just exited. Not only is the reporting about "failed to ddev ssh web" incorrect, but the return value should actually be 0. |
That is exactly what I get with the changes from #1697:
|
It's possible something got lost? Could you please try current HEAD? You can do that with So the change reversion happened in Which was fixing But I don't know why it touched ssh.go for what it was trying to fix. It seems like you're doing great on your exploration! All you have to do now is understand the context of the 3 issues and make it right again! Thanks! |
One little detail... It's possible to use |
Okay. I see. I WAS using HEAD. But I had made the same changes as you had put in #1697 and then I saw #1697, assumed it was still in the codebase, didn't notice the date, didn't test against clean HEAD, so I never saw the regression. I'm guessing you reversed #1697 and touched ssh.go because someone might
And it, indeed, provides the correct output if it is attempted when the container is not running. So I believe #2830 shouldn't have been done, unless you were thinking of that specific piping of args use-case issue. Will try to spend a little time noodling on that. |
I think you'll be able to figure out a path. Also note that
But yes, I think it would work to check for running service first, then accept the result, rather than depending on the result of the exec to say whether the service is running. |
I seem to have hit a chicken-egg problem. Theoretically, you could check in ssh.go if there are values being piped in, and if so, go ahead and return the error (if any); if there are no piped values, don't bother to return an error message. Like so:
However, this doesn't work because I can't figure out a way to detect if values have been piped in without robbing that store from the shell, i.e. if I try to detect piped values, then no piped values are actually piped and run. This:
will never return the error for I tried looking at doing something along these lines further along the chain in I tried making copies of stdin to read the copy instead, but that yielded no love. But I'm not sure if that was because I'm new to Go and don't know what I'm doing or if that's just not the way the stdin works. I think I need some advice/direction here to proceed further. |
Thanks for working on it! I'll try to take a look in the next couple of days. Maybe you could put up your best effort as a PR first? |
Absolutely. |
Attempt to check if values were piped in before deciding to return additional error ou tput from ssh.go. Issue ddev#3738.
NOTE: In addition to not solving the problem, |
:) |
Also, just confirming that adding a |
Attempt to check if values were piped in before deciding to return additional error ou tput from ssh.go. Issue ddev#3738.
Attempt to check if values were piped in before deciding to return additional error ou tput from ssh.go. Issue ddev#3738.
Attempt to check if values were piped in before deciding to return additional error ou tput from ssh.go. Issue ddev#3738.
Is there an existing issue for this?
Run a Diagnostic and Paste Link Here
No response
Current Behavior
When I exit from ddev ssh after having written a command in the container I get an error: "Failed to ddev ssh web: exit status 1" or "Failed to ddev ssh web: exit status 127".
This does not occur if I have not typed a command other than "exit" (i.e. entered and exited again immediately)
Expected Behavior
no error
Steps To Reproduce
see above
Anything else?
No response
The text was updated successfully, but these errors were encountered: