Bug 1298977

Summary: skyring crashes when mongod service is not running
Product: [Red Hat Storage] Red Hat Storage Console Reporter: Martin Bukatovic <mbukatov>
Component: coreAssignee: Nishanth Thomas <nthomas>
Status: CLOSED ERRATA QA Contact: Lubos Trilety <ltrilety>
Severity: high Docs Contact:
Priority: urgent    
Version: 2CC: japplewh, ltrilety, mkudlej, nthomas, sankarshan, shtripat
Target Milestone: beta   
Target Release: 2   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
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 19:45:49 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:
Attachments:
Description Flags
full skyring.log file none

Description Martin Bukatovic 2016-01-15 15:14:02 UTC
Created attachment 1115178 [details]
full skyring.log file

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

Skyring crashes when mongod service is not running.

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

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

100%

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

1. Install skyring on the server
2. Make sure mongod service is not running: `systemctl stop mongod`
3. Start skyring: `setsid skyring > ~/skyring.log 2>&1`
4. After a while, check /root/skyring.log file

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

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

Skyring process crashes. Also see this excerpt from skyring.log:


~~~
2016-01-15T15:48:58.925+01:00 INFO     main.go:177 start] Starting event listener
2016-01-15T15:50:00.636+01:00 CRITICAL db.go:41 InitDBSession] Error: no reachable servers
2016-01-15T15:50:00.636+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 without crashing.

Comment 3 Jeff Applewhite 2016-03-18 18:21:29 UTC
might be a duplicate of 1299009, at least very similar

Comment 4 Martin Bukatovic 2016-03-18 18:38:16 UTC
(In reply to Jeff Applewhite from comment #3)
> might be a duplicate of 1299009, at least very similar

Yes, both issues are similar. That said, from my point of view,
I saw 2 issues which made skyring crash. Even if both issues were
fixed by a single patch, during verification I need to test
2 different scenarios (one for this BZ and 2nd for the other one).

Comment 5 Jeff Applewhite 2016-03-18 18:55:04 UTC
right - ok

Comment 7 Lubos Trilety 2016-07-19 19:37:17 UTC
I stopped mongod.service and make it not start-able and then run skyring.service

2016-07-19T21:17:06.677+02:00 WARNING  monitoring.go:269 FetchStatFromGraphiteWithErrorIndicate] skyring:13fa20d1-cc8f-452c-88bd-a5f284e0b9db - Error Failed to get the instant stat of ping.ping-dhcp46-15_lab_eng_blr_redhat_com resource of dhcp46-27_lab_eng_blr_redhat_com
2016-07-19T21:17:42.687+02:00 INFO     main.go:251 funcĀ·005] Signal:%!(EXTRA syscall.Signal=terminated)
2016-07-19T21:32:24.236+02:00 CRITICAL db.go:41 InitDBSession] Error: no reachable servers
2016-07-19T21:32:24.244+02:00 ERROR    skyring.go:517 InitializeApplication] Unable to initialize DB
2016-07-19T21:32:24.244+02:00 CRITICAL main.go:210 start] Unable to initialize the application. err: no reachable servers

No null pointer crash anymore.

Comment 9 errata-xmlrpc 2016-08-23 19:45:49 UTC
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