Bug 1288960 - [UX] dnf crashes when adding copr repo user/project (sic)
[UX] dnf crashes when adding copr repo user/project (sic)
Status: CLOSED DUPLICATE of bug 1304615
Product: Fedora
Classification: Fedora
Component: dnf (Show other bugs)
Unspecified Unspecified
unspecified Severity unspecified
: ---
: ---
Assigned To: rpm-software-management
Fedora Extras Quality Assurance
: Triaged
Depends On:
  Show dependency treegraph
Reported: 2015-12-07 01:16 EST by Chris Murphy
Modified: 2016-07-21 09:27 EDT (History)
8 users (show)

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Last Closed: 2016-07-21 09:27:17 EDT
Type: Bug
Regression: ---
Mount Type: ---
Documentation: ---
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---

Attachments (Terms of Use)
strace of crash (791.06 KB, text/plain)
2015-12-07 01:16 EST, Chris Murphy
no flags Details

  None (edit)
Description Chris Murphy 2015-12-07 01:16:40 EST
Created attachment 1103019 [details]
strace of crash

Description of problem:

When adding copr repo per https://fedorahosted.org/copr/wiki/HowToEnableRepo dnf crashes with traceback. I took this literally, so it's one part user error, but dnf crashes, rather than failing with some rational error message that it didn't understand what I was asking for.

Version-Release number of selected component (if applicable):

How reproducible:

Steps to Reproduce:
1. dnf copr enable user/project (sic)

Actual results:

# dnf copr enable user/project

You are about to enable a Copr repository. Please note that this
repository is not part of the main Fedora distribution, and quality
may vary.

The Fedora Project does not exercise any power over the contents of
this repository beyond the rules outlined in the Copr FAQ at
<https://fedorahosted.org/copr/wiki/UserDocs#WhatIcanbuildinCopr>, and
packages are not held to any quality or security level.

Please do not file bug reports about these packages in Fedora
Bugzilla. In case of problems, contact the owner of this repository.

Do you want to continue? [y/N]: y
Traceback (most recent call last):
  File "/usr/lib/python3.4/site-packages/dnfpluginscore/lib.py", line 71, in urlopen
    librepo.download_url(url, fo.fileno(), handle)
  File "/usr/lib64/python3.4/site-packages/librepo/__init__.py", line 1517, in download_url
    return _librepo.download_url(handle, url, fd)
librepo.LibrepoException: (10, 'Status code: 404 for https://copr.fedoraproject.org/coprs/user/project/repo/fedora-23/', 'Error HTTP/FTP status code')

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/usr/lib/python3.4/site-packages/dnf-plugins/copr.py", line 264, in _download_repo
    f = dnfpluginscore.lib.urlopen(self, None, self.copr_url + api_path, 'w+')
  File "/usr/lib/python3.4/site-packages/dnfpluginscore/lib.py", line 73, in urlopen
    raise IOError(e.args[1])
OSError: Status code: 404 for https://copr.fedoraproject.org/coprs/user/project/repo/fedora-23/

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/bin/dnf", line 57, in <module>
    main.user_main(sys.argv[1:], exit_code=True)
  File "/usr/lib/python3.4/site-packages/dnf/cli/main.py", line 174, in user_main
    errcode = main(args)
  File "/usr/lib/python3.4/site-packages/dnf/cli/main.py", line 60, in main
    return _main(base, args)
  File "/usr/lib/python3.4/site-packages/dnf/cli/main.py", line 112, in _main
  File "/usr/lib/python3.4/site-packages/dnf/cli/cli.py", line 1091, in run
    return self.command.run(self.base.extcmds)
  File "/usr/lib/python3.4/site-packages/dnf-plugins/copr.py", line 153, in run
    self._download_repo(project_name, repo_filename, chroot)
  File "/usr/lib/python3.4/site-packages/dnf-plugins/copr.py", line 272, in _download_repo
    res = urllib.request.urlopen(self.copr_url + "/coprs/" + project_name, 'w+')
  File "/usr/lib64/python3.4/urllib/request.py", line 161, in urlopen
    return opener.open(url, data, timeout)
  File "/usr/lib64/python3.4/urllib/request.py", line 461, in open
    req = meth(req)
  File "/usr/lib64/python3.4/urllib/request.py", line 1112, in do_request_
    raise TypeError(msg)
TypeError: POST data should be bytes or an iterable of bytes. It cannot be of type str.

Expected results:

It should fail gracefully.

Additional info:

user/project itself is not valid. If I use the command
dnf copr enable hadrons123/thermald
the repo is added without error
Comment 1 Jaroslav Mracek 2016-01-19 09:00:44 EST
*** Bug 1298246 has been marked as a duplicate of this bug. ***
Comment 2 Fedora Admin XMLRPC Client 2016-07-08 05:40:20 EDT
This package has changed ownership in the Fedora Package Database.  Reassigning to the new owner of this component.
Comment 3 Igor Gnatenko 2016-07-21 09:27:17 EDT

*** This bug has been marked as a duplicate of bug 1304615 ***

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