Bug 1608828 - [downstream clone - 4.2.6] Unable to perform upgrade from 4.1 to 4.2 due to selinux related errors.
Summary: [downstream clone - 4.2.6] Unable to perform upgrade from 4.1 to 4.2 due to s...
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Red Hat Enterprise Virtualization Manager
Classification: Red Hat
Component: ovirt-engine
Version: 4.1.11
Hardware: x86_64
OS: Linux
high
high
Target Milestone: ovirt-4.2.6
: ---
Assignee: Yedidyah Bar David
QA Contact: Jiri Belka
URL:
Whiteboard:
Depends On: 1594615
Blocks:
TreeView+ depends on / blocked
 
Reported: 2018-07-26 11:03 UTC by RHV bug bot
Modified: 2019-04-28 10:09 UTC (History)
12 users (show)

Fixed In Version: ovirt-engine-4.2.6
Doc Type: Bug Fix
Doc Text:
Under certain conditions an issue with a change in selinux policy, and the script that converts a selinux policy in the old format to the new format of the selinux policy, causes the engine-setup upgrade to postgresql to fail for upgrades from 4.1.to 4.2. In this release, engine-setup checks for this issue, and aborts the upgrade with a clear error message. To prevent this, reinstall the rh-postgresql95-runtime package by running 'yum reinstall rh-postgresql95-runtime', then run engine-setup again.
Clone Of: 1594615
Environment:
Last Closed: 2018-09-04 13:41:42 UTC
oVirt Team: Integration
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
Red Hat Product Errata RHBA-2018:2623 0 None None None 2018-09-04 13:42:30 UTC
oVirt gerrit 93147 0 master MERGED packaging: setup: postgres95: Verify selinux file contexts 2020-05-12 13:16:42 UTC
oVirt gerrit 93313 0 ovirt-engine-4.2 MERGED packaging: setup: postgres95: Verify selinux file contexts 2020-05-12 13:16:43 UTC

Description RHV bug bot 2018-07-26 11:03:49 UTC
+++ This bug is a downstream clone. The original bug is: +++
+++   bug 1594615 +++
======================================================================

Description of problem:

Trying to perform an upgrade from RHV 4.1.11 to RHV 4.2.3 which fails due to rh-postgresql95-postgresql unable to create pid file reporting permission denied errors. The RHV manager server runs with selinux in enforcing mode. 

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

ovirt-engine-4.1.11.2-0.1.el7.noarch
ovirt-engine-setup-4.2.3.8-0.1.el7.noarch
rh-postgresql95-postgresql-server-9.5.9-1.el7.x86_64


How reproducible:

Always 

Steps to Reproduce:

1. yum update  ovirt\*setup\*

2. engine-setup fails with below error

[ INFO  ] Upgrading PostgreSQL
[ INFO  ] PostgreSQL has been successfully upgraded, starting the new instance (rh-postgresql95-postgresql).
[ ERROR ] Failed to execute stage 'Misc configuration': Failed to start service 'rh-postgresql95-postgresql'
[ INFO  ] Yum Performing yum transaction rollback
[ INFO  ] Rolling back to the previous PostgreSQL instance (postgresql).
[ INFO  ] Stage: Clean up
          Log file is located at /var/log/ovirt-engine/setup/ovirt-engine-setup-20180625105843-tdlb6n.log
[ INFO  ] Generating answer file '/var/lib/ovirt-engine/setup/answers/20180625110214-setup.conf'
[ INFO  ] Stage: Pre-termination
[ INFO  ] Stage: Termination
[ ERROR ] Execution of setup failed


3. selinux errors reported due to [2]  (check audit.log attachment)

4. Try to add the exception using 

ausearch -c 'postgres' --raw | audit2allow -M my-postgres
semodule -i my-postgres.pp



Actual results:

Fails with permission denied errors. 

Expected results:

To complete the update to RHV 4.2 

Additional info:

(Originally by Ribu Abraham)

Comment 6 RHV bug bot 2018-07-26 11:04:18 UTC
This seems similar to bug 1518253. Can you try if running 'yum reinstall rh-postgresql95-runtime' resolves the issue?

(Originally by Ondra Machacek)

