#298 builder: fix unhandled exception when certs are not defined
Closed by mikem. Opened by aparsons.
aparsons/koji kojid-unhandled-exception  into  master

Download 298.patch

[root@kjb01 ~]# systemctl status kojid -l -n 200
● kojid.service - Koji build server
Loaded: loaded (/usr/lib/systemd/system/kojid.service; enabled; vendor preset: disabled)
Active: failed (Result: exit-code) since Wed 2017-01-25 14:29:37 EST; 1s ago
Docs: https://fedoraproject.org/wiki/Koji/ServerHowTo
Process: 17529 ExecStart=/usr/sbin/kojid --fg --force-lock --verbose (code=exited, status=1/FAILURE)
Main PID: 17529 (code=exited, status=1/FAILURE)

Jan 25 14:29:36 kjb01.dc01.example.com systemd[1]: Started Koji build server.
Jan 25 14:29:36 kjb01.dc01.example.com systemd[1]: Starting Koji build server...
Jan 25 14:29:37 kjb01.dc01.example.com kojid[17529]: Traceback (most recent call last):
Jan 25 14:29:37 kjb01.dc01.example.com kojid[17529]: File "/usr/sbin/kojid", line 5120, in
Jan 25 14:29:37 kjb01.dc01.example.com kojid[17529]: if os.path.isfile(options.cert):
Jan 25 14:29:37 kjb01.dc01.example.com kojid[17529]: File "/usr/lib64/python2.7/genericpath.py", line 29, in isfile
Jan 25 14:29:37 kjb01.dc01.example.com kojid[17529]: st = os.stat(path)
Jan 25 14:29:37 kjb01.dc01.example.com kojid[17529]: TypeError: coercing to Unicode: need string or buffer, NoneType found
Jan 25 14:29:37 kjb01.dc01.example.com systemd[1]: kojid.service: main process exited, code=exited, status=1/FAILURE
Jan 25 14:29:37 kjb01.dc01.example.com systemd[1]: Unit kojid.service entered failed state.
Jan 25 14:29:37 kjb01.dc01.example.com systemd[1]: kojid.service failed.

I wonder if it happens with current master? In get_options is fallback which substitutes None with /etc/kojid/client.crt.

@tkopecek: Sorry for the huge delay in responding.

Yes, it still does happen even after applying 7fb7bd28a9aace20f432964776eb7f499c790e4b to the current version in EPEL7. The logic from that commit only changes the value from None if the file path defined in cert_defaults exists.

Resolved by #385. Sorry for not getting this in sooner.

Pull-Request has been closed by mikem

Metadata