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 1820172 - "java-11-openjdk-headless" scriptlet failed during RHEL7 > RHEL8 upgrade transaction
Summary: "java-11-openjdk-headless" scriptlet failed during RHEL7 > RHEL8 upgrade tran...
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Red Hat Enterprise Linux 8
Classification: Red Hat
Component: java-11-openjdk
Version: 8.3
Hardware: Unspecified
OS: Unspecified
unspecified
unspecified
Target Milestone: rc
: 8.0
Assignee: jiri vanek
QA Contact: OpenJDK QA
URL:
Whiteboard:
Depends On:
Blocks: 1871709
TreeView+ depends on / blocked
 
Reported: 2020-04-02 12:17 UTC by Michal Reznik
Modified: 2023-10-06 19:34 UTC (History)
8 users (show)

Fixed In Version: java-11-openjdk-11.0.8.6-0.3.ea.el8
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
: 1871709 (view as bug list)
Environment:
Last Closed: 2020-11-04 02:43:53 UTC
Type: Bug
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)
first version of patch to deal with transition (1.43 KB, patch)
2020-04-30 14:38 UTC, jiri vanek
no flags Details | Diff

Description Michal Reznik 2020-04-02 12:17:59 UTC
Description of problem:

During RHEL7 > RHEL8 upgrade transaction "java-11-openjdk-headless" scriptlet fails and make the whole transaction to exit with non-zero status.

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

java-11-openjdk-headless-1:11.0.4.11-2.el8.x86_64

Steps to Reproduce:
1. install java-11-openjdk ( will install also java-11-openjdk-headless)
2. run # leapp upgrade

Actual results:

RHEL7 > RHEL8 transaction exits with non-zero exit code due to "java-11-openjdk-headless" scriptlet failed.

Expected results:

"java-11-openjdk-headless" scriptlet does not fail

Additional info:

Apr 02 12:06:49 localhost upgrade[572]: error: unpacking of archive failed on file /usr/lib/jvm/java-11-openjdk-11.0.4.11-2.el8.x86_64/conf: cpio: File from package already exists as a directory in system
Apr 02 12:06:49 localhost upgrade[572]: error: java-11-openjdk-headless-1:11.0.4.11-2.el8.x86_64: install failed


Apr 02 12:11:31 localhost upgrade[572]: Failed:
Apr 02 12:11:31 localhost upgrade[572]:   java-11-openjdk-headless-1:11.0.4.11-2.el8.x86_64
Apr 02 12:11:31 localhost upgrade[572]:   java-11-openjdk-headless-1:11.0.6.10-3.el7.x86_64

Comment 1 Andrew John Hughes 2020-04-03 04:23:22 UTC
Well, it's easy to tell what the issue is: RHEL 7's java-11-openjdk*/conf is a directory, while RHEL 8's is a symlink.

The question is how to fix this. The %pretrans part of the RPM that handles this is outsourced to the copy-jdk-configs script, so I'm reassigning the bug there. I suspect a check for conf being a directory is required, and to remove it if so, before the RPM installation stage runs.

Comment 2 jiri vanek 2020-04-03 08:56:32 UTC
hi!

I'm not sure this is error in our lua script or copy-jdk-configs pacakage.

This is known limitation of RPM. rpm is not able to upgrade package, where a directory changes to symlink. Thus in fedora we can do that only with new jdk, and in rhel we can do it only with new major version of rhel.

I'm afraid this is have to be solved in leap. Not in rpm, not in jdk, not in cop-jdk-configs.

Comment 3 Michal Bocek 2020-04-15 13:29:32 UTC
It's possible to deal with that in %pretrans. See:
- https://fedoraproject.org/wiki/Packaging:Directory_Replacement#Replacing_a_symlink_with_a_directory_or_a_directory_with_any_type_of_file
- https://bugzilla.redhat.com/show_bug.cgi?id=1703117

The java-11-openjdk-headless package is currently the only package that Leapp removes before the upgrade, in order to be able to upgrade the system: https://github.com/oamg/leapp-repository/pull/484.
The Leapp team will remove it from the "blacklist" as soon as the spec is fixed and shipped to public CDN.

