Bug 1954998 - Installing java-11-openjdk-headless fails due to Error in PRETRANS scriptlet
Summary: Installing java-11-openjdk-headless fails due to Error in PRETRANS scriptlet
Keywords:
Status: CLOSED CURRENTRELEASE
Alias: None
Product: Fedora
Classification: Fedora
Component: java-11-openjdk
Version: 35
Hardware: Unspecified
OS: Unspecified
unspecified
unspecified
Target Milestone: ---
Assignee: jiri vanek
QA Contact: Fedora Extras Quality Assurance
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2021-04-29 08:55 UTC by Jan Pazdziora
Modified: 2023-11-27 16:40 UTC (History)
8 users (show)

Fixed In Version:
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
Environment:
Last Closed: 2021-09-06 11:08:54 UTC
Type: Bug
Embargoed:


Attachments (Terms of Use)

Description Jan Pazdziora 2021-04-29 08:55:41 UTC
Description of problem:

Installing java-11-openjdk-headless fails due to Error in PRETRANS scriptlet.

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

java-11-openjdk-headless-1:11.0.11.0.7-0.1.ea.fc35.x86_64

How reproducible:

Deterministic.

Steps to Reproduce:
1. dnf install -y java-11-openjdk-headless

Actual results:

Last metadata expiration check: 0:09:43 ago on Thu 29 Apr 2021 04:39:44 AM EDT.
Dependencies resolved.
=============================================================================================
 Package                    Arch    Version                   Repository                 Size
=============================================================================================
Installing:
 java-11-openjdk-headless   x86_64  1:11.0.11.0.7-0.1.ea.fc35 beaker-Fedora-Everything   38 M
Installing dependencies:
 alsa-lib                   x86_64  1.2.4-5.fc34              beaker-Fedora-Everything  474 k
 avahi-libs                 x86_64  0.8-10.fc35               beaker-Fedora-Everything   67 k
 copy-jdk-configs           noarch  3.7-8.fc34                beaker-Fedora-Everything   24 k
 cups-libs                  x86_64  1:2.3.3op2-4.fc35         beaker-Fedora-Everything  275 k
 freetype                   x86_64  2.10.4-3.fc34             beaker-Fedora-Everything  394 k
 graphite2                  x86_64  1.3.14-7.fc34             beaker-Fedora-Everything   95 k
 harfbuzz                   x86_64  2.8.0-1.fc35              beaker-Fedora-Everything  639 k
 javapackages-filesystem    noarch  5.3.0-15.fc34             beaker-Fedora-Everything   11 k
 lcms2                      x86_64  2.12-1.fc34               beaker-Fedora-Everything  171 k
 libjpeg-turbo              x86_64  2.1.0-1.fc35              beaker-Fedora-Everything  177 k
 libpng                     x86_64  2:1.6.37-10.fc35          beaker-Fedora-Everything  120 k
 lksctp-tools               x86_64  1.0.18-9.fc34             beaker-Fedora-Everything   92 k
 lua                        x86_64  5.4.3-1.fc35              beaker-Fedora-Everything  189 k
 lua-posix                  x86_64  35.0-3.fc34               beaker-Fedora-Everything  132 k
 tzdata-java                noarch  2021a-1.fc34              beaker-Fedora-Everything  158 k

Transaction Summary
=============================================================================================
Install  16 Packages

