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

Executing cf ssh over CliConnection.CliCommand mixes stdout and stderr #1074

Closed
michele-mancioppi opened this issue Feb 21, 2017 · 7 comments
Labels

Comments

@michele-mancioppi
Copy link

When executing cf ssh my_app -c '>&2 echo Ciao', "Ciao" is printed correctly to stderr.

When executing cliConnection.CliCommand("ssh", "my_app", "-c", ">&2 echo Ciao"), "Ciao" is printed to stdout, which makes it fundamentally impossible to write good wrappers around cf ssh for non-trivial commands.

@cf-gitbot
Copy link

We have created an issue in Pivotal Tracker to manage this:

https://www.pivotaltracker.com/story/show/140310579

The labels on this github issue will be updated when the story is started.

@dkoper
Copy link

dkoper commented Feb 22, 2017

Hi @michele-mancioppi

I hear from my anchor that architecturally the plugin code dumps everything it captures in stdout and stderr, it does not separate the two, and it would be a bit of work to separate stderr and stdout. And that could potentially be a breaking change for existing plugins.
We'd like to improve the plugin architecture after the command refactor. I'll keep an eye out on this issue and see if we cover it then or can address it sooner.

Regards,
Dies Koper
CF CLI PM

@michele-mancioppi
Copy link
Author

Hi @dkoper,

Thanks for the answer. Do you have a timeline about the command refactoring? Could you also please keep #1069 in mind for the refactoring? Is there anything I could have a look at about refactoring ideas & directions?

Best,
Michele

@dkoper
Copy link

dkoper commented Feb 22, 2017

Here's a link to the epic for command refactoring: https://www.pivotaltracker.com/epic/show/3307969, , it's huge so will take a long time.
cf ssh came originally from a plugin. It may be most efficient for now to include ssh functionality in your own plugin and massage it for your needs.

@dkoper
Copy link

dkoper commented Apr 12, 2017

Hi @michele-mancioppi,

We did an exploration around the behaviour you mentioned in this issue, and our findings do not match what you wrote. Can you take a look at the comments in https://www.pivotaltracker.com/story/show/141913339 and compare with your understanding?

Cheers,
Dies Koper
CF CLI PM

@michele-mancioppi
Copy link
Author

I will run the tests again when I am back from vacations and update the issue accordingly. Cheers.

@michele-mancioppi
Copy link
Author

Sorry, issue was between keyboard and chair :-)

It is indeed the case that the stderr output of a plugin goes to the stderr of the enveloping cf [my_plugin] ... command, uncaught by the plugin itself.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants