Red Hat Bugzilla – Bug 1493756
cockpit fails with empty page when a link os-release is wrong
Last modified: 2018-04-10 11:58:30 EDT
Description of problem: a link /usr/lib/os-release may point to a wrong path. I do not know how but if I create instance in ci-rhos the link '/usr/lib/os-release' points to a wrong path '/usr/lib/os-release.d/os-release-rhel' instead of '/usr/lib/os.release.d/os-release-rhel'. cockpit runs but if I log-in I see just empty page. How reproducible: Everytime. [root@stoner-cockpit-test ~]# ls -al /usr/lib/os-release lrwxrwxrwx. 1 root root 30 18. zář 10.05 /usr/lib/os-release -> ./os-release.d/os-release-rhel [root@stoner-cockpit-test ~]# systemctl status -l cockpit.service ● cockpit.service - Cockpit Web Service Loaded: loaded (/usr/lib/systemd/system/cockpit.service; static; vendor preset: disabled) Active: active (running) since St 2017-09-20 15:58:53 EDT; 11min ago Docs: man:cockpit-ws(8) Process: 16629 ExecStartPre=/usr/sbin/remotectl certificate --ensure --user=root --group=cockpit-ws --selinux-type=etc_t (code=exited, status=0/SUCCESS) Main PID: 16631 (cockpit-ws) Tasks: 3 CGroup: /system.slice/cockpit.service ├─16631 /usr/libexec/cockpit-ws └─16642 /usr/bin/ssh-agent zář 20 15:58:53 stoner-cockpit-test systemd[1]: Started Cockpit Web Service. zář 20 15:58:53 stoner-cockpit-test cockpit-ws[16631]: Using certificate: /etc/cockpit/ws-certs.d/0-self-signed.cert zář 20 15:58:53 stoner-cockpit-test cockpit-ws[16631]: error loading contents of os-release: Failed to open file '/usr/lib/os-release': No such file or directory zář 20 15:59:08 stoner-cockpit-test cockpit-session[16637]: pam_ssh_add: Failed adding some keys
If you open dev console in a browser you can open a row in js file that throws an exception: function h(e, t) { var n, o = JSON.parse(window.localStorage["os-release"] || "{}"), r = c(e)[0]; if (r && (n = window.getComputedStyle(r)), n) { var a, i = n.content; return i && "none" != i && "normal" != i ? (a = i.length, ('"' === i[0] || "'" === i[0]) && a > 2 && i[a - 1] === i[0] && (i = i.substr(1, a - 2)), r.innerHTML = d.format(i, o) || t, c(r).text()) : void 0; } } And it points to a line with JSON.parse(window.localStorage["os-release"]...)
Fixing upstream: https://github.com/cockpit-project/cockpit/pull/7730
This will be fixed in 7.5 through rebasing Cockpit to upstream version 153. See bug 1470780.
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/RHBA-2018:0876