Total download size: 41 M
Installed size: 178 M
Downloading Packages:
(1/16): copy-jdk-configs-3.7-8.fc34.noarch.rpm  368 kB/s |  24 kB     00:00    
(2/16): avahi-libs-0.8-10.fc35.x86_64.rpm       690 kB/s |  67 kB     00:00    
(3/16): alsa-lib-1.2.4-5.fc34.x86_64.rpm        3.1 MB/s | 474 kB     00:00    
(4/16): cups-libs-2.3.3op2-4.fc35.x86_64.rpm    2.6 MB/s | 275 kB     00:00    
(5/16): graphite2-1.3.14-7.fc34.x86_64.rpm      1.8 MB/s |  95 kB     00:00    
(6/16): freetype-2.10.4-3.fc34.x86_64.rpm       2.8 MB/s | 394 kB     00:00    
(7/16): javapackages-filesystem-5.3.0-15.fc34.n 519 kB/s |  11 kB     00:00    
(8/16): harfbuzz-2.8.0-1.fc35.x86_64.rpm        4.1 MB/s | 639 kB     00:00    
(9/16): lcms2-2.12-1.fc34.x86_64.rpm            1.7 MB/s | 171 kB     00:00    
(10/16): libjpeg-turbo-2.1.0-1.fc35.x86_64.rpm  2.6 MB/s | 177 kB     00:00    
(11/16): libpng-1.6.37-10.fc35.x86_64.rpm       1.7 MB/s | 120 kB     00:00    
(12/16): lksctp-tools-1.0.18-9.fc34.x86_64.rpm  1.5 MB/s |  92 kB     00:00    
(13/16): lua-posix-35.0-3.fc34.x86_64.rpm       2.9 MB/s | 132 kB     00:00    
(14/16): lua-5.4.3-1.fc35.x86_64.rpm            1.8 MB/s | 189 kB     00:00    
(15/16): tzdata-java-2021a-1.fc34.noarch.rpm    3.1 MB/s | 158 kB     00:00    
(16/16): java-11-openjdk-headless-11.0.11.0.7-0  13 MB/s |  38 MB     00:02    
--------------------------------------------------------------------------------
Total                                            13 MB/s |  41 MB     00:03     
Running transaction check
Transaction check succeeded.
Running transaction test
Transaction test succeeded.
Running transaction
  Running scriptlet: copy-jdk-configs-3.7-8.fc34.noarch                     1/1 
  Running scriptlet: java-11-openjdk-headless-1:11.0.11.0.7-0.1.ea.fc35.x   1/1 
error: lua script failed: /var/lib/rpm-state//copy_jdk_configs.lua:43: attempt to index a nil value (global 'arg')

Error in PRETRANS scriptlet in rpm package java-11-openjdk-headless
  Preparing        :                                                        1/1 
  Installing       : tzdata-java-2021a-1.fc34.noarch                       1/16 
  Installing       : lua-posix-35.0-3.fc34.x86_64                          2/16 
  Installing       : lua-5.4.3-1.fc35.x86_64                               3/16 
  Installing       : copy-jdk-configs-3.7-8.fc34.noarch                    4/16 
  Installing       : lksctp-tools-1.0.18-9.fc34.x86_64                     5/16 
  Installing       : libpng-2:1.6.37-10.fc35.x86_64                        6/16 
  Installing       : libjpeg-turbo-2.1.0-1.fc35.x86_64                     7/16 
  Installing       : lcms2-2.12-1.fc34.x86_64                              8/16 
  Installing       : javapackages-filesystem-5.3.0-15.fc34.noarch          9/16 
  Installing       : graphite2-1.3.14-7.fc34.x86_64                       10/16 
  Installing       : harfbuzz-2.8.0-1.fc35.x86_64                         11/16 
  Installing       : freetype-2.10.4-3.fc34.x86_64                        12/16 
  Installing       : avahi-libs-0.8-10.fc35.x86_64                        13/16 
  Installing       : cups-libs-1:2.3.3op2-4.fc35.x86_64                   14/16 
  Installing       : alsa-lib-1.2.4-5.fc34.x86_64                         15/16 
  Running scriptlet: copy-jdk-configs-3.7-8.fc34.noarch                   15/16 
