Bug 1225225

Summary: [abrt] python-dnf: repo.py:774:load:RepoError: Cache-only enabled but no cache for 'fedora'
Product: [Fedora] Fedora Reporter: bibo
Component: dnfAssignee: Packaging Maintenance Team <packaging-team-maint>
Status: CLOSED NEXTRELEASE QA Contact: Fedora Extras Quality Assurance <extras-qa>
Severity: unspecified Docs Contact:
Priority: unspecified    
Version: 22CC: bugiardolr, ignatenko, jsilhan, lubomir.carik, mluscon, ngompa13, packaging-team-maint, pnemade, rholy, thearcher, tim.lauridsen, vmukhame
Target Milestone: ---   
Target Release: ---   
Hardware: x86_64   
OS: Unspecified   
URL: https://retrace.fedoraproject.org/faf/reports/bthash/38b91446f1e56ffdc233c6d1aa66aa45681c946e
Whiteboard: abrt_hash:d389eba9e72e7e9a83ce881feac8cbf1b9f67d54
Fixed In Version: 1.1.1-2.fc23 Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2015-09-09 23:19:08 UTC Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:
Attachments:
Description Flags
File: backtrace
none
File: environ none

Description bibo 2015-05-26 21:18:45 UTC
Version-Release number of selected component:
python-dnf-1.0.0-1.fc22

Additional info:
reporter:       libreport-2.5.1
cmdline:        python2 /usr/lib/python2.7/site-packages/dnf/cli/completion_helper.py install yumex -d 0 -q -C
executable:     /usr/lib/python2.7/site-packages/dnf/cli/completion_helper.py
kernel:         4.0.4-301.fc22.x86_64
runlevel:       N 5
type:           Python
uid:            1000

Truncated backtrace:
repo.py:774:load:RepoError: Cache-only enabled but no cache for 'fedora'

Traceback (most recent call last):
  File "/usr/lib/python2.7/site-packages/dnf/cli/completion_helper.py", line 189, in <module>
    main(sys.argv[1:])
  File "/usr/lib/python2.7/site-packages/dnf/cli/completion_helper.py", line 185, in main
    cli.run()
  File "/usr/lib/python2.7/site-packages/dnf/cli/cli.py", line 1076, in run
    self._process_demands()
  File "/usr/lib/python2.7/site-packages/dnf/cli/cli.py", line 788, in _process_demands
    load_available_repos=lar)
  File "/usr/lib/python2.7/site-packages/dnf/base.py", line 238, in fill_sack
    self._add_repo_to_sack(r.id)
  File "/usr/lib/python2.7/site-packages/dnf/base.py", line 100, in _add_repo_to_sack
    repo.load()
  File "/usr/lib/python2.7/site-packages/dnf/repo.py", line 774, in load
    raise dnf.exceptions.RepoError(msg)
RepoError: Cache-only enabled but no cache for 'fedora'

Local variables in innermost frame:
msg: u"Cache-only enabled but no cache for 'fedora'"
self: <Repo fedora>

Comment 1 bibo 2015-05-26 21:18:48 UTC
Created attachment 1030181 [details]
File: backtrace

Comment 2 bibo 2015-05-26 21:18:50 UTC
Created attachment 1030182 [details]
File: environ

Comment 3 Honza Silhan 2015-07-13 11:30:56 UTC
*** Bug 1242078 has been marked as a duplicate of this bug. ***

Comment 4 Honza Silhan 2015-08-11 12:03:02 UTC
*** Bug 1248458 has been marked as a duplicate of this bug. ***

Comment 5 Honza Silhan 2015-08-11 12:04:57 UTC
Igor, can this be fixed, please? It should catch the error and ignore it.

Comment 6 Honza Silhan 2015-08-19 11:09:55 UTC
*** Bug 1252518 has been marked as a duplicate of this bug. ***

Comment 7 Igor Gnatenko 2015-08-19 12:49:00 UTC
diff --git a/dnf/cli/completion_helper.py b/dnf/cli/completion_helper.py
index bf88983..9060751 100644
--- a/dnf/cli/completion_helper.py
+++ b/dnf/cli/completion_helper.py
@@ -19,6 +19,7 @@
 # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
 # 02110-1301  USA
 
+import dnf.exceptions
 import dnf.cli
 import re
 import sys
