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

StandardOut goes to StandardError in non-interactive mode #891

Closed
joanneshen opened this issue Oct 19, 2023 · 2 comments
Closed

StandardOut goes to StandardError in non-interactive mode #891

joanneshen opened this issue Oct 19, 2023 · 2 comments
Labels
branch/2.1.x Issue for a branch branch/3.0.x Issue for a branch branch/3.1.x Issue for a branch for/backport For backporting type/enhancement Is an enhancement request
Milestone

Comments

@joanneshen
Copy link

This issue seems to be more on the Linux side, Windows 10 system seemed to be fine.

There is java process to kick off .bat file that kicks off Shell, then waits for the process to complete, then checks for standard input and error streams to determine if deployment process (the same applies for load/ingestion) was successful or failed.

Prior to Spring-shell 3.1.3 upgrade (and Spring-boot upgrade) standard out messages were available on getInputStream(). Everything that you see in Shell console (with exception of errors) were available in this stream. All errors, including NOTEs and warnings, were available in error stream (getErrorStream()).

After Spring-shell 3.1.3 upgrade, the input stream returns only the following:
“Welcome to XXXXXX ##.# command line client (c) XYZ Corporation
Type 'help' for a list of commands and options, type 'exit' to leave the shell.”

All the other message supposed to be standard out goes to standard error instead.

We are also using build.gradle to do the build of the shell. It is in version 7.4 or 7.5.

@github-actions github-actions bot added the status/need-triage Team needs to triage and take a first look label Oct 19, 2023
@jvalkeal
Copy link
Contributor

This was caused by changes in jline jline/jline3#845. It's a bit complex issue there but with their next release we get some help to partially restore a functionality. In a meanwhile on linux you need to redirect stderr to stdout, i.e. 2>&1.

@jvalkeal jvalkeal added type/enhancement Is an enhancement request and removed status/need-triage Team needs to triage and take a first look labels Oct 19, 2023
@jvalkeal jvalkeal changed the title After spring-shell upgrade to 3.1.3 StandardOut goes to StandardError in non-interactive mode StandardOut goes to StandardError in non-interactive mode Nov 3, 2023
@jvalkeal jvalkeal added this to the 3.2.0-RC1 milestone Nov 3, 2023
@jvalkeal
Copy link
Contributor

jvalkeal commented Nov 3, 2023

Looks like with #901 we're able to restore original behaviour(getting stuff written into stdout if there's a redirect) what comes for this stdout/stderr confusion.

jvalkeal added a commit to jvalkeal/spring-shell that referenced this issue Nov 3, 2023
- Disable jni terminal provider in test ShellAutoConfiguration
  like it's done for jna/jansi
- Default TerminalBuilder system outpu to SysOut to restore
  writing to stdout instead of stderr when redirect exists
- Relates spring-projects#891
- Relates spring-projects#901
@jvalkeal jvalkeal added for/backport For backporting branch/2.1.x Issue for a branch branch/3.0.x Issue for a branch branch/3.1.x Issue for a branch labels Nov 3, 2023
jvalkeal added a commit that referenced this issue Nov 3, 2023
- Disable jni terminal provider in test ShellAutoConfiguration
  like it's done for jna/jansi
- Default TerminalBuilder system outpu to SysOut to restore
  writing to stdout instead of stderr when redirect exists
- Backport #891
- Backport #901
- Fixes #913
- Fixes #910
jvalkeal added a commit that referenced this issue Nov 3, 2023
- Disable jni terminal provider in test ShellAutoConfiguration
  like it's done for jna/jansi
- Default TerminalBuilder system outpu to SysOut to restore
  writing to stdout instead of stderr when redirect exists
- Backport #891
- Backport #901
- Fixes #914
- Fixes #911
jvalkeal added a commit that referenced this issue Nov 3, 2023
- Default TerminalBuilder system outpu to SysOut to restore
  writing to stdout instead of stderr when redirect exists
- Backport #891
- Backport #901
- Fixes #915
- Fixes #912
@jvalkeal jvalkeal closed this as completed Nov 3, 2023
@jvalkeal jvalkeal modified the milestones: 3.2.0-RC1, 3.2.0-M3 Nov 7, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
branch/2.1.x Issue for a branch branch/3.0.x Issue for a branch branch/3.1.x Issue for a branch for/backport For backporting type/enhancement Is an enhancement request
Projects
None yet
Development

No branches or pull requests

2 participants