error: java-11-openjdk-headless-1:11.0.11.0.7-0.1.ea.fc35.x86_64: install skipped

  Running scriptlet: alsa-lib-1.2.4-5.fc34.x86_64                         15/16 
  Verifying        : alsa-lib-1.2.4-5.fc34.x86_64                          1/16 
  Verifying        : avahi-libs-0.8-10.fc35.x86_64                         2/16 
  Verifying        : copy-jdk-configs-3.7-8.fc34.noarch                    3/16 
  Verifying        : cups-libs-1:2.3.3op2-4.fc35.x86_64                    4/16 
  Verifying        : freetype-2.10.4-3.fc34.x86_64                         5/16 
  Verifying        : graphite2-1.3.14-7.fc34.x86_64                        6/16 
  Verifying        : harfbuzz-2.8.0-1.fc35.x86_64                          7/16 
  Verifying        : java-11-openjdk-headless-1:11.0.11.0.7-0.1.ea.fc35    8/16 
  Verifying        : javapackages-filesystem-5.3.0-15.fc34.noarch          9/16 
  Verifying        : lcms2-2.12-1.fc34.x86_64                             10/16 
  Verifying        : libjpeg-turbo-2.1.0-1.fc35.x86_64                    11/16 
  Verifying        : libpng-2:1.6.37-10.fc35.x86_64                       12/16 
  Verifying        : lksctp-tools-1.0.18-9.fc34.x86_64                    13/16 
  Verifying        : lua-5.4.3-1.fc35.x86_64                              14/16 
  Verifying        : lua-posix-35.0-3.fc34.x86_64                         15/16 
  Verifying        : tzdata-java-2021a-1.fc34.noarch                      16/16Error: Transaction failed
 

Installed:
  alsa-lib-1.2.4-5.fc34.x86_64                                                  
  avahi-libs-0.8-10.fc35.x86_64                                                 
  copy-jdk-configs-3.7-8.fc34.noarch                                            
  cups-libs-1:2.3.3op2-4.fc35.x86_64                                            
  freetype-2.10.4-3.fc34.x86_64                                                 
  graphite2-1.3.14-7.fc34.x86_64                                                
  harfbuzz-2.8.0-1.fc35.x86_64                                                  
  javapackages-filesystem-5.3.0-15.fc34.noarch                                  
  lcms2-2.12-1.fc34.x86_64                                                      
  libjpeg-turbo-2.1.0-1.fc35.x86_64                                             
  libpng-2:1.6.37-10.fc35.x86_64                                                
  lksctp-tools-1.0.18-9.fc34.x86_64                                             
  lua-5.4.3-1.fc35.x86_64                                                       
  lua-posix-35.0-3.fc34.x86_64                                                  
  tzdata-java-2021a-1.fc34.noarch                                               
Failed:
  java-11-openjdk-headless-1:11.0.11.0.7-0.1.ea.fc35.x86_64                     

Expected results:

No package marked as failed install.

Additional info:

Comment 2 Jan Pazdziora 2021-04-29 08:57:13 UTC
On Fedora 34, the package java-11-openjdk-headless-1:11.0.11.0.9-0.fc34.x86_64 installs just fine, so this is a regression. Well, the issue seems to be that the version in rawhide is for some reason older than the one in Fedora 34.

Comment 3 Jan Pazdziora 2021-04-29 09:04:53 UTC
However, an attempt to install the Fedora 35 11.0.11.0.9 build from koji
https://kojipkgs.fedoraproject.org//packages/java-11-openjdk/11.0.11.0.9/0.fc35/$( uname -i )/java-11-openjdk-headless-11.0.11.0.9-0.fc35.$( uname -i ).rpm
fails as well:

Installing:
 java-11-openjdk-headless  x86_64  1:11.0.11.0.9-0.fc35     @commandline   38 M
Installing dependencies:
 alsa-lib                  x86_64  1.2.4-5.fc34             rawhide       474 k
 avahi-libs                x86_64  0.8-10.fc35              rawhide        67 k
[...]
  Running scriptlet: copy-jdk-configs-3.7-8.fc34.noarch                     1/1 
  Running scriptlet: java-11-openjdk-headless-1:11.0.11.0.9-0.fc35.x86_64   1/1 
error: lua script failed: /var/lib/rpm-state//copy_jdk_configs.lua:43: attempt to index a nil value (global 'arg')

Error in PRETRANS scriptlet in rpm package java-11-openjdk-headless
  Preparing        :                                                        1/1 
  Installing       : tzdata-java-2021a-1.fc34.noarch                       1/18 
  Installing       : lua-posix-35.0-3.fc34.x86_64                          2/18 
  Installing       : lua-5.4.2-2.fc34.x86_64                               3/18 
  Installing       : copy-jdk-configs-3.7-8.fc34.noarch                    4/18 
[...]
  tzdata-java-2021a-1.fc34.noarch                                               
Failed:
  java-11-openjdk-headless-1:11.0.11.0.9-0.fc35.x86_64

Comment 4 jiri vanek 2021-04-30 11:49:01 UTC
Fixed via 1892224

*** This bug has been marked as a duplicate of bug 1892224 ***

Comment 5 Jan Pokorný [poki] 2021-05-03 13:33:00 UTC
Daring to reopen, there are still some impediments that can be
considered integral to the original problem reported, since the
outcome remains the same per $SUBJ, only the crashing point is
presumably somewhere further in the installation/update process.
(Also this immediate subsequence can hopefully justify following
up with this bug and not creating a new one.)

My case in point -- RPM transaction including these (symbolically):

-copy-jdk-configs-3.7-8.fc34.noarch
-java-11-openjdk-headless-1:11.0.11.0.7-0.1.ea.fc35.x86_64

+copy-jdk-configs-4.0-0.fc35.noarch
+java-11-openjdk-headless-1:11.0.11.0.9-2.fc35.x86_64

Which choked on:

> [...]
> 
> Running transaction check
> Transaction check succeeded.
> Running transaction test
> Transaction test succeeded.
> Running transaction
>   Running scriptlet: copy-jdk-configs-4.0-0.fc35.noarch                         1/1
>   Running scriptlet: java-11-openjdk-headless-1:11.0.11.0.9-2.fc35.x86_64       1/1
> error: lua script failed: /var/lib/rpm-state//copy_jdk_configs.lua:215: bad argument #1 to 'gsub' (string expected, got nil)
> 
> Error in PRETRANS scriptlet in rpm package java-11-openjdk-headless
> 
> [...]
> 
>   Cleanup          : [...]
> error: java-11-openjdk-headless-1:11.0.11.0.9-2.fc35.x86_64: install skipped
>   Cleanup          : [...]
> 
> [...]
> 
>   Cleanup          : [...]
> error: java-11-openjdk-headless-1:11.0.11.0.7-0.1.ea.fc35.x86_64: erase skipped
>   Cleanup          : [...]

It seems that this time around, the exact offender is:
https://pagure.io/copy_jdk_configs/blob/88d3ed89f30d8b0eb4877d860fa8d951f224f156/f/copy_jdk_configs.lua#_215

214    --trasnform substitute names to lua patterns
215    local name = string.gsub(string.gsub(origname, "%-", "%%-"), "%.", "%%.")
216    local javaver = string.gsub(origjavaver, "%.", "%%.")

More testing put into update scenarios would be appreciated.

Thanks.

P.S. s/trasnform/transform/

Comment 6 jiri vanek 2021-05-03 16:45:09 UTC
Hi. Thanx for report.

I had tested various cases, see: https://bugzilla.redhat.com/show_bug.cgi?id=1892224#c15
But not the one  with change in numberin fc release "fcXY.noarch"

I hope that once updates for f34 and f33 goes out, this will no longer appear. Thanx again for this indeed unexpected cornercase.

Comment 7 Jan Pokorný [poki] 2021-05-04 07:18:16 UTC
Hmm, with copy-jdk-configs downgraded again, to replicate the previous attempt
from the same starting line):

