Bug 1493756

Summary: cockpit fails with empty page when a link os-release is wrong
Product: Red Hat Enterprise Linux 7 Reporter: Jan Stavel <jstavel>
Component: cockpitAssignee: Peter <pvolpe>
Status: CLOSED ERRATA QA Contact: Jan Ščotka <jscotka>
Severity: unspecified Docs Contact:
Priority: unspecified    
Version: 7.5CC: mpitt
Target Milestone: rc   
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2018-04-10 15:58:14 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:

Description Jan Stavel 2017-09-20 20:12:14 UTC
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

Comment 2 Jan Stavel 2017-09-20 20:16:45 UTC
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"]...)

Comment 3 Peter 2017-09-21 20:45:31 UTC
Fixing upstream: https://github.com/cockpit-project/cockpit/pull/7730

Comment 4 Martin Pitt 2017-10-13 10:22:04 UTC
This will be fixed in 7.5 through rebasing Cockpit to upstream version 153. See bug 1470780.

Comment 9 errata-xmlrpc 2018-04-10 15:58:14 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/RHBA-2018:0876