@@ -184,7 +185,10 @@ def main(args):
     cli.register_command(CleanCompletionCommand)
     cli.register_command(HistoryCompletionCommand)
     cli.configure(args)
-    cli.run()
+    try:
+        cli.run()
+    except dnf.exceptions.Exception:
+        sys.exit(0)
 
 if __name__ == "__main__":
     try:

Comment 9 thearcher 2015-08-27 02:10:43 UTC
Another user experienced a similar problem:

Attempted to use tab-completion while doing a "dnf list libre<tabbing here"

reporter:       libreport-2.6.2
cmdline:        python2 /usr/lib/python2.7/site-packages/dnf/cli/completion_helper.py list list libre -d 0 -q -C
event_log:      2015-08-26-22:09:10> ('report_uReport' completed successfully)
executable:     /usr/lib/python2.7/site-packages/dnf/cli/completion_helper.py
kernel:         4.1.6-200.fc22.x86_64
package:        python-dnf-1.1.0-2.fc22
reason:         repo.py:793:load:RepoError: Cache-only enabled but no cache for 'fedora'
runlevel:       N 5
type:           Python
uid:            1000

Comment 10 Fedora Update System 2015-09-01 09:51:56 UTC
dnf-plugins-core-0.1.11-1.fc23 dnf-1.1.1-1.fc23 has been submitted as an update to Fedora 23. https://bodhi.fedoraproject.org/updates/FEDORA-2015-14743

Comment 11 Fedora Update System 2015-09-01 20:22:35 UTC
dnf-1.1.1-1.fc23, dnf-plugins-core-0.1.11-1.fc23 has been pushed to the Fedora 23 testing repository. If problems still persist, please make note of it in this bug report.\nIf you want to test the update, you can install it with \n su -c 'yum --enablerepo=updates-testing update dnf dnf-plugins-core'. You can provide feedback for this update here: https://bodhi.fedoraproject.org/updates/FEDORA-2015-14743

Comment 12 Fedora Update System 2015-09-08 12:38:26 UTC
dnf-1.1.1-2.fc22 dnf-plugins-core-0.1.11-1.fc22 has been submitted as an update to Fedora 22. https://bodhi.fedoraproject.org/updates/FEDORA-2015-14744

Comment 13 Fedora Update System 2015-09-08 12:38:59 UTC
dnf-1.1.1-2.fc22 dnf-plugins-core-0.1.11-1.fc22 has been submitted as an update to Fedora 22. https://bodhi.fedoraproject.org/updates/FEDORA-2015-14744

Comment 14 Fedora Update System 2015-09-08 12:39:49 UTC
dnf-1.1.1-2.fc23 dnf-plugins-core-0.1.11-1.fc23 has been submitted as an update to Fedora 23. https://bodhi.fedoraproject.org/updates/FEDORA-2015-14743

Comment 15 Fedora Update System 2015-09-08 17:51:49 UTC
dnf-1.1.1-2.fc23, dnf-plugins-core-0.1.11-1.fc23 has been pushed to the Fedora 23 testing repository. If problems still persist, please make note of it in this bug report.\nIf you want to test the update, you can install it with \n su -c 'yum --enablerepo=updates-testing update dnf dnf-plugins-core'. You can provide feedback for this update here: https://bodhi.fedoraproject.org/updates/FEDORA-2015-14743

Comment 16 Fedora Update System 2015-09-08 21:26:17 UTC
dnf-1.1.1-2.fc22, dnf-plugins-core-0.1.11-1.fc22 has been pushed to the Fedora 22 testing repository. If problems still persist, please make note of it in this bug report.\nIf you want to test the update, you can install it with \n su -c 'yum --enablerepo=updates-testing update dnf-plugins-core dnf'. You can provide feedback for this update here: https://bodhi.fedoraproject.org/updates/FEDORA-2015-14744

Comment 17 Fedora Update System 2015-09-09 23:18:39 UTC
dnf-1.1.1-2.fc22, dnf-plugins-core-0.1.11-1.fc22 has been pushed to the Fedora 22 stable repository. If problems still persist, please make note of it in this bug report.

Comment 18 Fedora Update System 2015-09-23 04:12:27 UTC
dnf-1.1.1-2.fc23, dnf-plugins-core-0.1.11-1.fc23 has been pushed to the Fedora 23 stable repository. If problems still persist, please make note of it in this bug report.