Bug 1219370 - recent update of package 'man' is causing installation errors
Summary: recent update of package 'man' is causing installation errors
Status: RESOLVED FIXED
Alias: None
Product: openSUSE Tumbleweed
Classification: openSUSE
Component: Other (show other bugs)
Version: Current
Hardware: Other Other
: P5 - None : Normal (vote)
Target Milestone: ---
Assignee: Dr. Werner Fink
QA Contact: E-mail List
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2024-01-31 05:45 UTC by Giacomo Comes
Modified: 2024-02-23 11:21 UTC (History)
1 user (show)

See Also:
Found By: ---
Services Priority:
Business Priority:
Blocker: ---
Marketing QA Status: ---
IT Deployment: ---


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Giacomo Comes 2024-01-31 05:45:40 UTC
After the recent update of the package 'man' few days ago,
after I complete a tumbleweed installation I see many error message in
/var/log/zypp/history like:

# 2024-01-30 15:14:48 okular-23.08.4-1.2.x86_64.rpm installed ok
# Additional rpm output:
# /usr/bin/mandb: can't create index cache /var/cache/man/28439: No such file or directory
# 
2024-01-30 15:14:48|install|okular|23.08.4-1.2|x86_64||openSUSE-20240128-0|7ab449585748ca45227b66763d5376ca5fbba244075330b8d73f02b587fd53244422ea93636ceeee3174607716ba5eefdd04d9f995f213419fabfc68c76c9f44|

# 2024-01-30 14:47:14 totem-43.0-4.1.x86_64.rpm installed ok
# Additional rpm output:
# /usr/bin/mandb: can't create index cache /var/cache/man/15071: No such file or directory
# 
2024-01-30 14:47:14|install|totem|43.0-4.1|x86_64||openSUSE-20240128-0|3d8ec0aa702138cb58f9d35681000e67103be5935f22b5b53c27e8f3a5d62c515bfe54ba6c6e6d005659bb7911fac213aa09a7f9318842b15c1ccb95bc7a5daa|

# 2024-01-30 14:44:28 emacs-29.1-8.1.x86_64.rpm installed ok
# Additional rpm output:
# /usr/bin/mandb: can't create index cache /var/cache/man/12259: No such file or directory
# 
2024-01-30 14:44:28|install|emacs|29.1-8.1|x86_64||openSUSE-20240128-0|d19e7b859f1722b148afedf38c38031195206837a811f044be73c4292ccad4dac281b494451224633eb9ea3c2d5b926a9563d9e844998c5536f407b590fd7132|

There are about 300 of such errors. One week ago there were none.

I guess such errors are related to the macro %(trans)filetriggerin recently added in the man spec file.
Comment 1 Dr. Werner Fink 2024-02-08 07:13:38 UTC
Does /usr/lib/tmpfiles.d/man-db.conf exists?
Does /var/cache/man/ exists?

Is this a container or full system with running systemd?

What happens is you run

   /usr/bin/systemd-tmpfiles --create /usr/lib/tmpfiles.d/man-db.conf

(if first answer is yes of course and we have a running systemd)
Comment 2 Dr. Werner Fink 2024-02-08 07:45:45 UTC
I don't have this errors ... but here a /var/cache/man/ exists
Comment 3 Dr. Werner Fink 2024-02-08 13:17:48 UTC
Please give 'man' from

  https://download.opensuse.org/repositories/Base:/System/standard/

