-
Notifications
You must be signed in to change notification settings - Fork 429
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
Picocli command line continuation issue in docker-compose #2348
Comments
@nodece Thank you for raising this, very interesting! Glad to see that you already found a solution! AnalysisI have to respectfully disagree with the last paragraph of your analysis though: 😅
Picocli does not receive (or handle) the line continuation backslashes, Docker receives the line continuations. Docker is responsible for parsing the line starting with Thank you for including the Docker Inspect snippets: they clearly show that Pulsar 4.0.0 and Pulsar 3.0.7 produce different My conclusion: this is a Docker bugThis looks like a bug in Docker to me. The array of Args that Docker passes to the command should not contain newline elements. The Docker documentation for line continuations has an example showing that 2 lines with a backslash escaping the newline is equivalent to 1 line with the backslash and newline removed. Clearly the intention is that newline characters should be removed by Docker. This is not working correctly. It may be worth reporting this to the Docker maintainers. Should picocli be modified?About your request
Firstly, again, I am glad to see that you found a solution that eliminates these newline arguments before picocli is invoked. Should picocli be modified? It is possible to modify picocli to remove Additionally, other applications may also have problems handling a command line arguments array containing newline string elements. Picocli is only one application. It really should be fixed upstream (in Docker), IMHO. |
Thanks for your explanation! I agree with your viewpoints, and the picocli is more strict than the jcommander, I accept it. |
Motivation
In the Pulsar 4.0.0, we use the [email protected] instead of the jcommander for command-line argument parsing. While applying Pulsar 4.0.0 for the Pulsar Go Client CI, we encountered an issue during cluster initialization with docker-compse. The script fails because Picocli cannot correctly parse options that include spaces.
I'm not sure if it's affected by the OS:
You can find the our test docker-compose.yml on https://github.com/apache/pulsar-client-go/blob/26e80855bb9848d41781840368e53d74f7df1102/integration-tests/clustered/docker-compose.yml#L51, or master branch.
Case 1(Pulsar 4.0.0 doesn't work, Pulsar 3.0.7 works fine):
docker-compose.yml
Deploy script:
Docker inspect:
Error log:
Case 2(Pulsar 4.0.0 doesn't work, Pulsar 3.0.7 works fine):
docker-compose.yml
Deploy script:
Docker inspect:
Error log:
Case 3(Both Pulsar 3.0.7 and 4.0.7 can work properly)
docker-compose.yml:
Deploy script:
Docker Inspect:
Success log:
This issue appears to be related specifically to how picocli handles line continuation in the docker compose context, particularly when using Alpine/Ubuntu as the base image. Any guidance or potential workarounds to ensure compatibility with our existing scripts would be greatly appreciated.
The text was updated successfully, but these errors were encountered: