RHEL Engineering is moving the tracking of its product development work on RHEL 6 through RHEL 9 to Red Hat Jira (issues.redhat.com). If you're a Red Hat customer, please continue to file support cases via the Red Hat customer portal. If you're not, please head to the "RHEL project" in Red Hat Jira and file new tickets here. Individual Bugzilla bugs in the statuses "NEW", "ASSIGNED", and "POST" are being migrated throughout September 2023. Bugs of Red Hat partners with an assigned Engineering Partner Manager (EPM) are migrated in late September as per pre-agreed dates. Bugs against components "kernel", "kernel-rt", and "kpatch" are only migrated if still in "NEW" or "ASSIGNED". If you cannot log in to RH Jira, please consult article #7032570. That failing, please send an e-mail to the RH Jira admins at rh-issues@redhat.com to troubleshoot your issue as a user management inquiry. The email creates a ServiceNow ticket with Red Hat. Individual Bugzilla bugs that are migrated will be moved to status "CLOSED", resolution "MIGRATED", and set with "MigratedToJIRA" in "Keywords". The link to the successor Jira issue will be found under "Links", have a little "two-footprint" icon next to it, and direct you to the "RHEL project" in Red Hat Jira (issue links are of type "https://issues.redhat.com/browse/RHEL-XXXX", where "X" is a digit). This same link will be available in a blue banner at the top of the page informing you that that bug has been migrated.
Bug 1399770 - rpm-ostree install fails due to missing os-release
Summary: rpm-ostree install fails due to missing os-release
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Red Hat Enterprise Linux 7
Classification: Red Hat
Component: rpm-ostree-client
Version: 7.3
Hardware: Unspecified
OS: Unspecified
unspecified
unspecified
Target Milestone: rc
: ---
Assignee: Colin Walters
QA Contact: atomic-bugs@redhat.com
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2016-11-29 17:12 UTC by Michael Nguyen
Modified: 2016-12-06 21:02 UTC (History)
2 users (show)

Fixed In Version:
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
Environment:
Last Closed: 2016-12-06 21:02:15 UTC
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
Red Hat Product Errata RHBA-2016:2864 0 normal SHIPPED_LIVE ostree and rpm-ostree bug fix and enhancement update 2016-12-07 02:01:34 UTC

Description Michael Nguyen 2016-11-29 17:12:44 UTC
Description of problem:
Receiving the following error while running rpm-ostree install:
  error: Could not find os-release in etc/ nor in usr/lib under source root 

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


How reproducible:
Always

Steps to Reproduce:
[cloud-user@rhelah ~]$ sudo rpm-ostree install wget
Checking out tree 93050f5... done
error: Could not find os-release in etc/ nor in usr/lib under source root '/proc/self/fd/24/tmp/rpmostree-commit-J9V2RY'
[cloud-user@rhelah ~]$ cat /etc/os-release 
NAME="Red Hat Enterprise Linux Atomic Host"
VERSION="7.3"
ID="rhel"
ID_LIKE="fedora"
VARIANT="Atomic Host"
VARIANT_ID=atomic.host
VERSION_ID="7.3"
PRETTY_NAME="Red Hat Enterprise Linux Atomic Host 7.3"
ANSI_COLOR="0;31"
CPE_NAME="cpe:/o:redhat:enterprise_linux:7.3:GA:atomic-host"
HOME_URL="https://www.redhat.com/"
BUG_REPORT_URL="https://bugzilla.redhat.com/"

REDHAT_BUGZILLA_PRODUCT="Red Hat Enterprise Linux 7"
REDHAT_BUGZILLA_PRODUCT_VERSION=7.3
REDHAT_SUPPORT_PRODUCT="Red Hat Enterprise Linux"
REDHAT_SUPPORT_PRODUCT_VERSION=7.3



Actual results:
error: Could not find os-release in etc/ nor in usr/lib under source root 

Expected results:
package is installed

Additional info:
rhel-atomic-host-ostree:rhel-atomic-host/7/x86_64/standard
       Version: 7.3.1 (2016-11-28 16:36:31)
        Commit: 93050f5ea207511a834f8d1bd19740fb7175940876b6d8858f5713fadc9f50eb
        OSName: rhel-atomic-host

rpm-ostree-client-2016.11-2.atomic.el7.x86_64

Comment 2 Colin Walters 2016-11-29 18:26:09 UTC
Testing this now if anyone else wants to eyeball it:

diff --git a/redhat-release-atomic-host.spec b/redhat-release-atomic-host.spec
index 21cd874..effbd7e 100644
--- a/redhat-release-atomic-host.spec
+++ b/redhat-release-atomic-host.spec
@@ -5,7 +5,7 @@
 %define variant_titlecase Atomic Host
 %define variant_titlecase_concat AtomicHost
 %define variant_lowercase atomic-host
-%define release_pkg_version 20160824.0
+%define release_pkg_version 20161129.0
 %define base_release_version 7
 %define full_release_version 7.3
 %define dist_release_version 7
@@ -14,7 +14,7 @@
 
 Name:           redhat-release-atomic-host
 Version:        %{full_release_version}
-Release:        %{release_pkg_version}.atomic%{?dist}.3
+Release:        %{release_pkg_version}.atomic%{?dist}.4
 Summary:        %{product_family}%{?variant_titlecase: %{variant_titlecase}} release file
 Group:          System Environment/Base
 License:        GPLv2
@@ -42,17 +42,19 @@ rm -rf %{buildroot}
 
 # create /etc
 mkdir -p %{buildroot}/etc
+mkdir -p %{buildroot}/usr/lib/
 
 mkdir -p %{buildroot}/etc/pki/product
 cp %{SOURCE3} %{buildroot}/etc/pki/product/271.pem
 cp %{SOURCE4} %{buildroot}/etc/pki/product/69.pem
 
 # create /etc/system-release and /etc/redhat-release
-echo "%{product_family}%{?variant_titlecase: %{variant_titlecase}} release %{full_release_version}%{?beta: %{beta}}" > %{buildroot}/etc/redhat-release
-ln -s redhat-release %{buildroot}/etc/system-release
+echo "%{product_family}%{?variant_titlecase: %{variant_titlecase}} release %{full_release_version}%{?beta: %{beta}}" > %{buildroot}/usr/lib/redhat-release
+ln -s ../usr/lib/redhat-release %{buildroot}/etc/system-release
+ln -s ../usr/lib/redhat-release %{buildroot}/etc/redhat-release
 
 # create /etc/os-release
-cat << EOF >>%{buildroot}/etc/os-release
+cat << EOF >>%{buildroot}/usr/lib/os-release
 NAME="%{product_family}%{?variant_titlecase: %{variant_titlecase}}"
 VERSION="%{full_release_version}"
 ID="rhel"
@@ -71,8 +73,10 @@ REDHAT_BUGZILLA_PRODUCT_VERSION=%{full_release_version}
 REDHAT_SUPPORT_PRODUCT="%{product_family}"
 REDHAT_SUPPORT_PRODUCT_VERSION=%{full_release_version}
 EOF
+ln -s ../usr/lib/os-release %{buildroot}/etc/os-release
 # write cpe to /etc/system/release-cpe
-echo "cpe:/o:redhat:enterprise_linux:%{full_release_version}:%{?beta:beta}%{!?beta:GA}%{?variant_lowercase::%{variant_lowercase}}" | tr [A-Z] [a-z] > %{buildroot}/etc/system-release-cpe
+echo "cpe:/o:redhat:enterprise_linux:%{full_release_version}:%{?beta:beta}%{!?beta:GA}%{?variant_lowercase::%{variant_lowercase}}" | tr [A-Z] [a-z] > %{buildroot}/usr/lib/system-release-cpe
+ln -s ../usr/lib/system-release-cpe %{buildroot}/etc/system-release-cpe
 
 # create /etc/issue and /etc/issue.net
 echo '\S' > %{buildroot}/etc/issue
@@ -137,6 +141,9 @@ rm -rf %{buildroot}
 %defattr(0644,root,root,0755)
 /etc/redhat-release
 /etc/system-release
+%{_prefix}/lib/os-release
+%{_prefix}/lib/redhat-release
+%{_prefix}/lib/system-release-cpe
 %config(noreplace) /etc/os-release
 %config /etc/system-release-cpe
 %config(noreplace) /etc/issue
@@ -156,6 +163,11 @@ rm -rf %{buildroot}
 %dir /etc/cockpit/ws-certs.d
 
 %changelog
+* Tue Nov 29 2016 walters - 7.3-20161129.0.atomic.el7.4
+- Switch to /usr/lib/os-release to work around
+  https://github.com/rpm-software-management/libhif/pull/215
+  Resolves: #1399770
+
 * Wed Aug 24 2016 Colin Walters <walters>
 - Update version, add VARIANT/VARIANT_ID; see
   https://github.com/CentOS/sig-atomic-buildscripts/issues/61

Comment 3 Micah Abbott 2016-11-29 18:42:33 UTC
(In reply to Colin Walters from comment #2)
> Testing this now if anyone else wants to eyeball it:

My eyeballs say LGTM

Comment 5 Micah Abbott 2016-11-29 20:29:35 UTC
I tried to 'ostree admin unlock && rpm -Uhv' the new 'redhat-release-atomic-host' package to verify the fix, but that didn't seem to work.

However, after making a custom compose with the new package and rebasing to it I was able to successfully 'rpm-ostree install' a package again.

Comment 8 errata-xmlrpc 2016-12-06 21:02:15 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-2016:2864


Note You need to log in before you can comment on or make changes to this bug.