a try .. guess: architecture is x86_64
Comment 4 Giacomo Comes 2024-02-08 14:20:32 UTC
(In reply to Dr. Werner Fink from comment #1)
> Does /usr/lib/tmpfiles.d/man-db.conf exists?

Yes

> Does /var/cache/man/ exists?

Yes

> Is this a container or full system with running systemd?

full system with systemd

> What happens is you run
> 
>    /usr/bin/systemd-tmpfiles --create /usr/lib/tmpfiles.d/man-db.conf

command get executed, no error messages
Comment 5 Giacomo Comes 2024-02-08 14:25:50 UTC
(In reply to Dr. Werner Fink from comment #3)
> Please give 'man' from
> 
>   https://download.opensuse.org/repositories/Base:/System/standard/
> 
> a try .. guess: architecture is x86_64

I did a new installation and now I don't see the error as well.
Either the recent mass rebuild fixed the problem, or there was 
some hiccup during my previous installation.
Anyway, since I cannot reproduce the problem anymore, I'm going to
close this bug. If the problem resurface again, I'll reopen it.
Comment 6 OBSbugzilla Bot 2024-02-08 15:05:02 UTC
This is an autogenerated message for OBS integration:
This bug (1219370) was mentioned in
https://build.opensuse.org/request/show/1145198 Factory / man
Comment 7 Giacomo Comes 2024-02-12 03:02:44 UTC
The bug is back and this time I had the opportunity
to try several installation and I think I understood
what is going on.

The installation I did was with tumbleweed snapshot 20240208.
I have a local copy of it so I can do several installation
test without worrying about new packages being available
in tumbleweed.

During a installation, after the 'man' package is installed
the error messages
about '/var/cache/man/nnnnn not found' starts to appear
in /var/log/zypp/history.
Each error message is printed after the corresponding package
is installed.
The error is consistent with the fact that /var/cache/man
does not exist while the packages are installed,
because it gets created at the end of the installation
process when the transpost scriptlet of the package 'man'
get executed.

During the installation, while the error messages were
written in /var/log/zypp/history,
I decided to run:
/usr/bin/systemd-tmpfiles --create /usr/lib/tmpfiles.d/man-db.conf
and after that /var/cache/man was created and
in /var/log/zypp/history there were no more error messages.

It looks to me like the macro %transfiletriggerin
defined in the package 'man' is
executed not at the end of the transaction, but
at the end of each package installation,
like if it was a %filetriggerin macro.

If I have to guess, there is a bug in the code that
decides when to run the filetrigger macro.
Comment 8 Dr. Werner Fink 2024-02-12 07:19:24 UTC
Hmm ... I had added some lua code to exactly catch this case ... from
https://build.opensuse.org/request/show/1145198

```
%if 0%{?suse_version} >= 1699
%transfiletriggerin -p <lua> -- %{_mandir}
%else
%filetriggerin -p <lua> -- %{_mandir}
%endif
%trigger_functions
stat = posix.stat("%{_localstatedir}/cache/man/index.db")
if stat then
    execute("%{_bindir}/mandb", "--quiet")
else
    domkdir = false
    stat = posix.stat("%{_localstatedir}/cache/man")
    if not stat then
        domkdir = true
    elseif not (stat.type == "directory") then
        domkdir = true
        os.remove("%{_localstatedir}/cache/man")
    end
    if domkdir then
        posix.mkdir("%{_localstatedir}/cache/man")
        posix.chown("%{_localstatedir}/cache/man", "man", "man")
    end
    execute("%{_bindir}/mandb", "--quiet", "--create")
end
```

does this code really not work for you?  I had several times removed /var/chache/man and reinstalled with success the package man
Comment 9 Giacomo Comes 2024-02-12 11:01:30 UTC
The tumbleweed snapshot I was using did not have the updated
man package. Let me use the latest snapshot and see how it goes.
Comment 10 OBSbugzilla Bot 2024-02-12 12:05:02 UTC
This is an autogenerated message for OBS integration:
This bug (1219370) was mentioned in
https://build.opensuse.org/request/show/1146144 Factory / man
Comment 11 Giacomo Comes 2024-02-12 16:54:52 UTC
I tested the current tumbleweed snapshot which contains
the man package with SR#1145198.
There are no error messages in /var/log/zypp/history
during the installation.
When the man package with SR#1146144 appears in next few days
in tumbleweed I'll test it too and report here.
Comment 12 Giacomo Comes 2024-02-19 03:03:29 UTC
I tested the latest tumbleweed snapshot which includes man-2.12.0-4.1
with SR#1146144.
At the end of the installation I found the following error message in
/var/log/zypp/history:

# 2024-02-17 21:15:18 man-2.12.0-4.1.x86_64.rpm installed ok
# Additional rpm output:
# Failed to open '/usr/lib/tmpfiles.d/man-db.conf': No such file or directory
# Updating /etc/sysconfig/cron ...
# Created symlink /etc/systemd/system/timers.target.wants/man-db.timer -> /usr/lib/systemd/system/man-db.timer.
# 
2024-02-17 21:15:18|install|man|2.12.0-4.1|x86_64||openSUSE-20240216-0|523c08bff4873411abcc210c900a98906806989bff5079c7c891637b1d672951a47e659cdd5d7a2866f06b4e1732517ebcad400154be8e2d7ee5b83c4643a160|

On a fresh installation, during the pre scriptlet execution, before man istelf is installed, /usr/lib/tmpfiles.d/man-db.conf does not exist yet.

May be the post scriptlet is the proper location for such failing command?
Comment 13 Dr. Werner Fink 2024-02-19 07:17:51 UTC
(In reply to Giacomo Comes from comment #12)

> 
> On a fresh installation, during the pre scriptlet execution, before man
> istelf is installed, /usr/lib/tmpfiles.d/man-db.conf does not exist yet.
> 
> May be the post scriptlet is the proper location for such failing command?

The previous location was %postrans ... the real problenm is that due bug boo#1215538 a pure systemd based package should work without systemd.
Comment 14 OBSbugzilla Bot 2024-02-19 08:55:03 UTC
This is an autogenerated message for OBS integration:
This bug (1219370) was mentioned in
https://build.opensuse.org/request/show/1147518 Factory / man
Comment 15 Giacomo Comes 2024-02-23 11:21:15 UTC
After the last change in the man package, there are no more errors during
the installation. The issue is fixed. Closing the bug.