Comment 7 RHV bug bot 2018-07-26 11:04:23 UTC
(In reply to Ondra Machacek from comment #5)
> This seems similar to bug 1518253. Can you try if running 'yum reinstall
> rh-postgresql95-runtime' resolves the issue?

Hi ,

It worked for me after doing a reinstall of the package again.

Ribu

(Originally by Ribu Abraham)

Comment 8 RHV bug bot 2018-07-26 11:04:28 UTC
If it's indeed fully reproducible, might try again to debug this - and open a bug on selinux policy and/or postgresql.

At the time, we didn't manage to reproduce, thus made bug 1518253 a known issue.

If we fail to reproduce, but still want a workaround, that's an option too.

Please see the discussion on bug 1518253 and try to provide as many relevant details as possible, including:

What state did you start from? Is this a new system, or upgraded from older ones (seems like < 7.3 seems to be relevant)?

Was it rebooted, or not, during an upgrade process?

Etc.

(Originally by didi)

Comment 9 RHV bug bot 2018-07-26 11:04:33 UTC
(In reply to Yedidyah Bar David from comment #7)
> If it's indeed fully reproducible, might try again to debug this - and open
> a bug on selinux policy and/or postgresql.
> 
> At the time, we didn't manage to reproduce, thus made bug 1518253 a known
> issue.
> 
> If we fail to reproduce, but still want a workaround, that's an option too.
> 
> Please see the discussion on bug 1518253 and try to provide as many relevant
> details as possible, including:
> 
> What state did you start from? Is this a new system, or upgraded from older
> ones (seems like < 7.3 seems to be relevant)?
> 
> Was it rebooted, or not, during an upgrade process?
> 
> Etc.

Based on the requested information. This is a fresh 4.1 install on RHEL 7.4 . The machine didn't require a reboot as there was no kernel update. The error on first try received for selinux has been attached for your information.

(Originally by Ribu Abraham)

Comment 11 RHV bug bot 2018-07-26 11:04:44 UTC
Ribu, thanks for the update, but this isn't enough - we already have this information in bug 1518253. "Reproducible" means you can provide this:

1. Cleanly install a machine with RHEL
2. ?
3. ?
4. ?
5. Get this error

If you can't, I will sadly have to close this as a duplicate.

If you can attach a sosreport, it might help too - although, as I said, we already spent quite some time on a real machine demonstrating this behavior but still failed to reproduce. Thanks.

(Originally by didi)

Comment 12 RHV bug bot 2018-07-26 11:04:50 UTC
(In reply to Yedidyah Bar David from comment #10)
> Ribu, thanks for the update, but this isn't enough - we already have this
> information in bug 1518253. "Reproducible" means you can provide this:
> 
> 1. Cleanly install a machine with RHEL
> 2. ?
> 3. ?
> 4. ?
> 5. Get this error
> 
> If you can't, I will sadly have to close this as a duplicate.
> 
> If you can attach a sosreport, it might help too - although, as I said, we
> already spent quite some time on a real machine demonstrating this behavior
> but still failed to reproduce. Thanks.

I have tried to recreate the issue for which it works for me at the moment based on a fresh install of RHEL 7 followed by RHV 4.1 setup and upgrade to 4.2. The issue for Postgres SELinux related errors no longer shows up 

Ribu

(Originally by Ribu Abraham)

Comment 14 RHV bug bot 2018-07-26 11:05:00 UTC
Decided to "fix" by making engine-setup check this and fail, with a message suggesting a workaround.

Still not sure how to reproduce. For how I "reproduced" and verified, see my comment starting with "Verified by:" in gerrit:

https://gerrit.ovirt.org/93147

If someone does manage to come up with a real reproducer, not involving zeroing out file_contexts.subs , I suggest to reopen bug 1518599, if you want.

(Originally by didi)

Comment 16 Sandro Bonazzola 2018-08-02 08:02:47 UTC
This can be tested with 4.2 nightly: latest engine published there is currently 
ovirt-engine-4.2.6.1-0.0.master.20180801123732.git9367424.el7
which includes this fix.

Comment 17 Jiri Belka 2018-08-14 13:31:51 UTC
ok

upgrade to 4.2.6.0-1 without any problem

May 30 13:51:11 Installed: ovirt-engine-4.1.11.2-0.1.el7.noarch
Aug 14 15:29:11 Installed: ovirt-engine-4.2.6-0.1.el7ev.noarch

Comment 18 Emma Heftman 2018-08-23 12:08:28 UTC
Didi
With regard to the doc text, if this bug is a duplicate, does this mean I can use this part of the doc text from bug 1518253:

To prevent this, reinstall the rh-postgresql95-runtime package by running 'yum reinstall rh-postgresql95-runtime', then run engine-setup again.

Comment 19 Yedidyah Bar David 2018-08-26 05:35:45 UTC
(In reply to Emma Heftman from comment #18)
> Didi
> With regard to the doc text, if this bug is a duplicate, does this mean I
> can use this part of the doc text from bug 1518253:
> 
> To prevent this, reinstall the rh-postgresql95-runtime package by running
> 'yum reinstall rh-postgresql95-runtime', then run engine-setup again.

Yes.

We didn't fix the issue, because we failed to reproduce. The only change here is that the failure will be sooner, and with this message:

 [ INFO  ] Verifying PostgreSQL SELinux file context rules
 [ ERROR ] SELinux file context rules for PostgreSQL are missing

           SELinux file context rules for PostgreSQL are missing.
           For more information, see: https://bugzilla.redhat.com/1518599 .
           You can try fixing this by running this command:

           # yum reinstall rh-postgresql95-runtime

           Then you can try running Setup again.
 [ ERROR ] Failed to execute stage 'Environment customization': SELinux file context rules for PostgreSQL are missing

Comment 21 errata-xmlrpc 2018-09-04 13:41:42 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:2623


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