Comment 4 jiri vanek 2020-04-15 14:20:31 UTC
(In reply to Michal Bocek from comment #3)
> It's possible to deal with that in %pretrans. See:
> -
> https://fedoraproject.org/wiki/Packaging:
> Directory_Replacement#Replacing_a_symlink_with_a_directory_or_a_directory_wit
> h_any_type_of_file
> - https://bugzilla.redhat.com/show_bug.cgi?id=1703117
> 
> The java-11-openjdk-headless package is currently the only package that
> Leapp removes before the upgrade, in order to be able to upgrade the system:
> https://github.com/oamg/leapp-repository/pull/484.
> The Leapp team will remove it from the "blacklist" as soon as the spec is
> fixed and shipped to public CDN.

I know that. I even posted that link to you via emails.
However jdk is NOT going to be fixed in that way, because we are doing much more dark magic with that config dir due to paralell install-ability feature.  Please workaorund it in leapp

Comment 5 Michal Bocek 2020-04-15 15:14:33 UTC
If you need Leapp to handle this particular issue instead of fixing it in the rpm spec, then we need you, the Java RHEL subsystem, to create a module(s) for that in Leapp. We call the Leapp modules "actors". Here's a guide on creating Leapp actors: https://leapp.readthedocs.io/en/latest/el7toel8/actor-rhel7-to-rhel8.html.
If there's any issue or you need to consult something, just ping mbocek or pstodulk on the internal IRC channel #leapp. Or write to the leapp-devel mailing list. We'll try to help/guide you.

Comment 6 Andrew John Hughes 2020-04-29 14:46:01 UTC
Would it be simpler to fix this locally in the RHEL 8 OpenJDK packages that need it, rather than in copy-jdk-configs?
The code Michal linked to looks easy enough to add to those packages, and making leapp work around it doesn't solve the problem for customers moving from RHEL 7 to RHEL 8.

It would be good to know how to easily reproduce this. The original report doesn't give much detail. Thanks.

Comment 9 jiri vanek 2020-04-29 15:12:53 UTC
(In reply to Andrew John Hughes from comment #6)
> Would it be simpler to fix this locally in the RHEL 8 OpenJDK packages that
> need it, rather than in copy-jdk-configs?
> The code Michal linked to looks easy enough to add to those packages, and
> making leapp work around it doesn't solve the problem for customers moving
> from RHEL 7 to RHEL 8.
> 
> It would be good to know how to easily reproduce this. The original report
> doesn't give much detail. Thanks.

Yes, we have to fix it in rhel8 packages,
The issue is, the lua script is sourced here.
So in internal spec lua script, we have to use the snipped I linked, and the source copy jdk configs. That is wy  was reluctant to do it as first option. Obviously, there is not much more options.

Comment 10 Deepak Bhole 2020-04-29 19:10:16 UTC
(In reply to jiri vanek from comment #9)
> (In reply to Andrew John Hughes from comment #6)
> > Would it be simpler to fix this locally in the RHEL 8 OpenJDK packages that
> > need it, rather than in copy-jdk-configs?
> > The code Michal linked to looks easy enough to add to those packages, and
> > making leapp work around it doesn't solve the problem for customers moving
> > from RHEL 7 to RHEL 8.
> > 
> > It would be good to know how to easily reproduce this. The original report
> > doesn't give much detail. Thanks.
> 
> Yes, we have to fix it in rhel8 packages,
> The issue is, the lua script is sourced here.
> So in internal spec lua script, we have to use the snipped I linked, and the
> source copy jdk configs. That is wy  was reluctant to do it as first option.
> Obviously, there is not much more options.

Will such a change break anything? If we can make rhel7-rhel8 upgrades smoother, I am all for it assuming it does not introduce any instability.

Comment 11 jiri vanek 2020-04-30 14:38:21 UTC
(In reply to Deepak Bhole from comment #10)
> (In reply to jiri vanek from comment #9)
> > (In reply to Andrew John Hughes from comment #6)
> > > Would it be simpler to fix this locally in the RHEL 8 OpenJDK packages that
> > > need it, rather than in copy-jdk-configs?
> > > The code Michal linked to looks easy enough to add to those packages, and
> > > making leapp work around it doesn't solve the problem for customers moving
> > > from RHEL 7 to RHEL 8.
> > > 
> > > It would be good to know how to easily reproduce this. The original report
> > > doesn't give much detail. Thanks.
> > 
> > Yes, we have to fix it in rhel8 packages,
> > The issue is, the lua script is sourced here.
> > So in internal spec lua script, we have to use the snipped I linked, and the
> > source copy jdk configs. That is wy  was reluctant to do it as first option.
> > Obviously, there is not much more options.
> 
> Will such a change break anything? If we can make rhel7-rhel8 upgrades
> smoother, I am all for it assuming it does not introduce any instability.

I dont know. I created an patch (currenlty not tested).  Really hard to judge consequences.

Comment 12 jiri vanek 2020-04-30 14:38:55 UTC
Created attachment 1683327 [details]
first version of patch to deal with transition

Comment 13 jiri vanek 2020-04-30 14:39:36 UTC
Note that the patch intentionally do not handel debug subpackages, whcih we do not ship via standart channels.

Comment 14 jiri vanek 2020-04-30 16:44:04 UTC
Created PR, https://src.osci.redhat.com/rpms/java-11-openjdk/pull-request/20 , am wondering how the build passes and what hte result will do...

Comment 15 jiri vanek 2020-05-01 17:49:05 UTC
ok. the patch do not work. Becausde by this.we are changing the files in *current* jdk, not in already intstalled ones (cursed be multiple installs!)

So another approach on this logic must be taken. Old JDK must be found first:(

Comment 16 jiri vanek 2020-05-20 08:37:30 UTC
i have updated the PR to try the symlink

Comment 17 jiri vanek 2020-06-02 13:21:13 UTC
The symlink approach moreover works. Now I'm trying to figure out, if we can do better. Afaik yes, because the original fedora scriplet is for packages not supporting parale-insallability (of course).

Next to   directrory NVR1/conf we add symlink NVR2/conf . However copy jdk configs copies the  directory of NVR1/conf to NVR2/conf to actually prettend that we do an override.

Comment 18 jiri vanek 2020-06-17 12:17:21 UTC
hi!

We have patch ready to fix this, and it is working as expected. (see PR)

There is small glitch with user experience, which is however expected as by fedora guidelines:

user have configs in /usr/lib/jvm/java-11-openjdk-VR1/conf directory.

Fedora guidelines are enforcing to backup this directory by mv before it is "repalced by symlink". So after update

user new have configs in /usr/lib/jvm/java-11-openjdk-VR2/conf symlink and old configs are stored in  /usr/lib/jvm/java-11-openjdk-VR2/conf.rpmmoved directory
/usr/lib/jvm/java-11-openjdk-VR1/ is removed properly.

Is it expected that user shold manually visit theirs configs?

All our configs are config(norepalce) so during usual updates of JDK, the user is expected to got not repalced his customised configs.

This can be additionally fixed in lua scriplet, but the scriplet is complicated already enough,

Comment 19 Michal Reznik 2020-06-19 10:40:36 UTC
Tried the upgrade using:

java-11-openjdk-11.0.8.1-0.0.ea.0.pr.1ade216037d44afe9a06ed036dad7dc9.c.11948.el8_2.x86_64
java-11-openjdk-headless-11.0.8.1-0.0.ea.0.pr.1ade216037d44afe9a06ed036dad7dc9.c.11948.el8_2.x86_64

and it passed.

Comment 35 Deepak Bhole 2020-08-10 16:07:30 UTC
Jiri, how controversial is the change? Is there a risk that things could break? If the fix is safe, I am +1 for putting it in 8.2 EUS

Comment 36 jiri vanek 2020-08-11 10:01:46 UTC
(In reply to Deepak Bhole from comment #35)
> Jiri, how controversial is the change? Is there a risk that things could
> break? If the fix is safe, I am +1 for putting it in 8.2 EUS

The first version was. Thats when the need info was raised.  In meantime I realised it can be done better. Second version of patch should be not controversial at all.

Comment 37 Michal Bocek 2020-08-17 12:55:40 UTC
Deepak or Jiri, please clone this BZ to introduce the fix to 8.2 EUS. Thanks.

Comment 38 Andrew John Hughes 2020-08-17 17:02:11 UTC
Michal, do we want 8.1.0 as well? If I recall correctly, I've been hitting this leapp failure on every RHEL 8 version but RHEL 8.0.0.

Let me know and I'll make the appropriate clones.

Comment 39 Michal Bocek 2020-08-17 17:18:04 UTC
Thank you. 8.1.0 is not needed. At least not because of upgrades because upgrades to 8.1 are not supported anymore.

Comment 45 errata-xmlrpc 2020-11-04 02:43:53 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 (java-11-openjdk bug fix and enhancement update), 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-2020:4657


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