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

--server argument warning pollutes standard output #6147

Closed
p-mongo opened this issue Mar 28, 2020 · 2 comments
Closed

--server argument warning pollutes standard output #6147

p-mongo opened this issue Mar 28, 2020 · 2 comments
Milestone

Comments

@p-mongo
Copy link

p-mongo commented Mar 28, 2020

We upgraded to 9.2.11.0 recently and our CI started failing because the following warning is printed by jruby to standard output:

[2020-03-28 19:41:36.535] Warning: the --server flag is deprecated and has no effect most JVMs

For example, we have a script that outputs the result of its work to standard output, which is then consumed by bash as follows:

 url=`$(dirname $0)/get-mongodb-download-url $download_version $arch`

In 9.2.11.0 this produces:

[2020-03-28 19:41:36.972] + prepare_server rhel70
[2020-03-28 19:41:36.972] + arch=rhel70
[2020-03-28 19:41:36.972] + test -n ''
[2020-03-28 19:41:36.972] + test 4.2 = latest
[2020-03-28 19:41:36.972] + download_version=4.2
[2020-03-28 19:41:36.973] +++ dirname .evergreen/run-tests.sh
[2020-03-28 19:41:36.974] ++ .evergreen/get-mongodb-download-url 4.2 rhel70
[2020-03-28 19:41:39.505] + url='Warning: the --server flag is deprecated and has no effect most JVMs
[2020-03-28 19:41:39.505] https://downloads.mongodb.com/linux/mongodb-linux-x86_64-enterprise-rhel70-4.2.5.tgz'

You can see that the url variable now contains the warning message followed by the URL. Due to the warning message being prepended to the URL, this variable now has wrong content and subsequent operations using it fail.

It appears that the offending message was added in 9.2.10.0 here.

Looking at that file, there are several other messages being printed to standard output and I expect they would also produce the same issue.

I tried to reproduce this issue locally here but have not succeeded in doing so by invoking ruby or jruby. If I invoke jruby.bash the issue reproduces.

Environment Information

Problematic system:

jruby 9.2.11.0 (2.5.7) 2020-03-02 612d7a05a6 Java HotSpot(TM) 64-Bit Server VM 25.162-b12 on 1.8.0_162-b12 +jit [linux-x86_64]

OK system:

jruby 9.2.11.0 (2.5.7) 2020-03-02 612d7a05a6 OpenJDK 64-Bit Server VM 25.242-b08 on 1.8.0_242-8u242-b08-0ubuntu3~18.04-b08 +jit [linux-x86_64]

Suggested fix

All of the warning messages in https://github.com/jruby/jruby/blob/master/bin/jruby.bash should be output to stderr, not to stdout, using a pattern like:

echo Warning message 1>&2
p-mongo pushed a commit to p-mongo/mongo-ruby-driver that referenced this issue Mar 28, 2020
p-mongo pushed a commit to p-mongo/mongo-ruby-driver that referenced this issue Mar 28, 2020
@headius
Copy link
Member

headius commented Mar 29, 2020

Aha, you are correct. We will fix these.

@headius headius added this to the JRuby 9.3.0.0 milestone Mar 29, 2020
@p-mongo
Copy link
Author

p-mongo commented Mar 29, 2020

Thanks!

p-mongo added a commit to mongodb/mongo-ruby-driver that referenced this issue Mar 30, 2020
Remove --server argument

jruby/jruby#6147

Co-authored-by: Oleg Pudeyev <oleg@bsdpower.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants