Bug 1841851 - error: lua script failed: [string "%prein(crypto-policies-20200527-3.gitb234a47.fc33.noarch)"]:19: attempt to call a nil value
Summary: error: lua script failed: [string "%prein(crypto-policies-20200527-3.gitb234a...
Keywords:
Status: CLOSED RAWHIDE
Alias: None
Product: Fedora
Classification: Fedora
Component: crypto-policies
Version: rawhide
Hardware: Unspecified
OS: Unspecified
unspecified
unspecified
Target Milestone: ---
Assignee: Red Hat Crypto Team
QA Contact: Fedora Extras Quality Assurance
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2020-05-29 16:14 UTC by Miro Hrončok
Modified: 2020-05-29 17:14 UTC (History)
5 users (show)

Fixed In Version: crypto-policies-20200527-4.gitb234a47.fc33
Clone Of:
Environment:
Last Closed: 2020-05-29 17:14:56 UTC
Type: Bug
Embargoed:


Attachments (Terms of Use)

Description Miro Hrončok 2020-05-29 16:14:39 UTC
Description of problem:
No packages can be built. buildSRPMFromSCM job fails with:

DEBUG util.py:602:  error: lua script failed: [string "%prein(crypto-policies-20200527-3.gitb234a47.fc33.noarch)"]:19: attempt to call a nil value
DEBUG util.py:600:  Error in PREIN scriptlet in rpm package crypto-policies
DEBUG util.py:602:  error: crypto-policies-20200527-3.gitb234a47.fc33.noarch: install failed

Version-Release number of selected component (if applicable):
crypto-policies-20200527-3.gitb234a47.fc33

How reproducible: build anything in koji

Actual results: everything is on fire


Expected results: packages build fine

Comment 1 Igor Raits 2020-05-29 16:24:20 UTC
crypto-policies-20200527-3.gitb234a47.fc33

has been untagged.

Comment 2 Miro Hrončok 2020-05-29 16:43:21 UTC
$ ilua
Jupyter console 6.1.0

ILua 0.2.1
In [1]: policy = "DEFAULT"                                                                                                                                                                                                       

In [2]: posix.files("%{_datarootdir}/crypto-policies/"..policy)                                                                                                                                                                  
Out[2]: nil	"%{_datarootdir}/crypto-policies/DEFAULT: No such file or directory"	2.0



The %{_datarootdir} macro is not expanded. Nor defined BTW:

In [3]: posix.files(rpm.expand("%{_datarootdir}/crypto-policies/"..policy))                                                                                                                                                      
Out[3]: nil	"%{_datarootdir}/crypto-policies/DEFAULT: No such file or directory"	2.0

In [4]: rpm.expand("%{_datarootdir}")                                                                                                                                                                                            
Out[4]: "%{_datarootdir}"

Comment 3 Miro Hrončok 2020-05-29 16:44:19 UTC
Scratch that, the macro is expanded during build.

Comment 4 Miro Hrončok 2020-05-29 16:47:19 UTC
I think the problem simply is that /usr/share/crypto-policies/ is part of crypto-policies package and when the package is installed for the first time, the files are missing.
The %pre script should only run on update and/or should do nothing if the files are not present yet.

Comment 5 Tomas Mraz 2020-05-29 17:00:55 UTC
No, the script actually should just be moved to %post.

Comment 6 Tomas Mraz 2020-05-29 17:01:37 UTC
Just a stupid mistake.

Comment 7 Tomas Mraz 2020-05-29 17:14:56 UTC
There were a few more changes needed but now I tested installing it in mock chroot without crypto-policies already installed, so hopefully no more buildroot breakage.


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