Bug 1186948
| Summary: | [download] data loss: dnf download should not delete files from local repositories | ||
|---|---|---|---|
| Product: | [Fedora] Fedora | Reporter: | Igor Gnatenko <ignatenko> |
| Component: | dnf-plugins-core | Assignee: | Packaging Maintenance Team <packaging-team-maint> |
| Status: | CLOSED ERRATA | QA Contact: | Fedora Extras Quality Assurance <extras-qa> |
| Severity: | unspecified | Docs Contact: | |
| Priority: | low | ||
| Version: | rawhide | CC: | akozumpl, ignatenko, jsilhan, mluscon, mmraka, packaging-team-maint, pnemade, rholy, rjones, tim.lauridsen |
| Target Milestone: | --- | ||
| Target Release: | --- | ||
| Hardware: | Unspecified | ||
| OS: | Unspecified | ||
| Whiteboard: | |||
| Fixed In Version: | dnf-plugins-core-0.1.7-1.fc22 | Doc Type: | Bug Fix |
| Doc Text: | Story Points: | --- | |
| Clone Of: | Environment: | ||
| Last Closed: | 2015-05-08 07:27:37 UTC | Type: | Bug |
| Regression: | --- | Mount Type: | --- |
| Documentation: | --- | CRM: | |
| Verified Versions: | Category: | --- | |
| oVirt Team: | --- | RHEL 7.3 requirements from Atomic Host: | |
| Cloudforms Team: | --- | Target Upstream Version: | |
| Embargoed: | |||
| Bug Depends On: | |||
| Bug Blocks: | 910269, 1156498 | ||
Hi Igor, what was your $PWD? Does it work with root access? (In reply to Jan Silhan from comment #1) > Hi Igor, what was your $PWD? Does it work with root access? $PWD = ~/ yes, it works with root access, because it's copying rpm file from local repo (only-root-rw) and removing rpm from local repo. it's need to be fixed in code while we checking from what repo we are downloading package and repo url =~ file://.* - don't do os.unlink() Igor, if you already know how to fix this, make a PR, please. Otherwise I am giving it a low prio. This bug appears to have been reported against 'rawhide' during the Fedora 22 development cycle. Changing version to '22'. More information and reason for this action is here: https://fedoraproject.org/wiki/Fedora_Program_Management/HouseKeeping/Fedora22 I was just filing a bug about this, but discovered this one. *NB* all the following commands are executed as non-root. Create a local repository: mkdir /tmp/repo cd /tmp/repo dnf download bash createrepo . ls -l Observe that the local repo contains a bash-*.rpm file and the repodata/ subdirectory. Create a yum.conf pointing to the local repository: mkdir /tmp/download cd /tmp/download cat > yum.conf <<'EOF' [main] cachedir=/var/cache/yum debuglevel=1 logfile=/var/log/yum.log retries=20 obsoletes=1 gpgcheck=0 assumeyes=1 reposdir=/dev/null [local] name=local baseurl=file:///tmp/repo failovermethod=priority enabled=1 gpgcheck=0 EOF Now download files using the local repository: cd /tmp/download dnf download -v -c yum.conf bash The 'dnf download' command works -- that is not the issue. However go and look back in the /tmp/repo directory. The dnf command has deleted the original RPM in the local repository! Version-Release number of selected component (if applicable): dnf-0.6.5-1.fc23.noarch (In reply to Jan Silhan from comment #3) > Igor, if you already know how to fix this, make a PR, please. Otherwise I am > giving it a low prio. What is a PR? IMO this is a very serious bug. dnf download should not touch original repositories. Moreover, I think that the plugin should not *move* the files, it should be enough to *copy* them since dnf.Base takes care of removing the packages downloaded using "download_packages" and it already tests whether they were really downloaded or whether they are available in a local repository. I applied your test patch to dnf-plugins-core, and I can confirm that it fixes the case outlined in comment 5. dnf-plugins-core-0.1.7-1.fc22,hawkey-0.5.5-1.fc22,dnf-1.0.0-1.fc22 has been submitted as an update for Fedora 22. https://admin.fedoraproject.org/updates/dnf-plugins-core-0.1.7-1.fc22,hawkey-0.5.5-1.fc22,dnf-1.0.0-1.fc22 Package dnf-plugins-core-0.1.7-1.fc22, hawkey-0.5.5-1.fc22, dnf-1.0.0-1.fc22: * should fix your issue, * was pushed to the Fedora 22 testing repository, * should be available at your local mirror within two days. Update it with: # su -c 'yum update --enablerepo=updates-testing dnf-plugins-core-0.1.7-1.fc22 hawkey-0.5.5-1.fc22 dnf-1.0.0-1.fc22' as soon as you are able to. Please go to the following url: https://admin.fedoraproject.org/updates/FEDORA-2015-7483/dnf-plugins-core-0.1.7-1.fc22,hawkey-0.5.5-1.fc22,dnf-1.0.0-1.fc22 then log in and leave karma (feedback). dnf-plugins-core-0.1.7-1.fc22, hawkey-0.5.5-1.fc22, dnf-1.0.0-1.fc22 has been pushed to the Fedora 22 stable repository. If problems still persist, please make note of it in this bug report. Can confirm this is fixed in dnf-plugins-core-0.1.8-1.fc23.noarch |
I have repository on my local filesystem and `dnf download` crashing with OSError because it's not downloading pkg and trying to move pkg. Traceback (most recent call last): File "/usr/lib/python2.7/site-packages/dnf/cli/main.py", line 134, in _main cli.run() File "/usr/lib/python2.7/site-packages/dnf/cli/cli.py", line 1059, in run return self.command.run(self.base.extcmds) File "/usr/lib/python2.7/site-packages/dnf-plugins/download.py", line 94, in run map(move, locations) File "/usr/lib/python2.7/site-packages/dnf-plugins/download.py", line 196, in _move_package os.unlink(location) OSError: [Errno 13] Permission denied: '/var/lib/dnf/plugins/local/bc-1.06.95-13.fc22.x86_64.rpm'