Bug 1299009 - skyring crashes when mongodb auth fails
skyring crashes when mongodb auth fails
Status: CLOSED ERRATA
Product: Red Hat Storage Console
Classification: Red Hat
Component: core (Show other bugs)
2
Unspecified Unspecified
unspecified Severity high
: ---
: 2
Assigned To: Nishanth Thomas
Lubos Trilety
:
Depends On:
Blocks:
  Show dependency treegraph
 
Reported: 2016-01-15 11:58 EST by Martin Bukatovic
Modified: 2016-08-23 15:45 EDT (History)
6 users (show)

See Also:
Fixed In Version: rhscon-core-0.0.32-1.el7scon.x86_64
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2016-08-23 15:45:57 EDT
Type: Bug
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---


Attachments (Terms of Use)
full skyring.log file (3.29 KB, text/plain)
2016-01-15 11:58 EST, Martin Bukatovic
no flags Details


External Trackers
Tracker ID Priority Status Summary Last Updated
Gerrithub.io 261493 None None None 2016-01-28 09:56 EST
Gerrithub.io 261495 None None None 2016-01-28 09:56 EST
Red Hat Product Errata RHEA-2016:1754 normal SHIPPED_LIVE New packages: Red Hat Storage Console 2.0 2017-04-18 15:09:06 EDT

  None (edit)
Description Martin Bukatovic 2016-01-15 11:58:56 EST
Created attachment 1115193 [details]
full skyring.log file

Description of problem
======================

Skyring crashes when mongodb auth fails.

While I understand that skyring requires mongodb to function properly,
null pointer error crash of skyring process is an unacceptable way to
handle this kind error state.

Version-Release number of selected component
============================================

# rpm -qa | grep rhscon
rhscon-ui-0.0.6-0.1.alpha1.el7.noarch
rhscon-core-0.0.6-0.1.alpha1.el7.x86_64
rhscon-ceph-0.0.4-0.1.alpha1.el7.x86_64
# rpm -qa | grep mongo
mongodb-server-2.6.5-4.el7ost.x86_64
mongodb-2.6.5-4.el7ost.x86_64

How reproducible
================

100%

Steps to Reproduce
==================

1. Install skyring on the server
2. Make sure that mongod service is running: `systemctl start mongod`
3. Configure mongodb so that skyring auth will fail
4. Start skyring: `setsid skyring > ~/skyring.log 2>&1`
5. Check /root/skyring.log file

note: in step 3, I start skyring daemon process manually because of BZ 1296123

Actual results
==============

Skyring process crashes. See this excerpt from skyring.log:

~~~
2016-01-15T17:44:09.343+01:00 INFO     main.go:177 start] Starting event listener
2016-01-15T17:44:09.379+01:00 CRITICAL db.go:41 InitDBSession] Error: auth failed
2016-01-15T17:44:09.379+01:00 ERROR    main.go:188 start] Unable to initialize DB
panic: runtime error: invalid memory address or nil pointer dereference
[signal 0xb code=0x1 addr=0x0 pc=0x4849b4]
~~~

(full skyring.log file is attached to this BZ)

Expected results
================

Skyring process reports the issue in the log properly without crashing 
(and then stops if there is nothing else to do).
Comment 5 Lubos Trilety 2016-07-19 15:56:28 EDT
# systemctl start skyring.service 
Job for skyring.service failed because the control process exited with error code. See "systemctl status skyring.service" and "journalctl -xe" for details.

# journalctl -xe
...
-- Unit skyring.service has begun starting up.
Jul 19 21:53:50 dhcp46-15.lab.eng.blr.redhat.com skyring-pre.sh[16226]: MongoDB shell version: 2.6.5
Jul 19 21:53:51 dhcp46-15.lab.eng.blr.redhat.com skyring-pre.sh[16226]: connecting to: skyring
Jul 19 21:53:51 dhcp46-15.lab.eng.blr.redhat.com skyring-pre.sh[16226]: 2016-07-19T21:53:51.055+0200 Error: couldn't add user: not authorized on skyring to execute command { creat
Jul 19 21:53:51 dhcp46-15.lab.eng.blr.redhat.com systemd[1]: skyring.service: control process exited, code=exited status=252
Jul 19 21:53:51 dhcp46-15.lab.eng.blr.redhat.com systemd[1]: Failed to start Skyring Daemon.
...

no null pointer crash
Comment 7 errata-xmlrpc 2016-08-23 15:45:57 EDT
Since the problem described in this bug report should be
resolved in a recent advisory, it has been closed with a
resolution of ERRATA.

For information on the advisory, and where to find the updated
files, follow the link below.

If the solution does not work for you, open a new bug report.

https://access.redhat.com/errata/RHEA-2016:1754

Note You need to log in before you can comment on or make changes to this bug.