Bug 2353349 - "dnf5 install package" failed when path in TEMPDIR environment does not exist
Summary: "dnf5 install package" failed when path in TEMPDIR environment does not exist
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Fedora
Classification: Fedora
Component: dnf5
Version: rawhide
Hardware: Unspecified
OS: Linux
unspecified
low
Target Milestone: ---
Assignee: Petr Pisar
QA Contact:
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2025-03-19 12:09 UTC by Xiaofeng Wang
Modified: 2025-04-11 18:27 UTC (History)
5 users (show)

Fixed In Version: dnf5-5.2.12.0-2.fc43 dnf5-5.2.12.0-2.fc41 dnf5-5.2.12.0-2.fc42
Clone Of:
Environment:
Last Closed: 2025-04-08 01:28:40 UTC
Type: ---
Embargoed:


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
Github rpm-software-management dnf5 pull 2148 0 None open doc: Environment variables for a terminal and temporary files 2025-03-20 18:11:36 UTC

Description Xiaofeng Wang 2025-03-19 12:09:34 UTC
Deploy a Fedora rawhide VM, export TEMPDIR envirnment variable, then dnf install.


[root@35b330dc-4283-4c95-821e-dafbdb9fb168 ~]# export TEMPDIR=/tmp/tmp.lfheix
[root@35b330dc-4283-4c95-821e-dafbdb9fb168 ~]# dnf install podman skopeo
Updating and loading repositories:
 Beaker tasks                                                                                                                                           100% |  47.4 MiB/s |   3.7 MiB |  00m00s
Repositories loaded.
filesystem error: temp_directory_path: No such file or directory [/tmp/tmp.lfheix]

[root@35b330dc-4283-4c95-821e-dafbdb9fb168 ~]# rpm -q dnf5
dnf5-5.2.11.0-1.fc43.x86_64

The same configuration works on Fedora 41 and 42.

Reproducible: Always

Steps to Reproduce:
1.Deploy a Fedora rawhide VM
2. export TEMPDIR envirnment variable
3. dnf install podman skopeo
Actual Results:  
Failed

Expected Results:  
Successful

Comment 1 Petr Pisar 2025-03-19 12:13:18 UTC
Did the specified /tmp/tmp.lfheix directory existed?

Comment 2 Petr Pisar 2025-03-19 14:10:38 UTC
The error message comes from std::filesystem::temp_directory_path() call to a standard C++ library <https://en.cppreference.com/w/cpp/filesystem/temp_directory_path>. See Notes section there to the list of environment variables affecting the behavior.

An error on unusable location for temporary files is a correct behavior. Maybe DNF5 could wrap it to provide localized version, but in general the message is explanatory, I think.

What DNF5 should definitely do is documenting the environment variables in dnf5(8) manual.

Comment 3 Xiaofeng Wang 2025-03-21 03:44:29 UTC
(In reply to Petr Pisar from comment #1)
> Did the specified /tmp/tmp.lfheix directory existed?

Thanks for looking this issue. /tmp/tmp.lfheix does not exist in my case.

Comment 4 Fedora Update System 2025-04-02 14:10:58 UTC
FEDORA-2025-ef5e387d5d (dnf5-5.2.12.0-2.fc42) has been submitted as an update to Fedora 42.
https://bodhi.fedoraproject.org/updates/FEDORA-2025-ef5e387d5d

Comment 5 Fedora Update System 2025-04-02 14:11:08 UTC
FEDORA-2025-7f78913002 (dnf5-5.2.12.0-2.fc41) has been submitted as an update to Fedora 41.
https://bodhi.fedoraproject.org/updates/FEDORA-2025-7f78913002

Comment 6 Fedora Update System 2025-04-03 02:20:43 UTC
FEDORA-2025-7f78913002 has been pushed to the Fedora 41 testing repository.
Soon you'll be able to install the update with the following command:
`sudo dnf upgrade --enablerepo=updates-testing --refresh --advisory=FEDORA-2025-7f78913002`
You can provide feedback for this update here: https://bodhi.fedoraproject.org/updates/FEDORA-2025-7f78913002

See also https://fedoraproject.org/wiki/QA:Updates_Testing for more information on how to test updates.

Comment 7 Fedora Update System 2025-04-03 03:43:34 UTC
FEDORA-2025-ef5e387d5d has been pushed to the Fedora 42 testing repository.
Soon you'll be able to install the update with the following command:
`sudo dnf upgrade --enablerepo=updates-testing --refresh --advisory=FEDORA-2025-ef5e387d5d`
You can provide feedback for this update here: https://bodhi.fedoraproject.org/updates/FEDORA-2025-ef5e387d5d

See also https://fedoraproject.org/wiki/QA:Updates_Testing for more information on how to test updates.

Comment 8 Fedora Update System 2025-04-08 01:28:40 UTC
FEDORA-2025-7f78913002 (dnf5-5.2.12.0-2.fc41) has been pushed to the Fedora 41 stable repository.
If problem still persists, please make note of it in this bug report.

Comment 9 Fedora Update System 2025-04-11 18:27:25 UTC
FEDORA-2025-ef5e387d5d (dnf5-5.2.12.0-2.fc42) has been pushed to the Fedora 42 stable repository.
If problem still persists, please make note of it in this bug report.


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