Bug 1044136

Summary: [abrt] copr-cli-1.15-1.fc20: ConfigParser.py:546:_read:ParsingError: File contains parsing errors: /home/churchyard/.config/copr
Product: [Fedora] Fedora Reporter: Miro Hrončok <mhroncok>
Component: coprAssignee: Miroslav Suchý <msuchy>
Status: CLOSED ERRATA QA Contact: Fedora Extras Quality Assurance <extras-qa>
Severity: unspecified Docs Contact:
Priority: unspecified    
Version: 20CC: msuchy
Target Milestone: ---   
Target Release: ---   
Hardware: x86_64   
OS: Unspecified   
URL: https://retrace.fedoraproject.org/faf/reports/bthash/65f5ddc4c6a8e07f86eba2a86d9ca80ccd01d1ed
Whiteboard: abrt_hash:b07ec87847840fd039b5298a046fab38d584a471
Fixed In Version: copr-1.21-1.fc20 Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2014-01-10 07:46:18 UTC Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Attachments:
Description Flags
File: backtrace
none
File: environ none

Description Miro Hrončok 2013-12-17 21:16:24 UTC
Description of problem:
I've changed my token and login in the config, but I forgot to change the username.

Version-Release number of selected component:
copr-cli-1.15-1.fc20

Additional info:
reporter:       libreport-2.1.9
cmdline:        /usr/bin/python2 /usr/bin/copr-cli build openscad-devel http://churchyard.fedorapeople.org/SRPMS/openscad-2013.12-0.2.20131215gite64bf96.fc20.src.rpm
dso_list:       python-libs-2.7.5-9.fc20.x86_64
executable:     /usr/bin/copr-cli
kernel:         3.11.10-301.fc20.x86_64
runlevel:       N 5
type:           Python
uid:            1000

Truncated backtrace:
ConfigParser.py:546:_read:ParsingError: File contains parsing errors: /home/churchyard/.config/copr
	[line  2]: '           username = msuchy\n'
	[line  3]: '           login = babooooo\n'
	[line  4]: '           token = hooooooo\n'

Traceback (most recent call last):
  File "/usr/bin/copr-cli", line 9, in <module>
    load_entry_point('copr-cli==0.1.0', 'console_scripts', 'copr-cli')()
  File "/usr/lib/python2.7/site-packages/copr_cli/main.py", line 125, in main
    arg.func(arg)
  File "/usr/lib/python2.7/site-packages/copr_cli/main.py", line 21, in action_build
    args.memory, args.timeout, not args.nowait)
  File "/usr/lib/python2.7/site-packages/copr_cli/subcommands.py", line 197, in build
    user = get_user()
  File "/usr/lib/python2.7/site-packages/copr_cli/subcommands.py", line 24, in get_user
    'copr')):
  File "/usr/lib64/python2.7/ConfigParser.py", line 305, in read
    self._read(fp, filename)
  File "/usr/lib64/python2.7/ConfigParser.py", line 546, in _read
    raise e
ParsingError: File contains parsing errors: /home/churchyard/.config/copr
	[line  2]: '           username = msuchy\n'
	[line  3]: '           login = baboooo\n'
	[line  4]: '           token = hoooo\n'

Local variables in innermost frame:
sectname: 'copr-cli'
cursect: OrderedDict([('__name__', 'copr-cli')])
e: File contains parsing errors: /home/churchyard/.config/copr
	[line  2]: '           username = msuchy\n'
	[line  3]: '           login = babooooo\n'
	[line  4]: '           token = hooooooo\n'
fpname: '/home/churchyard/.config/copr'
mo: None
optname: None
fp: <open file '/home/churchyard/.config/copr', mode 'r' at 0x1d3b9c0>
lineno: 5
line: ''
self: <ConfigParser.ConfigParser instance at 0x1eb5908>

Comment 1 Miro Hrončok 2013-12-17 21:16:30 UTC
Created attachment 837980 [details]
File: backtrace

Comment 2 Miro Hrončok 2013-12-17 21:16:33 UTC
Created attachment 837981 [details]
File: environ

Comment 3 Miro Hrončok 2013-12-17 21:17:59 UTC
[copr-cli]
           username = churchyard
           login = Y29wcg==##laptsijpskfsnhlgtxnu
           token = lhzzcoypxdgutxqjufbznqtbxaksqf


(I've regenerated the token now, so I can publish it here)

So, this error was not because of wrong filename, but probably because the ## in the login.

Comment 4 Miro Hrončok 2013-12-17 21:24:58 UTC
So after all, this seems to be created by the indention on the beginning of the lines. Copied that from the manpage.

Comment 5 Miroslav Suchý 2013-12-18 09:17:04 UTC
fixed in commit 62a7525
copr-cli does not print TB now, just error and as bonus it gives you guidenance (as this will be probably common error):
Lines in INI file should not be indented.

In this case copr-cli will return status code 4.

Comment 6 Fedora Update System 2014-01-08 14:21:43 UTC
copr-1.20-1.fc20 has been submitted as an update for Fedora 20.
https://admin.fedoraproject.org/updates/copr-1.20-1.fc20

Comment 7 Fedora Update System 2014-01-09 07:38:47 UTC
Package copr-1.20-1.fc20:
* should fix your issue,
* was pushed to the Fedora 20 testing repository,
* should be available at your local mirror within two days.
Update it with:
# su -c 'yum update --enablerepo=updates-testing copr-1.20-1.fc20'
as soon as you are able to.
Please go to the following url:
https://admin.fedoraproject.org/updates/FEDORA-2014-0449/copr-1.20-1.fc20
then log in and leave karma (feedback).

Comment 8 Fedora Update System 2014-01-10 07:46:18 UTC
copr-1.21-1.fc20 has been pushed to the Fedora 20 stable repository.  If problems still persist, please make note of it in this bug report.