[SERVER-16754] Confusing severity values when mongo shell start fails Created: 07/Jan/15  Updated: 18/Sep/15  Resolved: 15/Jan/15

Status: Closed
Project: Core Server
Component/s: Logging, Shell
Affects Version/s: 2.8.0-rc4
Fix Version/s: 3.0.0-rc6

Type: Bug Priority: Minor - P4
Reporter: Thomas Rueckstiess Assignee: Eric Milkie
Resolution: Done Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Issue Links:
Related
related to SERVER-17068 3.0.0-rc6 cannot build with the 3.25 ... Closed
Backwards Compatibility: Fully Compatible
Operating System: ALL
Steps To Reproduce:

start "mongo" without a mongod running.

Participants:

 Description   

When I start a mongo shell with 2.8.0-rc4 and no mongod is running, I get the following error:

$ mongo
MongoDB shell version: 2.8.0-rc4
connecting to: test
2015-01-07T17:56:51.503+1100 W NETWORK  Failed to connect to 127.0.0.1:27017, reason: errno:61 Connection refused
2015-01-07T17:56:51.504+1100 I QUERY    Error: couldn't connect to server 127.0.0.1:27017 (127.0.0.1), connection attempt failed
    at connect (src/mongo/shell/mongo.js:179:14)
    at (connect):1:6 at src/mongo/shell/mongo.js:179
exception: connect failed

The first line has severity W = Warning and the second line has severity I = Information.

I'd expect both of these to be E = Error, although the first one is debatable, but the second one explicitly says "Error:". Additionally, I'd expect the second line not have the component QUERY, but also NETWORK instead.



 Comments   
Comment by Githook User [ 27/Jan/15 ]

Author:

{u'username': u'benety', u'name': u'Benety Goh', u'email': u'benety@mongodb.com'}

Message: SERVER-17068 fixed compilation errors

Based on the following changes to engine_v8.h, engine_v8.cpp and v8_utils.cpp:

SERVER-13256 Remove shared_ptr from pch.h
SERVER-13256 Add std namespace qualifications in headers
SERVER-13256 Add usings and qualifications for names from namespace std
SERVER-16754 correct shouldLog() to respect the current default component

(cherry picked from commit 107e3bfcd71936a876231517ee52aa6ca80b7e1d)
Branch: v3.0
https://github.com/mongodb/mongo/commit/a0986ff9cd64e935a37f4d0b254728712866c579

Comment by Githook User [ 27/Jan/15 ]

Author:

{u'username': u'benety', u'name': u'Benety Goh', u'email': u'benety@mongodb.com'}

Message: SERVER-17068 fixed compilation errors

Based on the following changes to engine_v8.h, engine_v8.cpp and v8_utils.cpp:

SERVER-13256 Remove shared_ptr from pch.h
SERVER-13256 Add std namespace qualifications in headers
SERVER-13256 Add usings and qualifications for names from namespace std
SERVER-16754 correct shouldLog() to respect the current default component
Branch: master
https://github.com/mongodb/mongo/commit/107e3bfcd71936a876231517ee52aa6ca80b7e1d

Comment by Githook User [ 15/Jan/15 ]

Author:

{u'username': u'milkie', u'name': u'Eric Milkie', u'email': u'milkie@10gen.com'}

Message: SERVER-16754 correct shouldLog() to respect the current default component
Branch: master
https://github.com/10gen/mongo-enterprise-modules/commit/54f90aa98e7c51d4f5790fc847c699de94c9b6c4

Comment by Githook User [ 15/Jan/15 ]

Author:

{u'username': u'milkie', u'name': u'Eric Milkie', u'email': u'milkie@10gen.com'}

Message: SERVER-16754 correct shouldLog() to respect the current default component
Branch: master
https://github.com/mongodb/mongo/commit/2238749896b7e3f7e371c75d47344ade4eb437e2

Comment by Githook User [ 15/Jan/15 ]

Author:

{u'username': u'milkie', u'name': u'Eric Milkie', u'email': u'milkie@10gen.com'}

Message: SERVER-16754 adjust V8's log message severities
Branch: master
https://github.com/mongodb/mongo/commit/8a4251527bd8112c70c72738a9beacf7067e6b48

Comment by Eric Milkie [ 07/Jan/15 ]

For Javascript exception messages, we don't actually know the underlying component generating the exception, so they will all have to be the same component. QUERY seemed more appropriate than CONTROL for Javascript log messages. We can change the exception message to be of severity E, but I am not inclined to change all the Javascript messages to be CONTROL.

We should perhaps make a google doc to keep track of the severity and component changes for log messages throughout the server, as I expect that we will find many more of these

Comment by Thomas Rueckstiess [ 07/Jan/15 ]

A similar issue with this line:

2015-01-07T17:38:37.545+1100 I REPL     [ReplicationExecutor] Error in heartbeat request to enter.local:27019; Location18915 Failed attempt to connect to enter.local:27019; couldn't connect to server enter.local:27019 (10.8.1.227), connection attempt failed

If it starts with "Error" then it should probably have severity E. Otherwise it's very confusing to users.

Generated at Thu Feb 08 03:42:09 UTC 2024 using Jira 9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66.