> Running transaction check
> Transaction check succeeded.
> Running transaction test
> Transaction test succeeded.
> Running transaction
>   Running scriptlet: copy-jdk-configs-4.0-0.fc35.noarch                         1/1 
>   Running scriptlet: java-11-openjdk-headless-1:11.0.11.0.9-2.fc35.x86_64       1/1 
>   Preparing        :                                                            1/1 
>   Upgrading        : copy-jdk-configs-4.0-0.fc35.noarch                         1/4 
>   Upgrading        : java-11-openjdk-headless-1:11.0.11.0.9-2.fc35.x86_64       2/4 
> warning: /etc/java/java-11-openjdk/java-11-openjdk-11.0.11.0.9-2.fc35.x86_64/conf/security/java.security created as /etc/java/java-11-openjdk/java-11-openjdk-11.0.11.0.9-2.fc35.x86_64/conf/security/java.security.rpmnew
> 
>   Running scriptlet: java-11-openjdk-headless-1:11.0.11.0.9-2.fc35.x86_64       2/4 
> restored /etc/java/java-11-openjdk/java-11-openjdk-11.0.11.0.9-2.fc35.x86_64/conf/security/java.security.rpmnew to /etc/java/java-11-openjdk/java-11-openjdk-11.0.11.0.9-2.fc35.x86_64/conf/security/java.security
> 
>   Cleanup          : java-11-openjdk-headless-1:11.0.11.0.7-0.1.ea.fc35.x86_6   3/4 
>   Running scriptlet: java-11-openjdk-headless-1:11.0.11.0.7-0.1.ea.fc35.x86_6   3/4 
>   Cleanup          : copy-jdk-configs-3.7-8.fc34.noarch                         4/4 
>   Running scriptlet: copy-jdk-configs-4.0-0.fc35.noarch                         4/4 
>   Running scriptlet: copy-jdk-configs-3.7-8.fc34.noarch                         4/4 
>   Verifying        : copy-jdk-configs-4.0-0.fc35.noarch                         1/4 
>   Verifying        : copy-jdk-configs-3.7-8.fc34.noarch                         2/4 
>   Verifying        : java-11-openjdk-headless-1:11.0.11.0.9-2.fc35.x86_64       3/4 
>   Verifying        : java-11-openjdk-headless-1:11.0.11.0.7-0.1.ea.fc35.x86_6   4/4 
> 
> Upgraded:
>   copy-jdk-configs-4.0-0.fc35.noarch                                                
>   java-11-openjdk-headless-1:11.0.11.0.9-2.fc35.x86_64

Some subtle side-effects are apparently involved, which might explain why
you haven't met that other problem I reported.

Alas, I can't tell which these are (pre-existing files, or generally a slightly
different state of the system, perhaps based on the previously failed update
or caused with a prior copy-jdk-configs downgrade, ...).

... in fact ...

Might also be caused with rpm being updated in that very failing transaction,
since it also included:

>    Upgrade  rpm-4.16.90-0.git15395.5.fc35.x86_64                                @rawhide
>    Upgraded rpm-4.16.1.3-1.fc35.x86_64                                          @@System

Hence, it looks like more work would be needed to have a satisfactory
solution for this, e.g.:

- conditionalize per RPM version from underlying Lua script
  (does RPM export some API to Lua scripting to fetch it?)

Anyway, seems very unfortunate that RPM broke the compatibility
if I am right in this assessment -- something particular package(r)s
would be mere hostages of.

Comment 8 Jan Pokorný [poki] 2021-05-04 07:21:35 UTC
> Anyway, seems very unfortunate that RPM broke the compatibility
> if I am right in this assessment -- something particular package(r)s
> would be mere hostages of.

The same applicable to Lua, for that matter -- also part of the
previously failing transaction:

>    Upgrade  lua-5.4.3-1.fc35.x86_64                                             @rawhide
>    Upgraded lua-5.4.2-2.fc34.x86_64                                             @@System
>    Upgrade  lua-libs-5.4.3-1.fc35.x86_64                                        @rawhide
>    Upgraded lua-libs-5.4.2-2.fc34.x86_64                                        @@System

Comment 9 jiri vanek 2021-05-04 13:07:08 UTC
Hmm. Thanx a lot for investigations. From your description, i rtreally hope that it was an accidetnal glitch, esepcially because rawhide included.
If I consider the standart f34->f35 update, then definitely there will not be an cjc bump. But I will definitelytry few f34->f35 rounds. 
Again thanx a lot for digging.

Comment 10 Ben Cotton 2021-08-10 13:00:16 UTC
This bug appears to have been reported against 'rawhide' during the Fedora 35 development cycle.
Changing version to 35.

Comment 11 jiri vanek 2021-09-06 11:08:54 UTC
Hello!
Quite a lot of change don post scriplets of CJC and JDK. The issue seems to be gone

Comment 12 Chralazardi 2023-11-27 16:40:04 UTC
Hello, I've encountered a similar issue while installing java 11 on a new workstation in my class. I can't figure it out, as I haven't encountered this before. Usually I turn to https://essays.edubirdie.com/java-assignment but in this case, it's a local computer, and I was recommended to look for solutions here. Am I correct in understanding that only upgrading to version 35 resolves the issue? I'm more accustomed to version 34.


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