Bug 1439120

Summary: heketi: failed to start heketi.service
Product: [Red Hat Storage] Red Hat Gluster Storage Reporter: Tejas Chaphekar <tchaphek>
Component: heketiAssignee: Raghavendra Talur <rtalur>
Status: CLOSED ERRATA QA Contact: Tejas Chaphekar <tchaphek>
Severity: urgent Docs Contact:
Priority: unspecified    
Version: cns-3.5CC: dmesser, hchiramm, kramdoss, mliyazud, pprakash, rhs-bugs, rtalur, sselvan, storage-qa-internal
Target Milestone: ---   
Target Release: CNS 3.5   
Hardware: x86_64   
OS: Linux   
Whiteboard:
Fixed In Version: heketi-4.0.0-6.el7rhgs Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2017-04-20 18:38:43 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:
Bug Depends On:    
Bug Blocks: 1415600    

Description Tejas Chaphekar 2017-04-05 09:35:28 UTC
Description of problem:

root@dhcp47-56 ~]# systemctl status heketi
● heketi.service - Heketi Server
   Loaded: loaded (/usr/lib/systemd/system/heketi.service; disabled; vendor preset: disabled)
   Active: failed (Result: start-limit) since Wed 2017-04-05 14:46:36 IST; 11s ago
  Process: 6088 ExecStart=/usr/bin/heketi -config=/etc/heketi/heketi.json (code=exited, status=255)
 Main PID: 6088 (code=exited, status=255)

Apr 05 14:46:36 dhcp47-56.lab.eng.blr.redhat.com systemd[1]: Unit heketi.service entered failed state.
Apr 05 14:46:36 dhcp47-56.lab.eng.blr.redhat.com systemd[1]: heketi.service failed.
Apr 05 14:46:36 dhcp47-56.lab.eng.blr.redhat.com systemd[1]: heketi.service holdoff time over, scheduling restart.
Apr 05 14:46:36 dhcp47-56.lab.eng.blr.redhat.com systemd[1]: start request repeated too quickly for heketi.service
Apr 05 14:46:36 dhcp47-56.lab.eng.blr.redhat.com systemd[1]: Failed to start Heketi Server.
Apr 05 14:46:36 dhcp47-56.lab.eng.blr.redhat.com systemd[1]: Unit heketi.service entered failed state.
Apr 05 14:46:36 dhcp47-56.lab.eng.blr.redhat.com systemd[1]: heketi.service failed.

[root@dhcp47-56 ~]# cat /usr/lib/systemd/system/heketi.service
[Unit]
Description=Heketi Server

[Service]
Type=simple
WorkingDirectory=/var/lib/heketi
EnvironmentFile=-/etc/heketi/heketi.json
User=heketi
ExecStart=/usr/bin/heketi -config=/etc/heketi/heketi.json
Restart=on-failure
StandardOutput=syslog
StandardError=syslog

[Install]


Version-Release number of selected component (if applicable):

heketi-client-4.0.0-5.el7rhgs.x86_64

How reproducible:
 
Always

Steps to Reproduce:
1. Install heketi heketi-cli
2. Start heketi service


Actual results:

Heketi Service fails to start

Expected results:

Heketi should start successfully

Additional info:

Apr 05 10:08:52 dhcp47-56.lab.eng.blr.redhat.com systemd[1]: Starting Heketi Server...
Apr 05 10:08:52 dhcp47-56.lab.eng.blr.redhat.com heketi[4021]: Error: unknown shorthand flag: 'c' in -config=/etc/heketi/heketi.json
Apr 05 10:08:52 dhcp47-56.lab.eng.blr.redhat.com heketi[4021]: unknown shorthand flag: 'c' in -config=/etc/heketi/heketi.json
Apr 05 10:08:52 dhcp47-56.lab.eng.blr.redhat.com systemd[1]: heketi.service: main process exited, code=exited, status=255/n/a
Apr 05 10:08:52 dhcp47-56.lab.eng.blr.redhat.com systemd[1]: Unit heketi.service entered failed state.
Apr 05 10:08:52 dhcp47-56.lab.eng.blr.redhat.com systemd[1]: heketi.service failed.

Comment 2 Daniel Messer 2017-04-05 09:45:08 UTC
Since heketi v4.0.0.0 the syntax for switch is with double dashes, that is --config instead of -config.

Comment 3 Humble Chirammal 2017-04-05 09:55:46 UTC
Upstream is correct to specify this:

https://github.com/heketi/heketi/blob/14686c02d98609290ef1d388eb33839c2c3637e2/extras/systemd/heketi.service

[Unit]
Description=Heketi Server

[Service]
Type=simple
WorkingDirectory=/var/lib/heketi
EnvironmentFile=-/etc/heketi/heketi.env
User=heketi
ExecStart=/usr/bin/heketi --config=/etc/heketi/heketi.json
Restart=on-failure
StandardOutput=syslog
StandardError=syslog

[Install]
WantedBy=multi-user.target

Comment 9 Tejas Chaphekar 2017-04-10 09:28:44 UTC
The bug has been resolved, please find the results as follows

[root@dhcp35-176 ~]# rpm -qa | grep heketi
heketi-client-4.0.0-6.el7rhgs.x86_64
heketi-4.0.0-6.el7rhgs.x86_64

[root@dhcp35-176 ~]# systemctl status heketi
● heketi.service - Heketi Server
   Loaded: loaded (/usr/lib/systemd/system/heketi.service; disabled; vendor preset: disabled)
   Active: inactive (dead)
[root@dhcp35-176 ~]# systemctl start heketi
[root@dhcp35-176 ~]# systemctl status heketi
● heketi.service - Heketi Server
   Loaded: loaded (/usr/lib/systemd/system/heketi.service; disabled; vendor preset: disabled)
   Active: active (running) since Mon 2017-04-10 05:11:02 EDT; 1s ago
 Main PID: 10339 (heketi)
   CGroup: /system.slice/heketi.service
           └─10339 /usr/bin/heketi --config=/etc/heketi/heketi.json

Apr 10 05:11:02 dhcp35-176.lab.eng.blr.redhat.com systemd[1]: Started Heketi Server.
Apr 10 05:11:02 dhcp35-176.lab.eng.blr.redhat.com systemd[1]: Starting Heketi Server...
Apr 10 05:11:02 dhcp35-176.lab.eng.blr.redhat.com heketi[10339]: Heketi 4.0.0
Apr 10 05:11:02 dhcp35-176.lab.eng.blr.redhat.com heketi[10339]: [heketi] INFO 2017/04/10 05:11:02 Loaded mock executor
Apr 10 05:11:02 dhcp35-176.lab.eng.blr.redhat.com heketi[10339]: [heketi] INFO 2017/04/10 05:11:02 Loaded simple allocator
Apr 10 05:11:02 dhcp35-176.lab.eng.blr.redhat.com heketi[10339]: [heketi] INFO 2017/04/10 05:11:02 GlusterFS Application Loaded
Apr 10 05:11:02 dhcp35-176.lab.eng.blr.redhat.com heketi[10339]: Listening on port 8080


[root@dhcp35-176 ~]# curl http://localhost:8080/hello
Hello from Heketi

Comment 10 errata-xmlrpc 2017-04-20 18:38:43 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-2017:1111