Bug 587539 - [RFE] bkr should print an error if configuration file not present
Summary: [RFE] bkr should print an error if configuration file not present
Keywords:
Status: CLOSED CURRENTRELEASE
Alias: None
Product: Beaker
Classification: Retired
Component: command line
Version: 0.5
Hardware: All
OS: Linux
low
medium
Target Milestone: ---
Assignee: Bill Peck
QA Contact:
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2010-04-30 08:14 UTC by Miroslav Vadkerti
Modified: 2010-06-16 19:34 UTC (History)
4 users (show)

Fixed In Version:
Clone Of:
Environment:
Last Closed: 2010-06-16 19:34:33 UTC
Embargoed:


Attachments (Terms of Use)

Description Miroslav Vadkerti 2010-04-30 08:14:09 UTC
Description of problem:
I didn't have ~/.beaker file present on my system, when I used bkr i got:
Connection failed, retrying. Error was: [Errno 111] Connection refused
Connection failed, retrying. Error was: [Errno 111] Connection refused
Connection failed, retrying. Error was: [Errno 111] Connection refused
Connection failed, retrying. Error was: [Errno 111] Connection refused
Connection failed, retrying. Error was: [Errno 111] Connection refused
Traceback (most recent call last):
  File "/usr/bin/bkr", line 8, in <module>
    load_entry_point('bkr.client==0.5.19', 'console_scripts', 'bkr')()
  File "/usr/lib/python2.6/site-packages/bkr/client/main.py", line 32, in main
    return parser.run()
  File "/usr/lib/python2.6/site-packages/kobo/cli.py", line 203, in run
    cmd.run(*cmd_args, **cmd_kwargs)
  File "/usr/lib/python2.6/site-packages/bkr/client/commands/cmd_task_add.py", line 25, in run
    self.set_hub(username, password)
  File "/usr/lib/python2.6/site-packages/kobo/client/__init__.py", line 58, in set_hub
    self.hub = HubProxyClass(conf=conf)
  File "/usr/lib/python2.6/site-packages/kobo/client/__init__.py", line 124, in __init__
    self._login(verbose=self._conf.get("DEBUG_XMLRPC"))
  File "/usr/lib/python2.6/site-packages/kobo/client/__init__.py", line 163, in _login
    if force oConnection failed, retrying. Error was: [Errno 111] Connection refused
Connection failed, retrying. Error was: [Errno 111] Connection refused
Connection failed, retrying. Error was: [Errno 111] Connection refused
Connection failed, retrying. Error was: [Errno 111] Connection refused
Connection failed, retrying. Error was: [Errno 111] Connection refused
Traceback (most recent call last):
  File "/usr/bin/bkr", line 8, in <module>
    load_entry_point('bkr.client==0.5.19', 'console_scripts', 'bkr')()
  File "/usr/lib/python2.6/site-packages/bkr/client/main.py", line 32, in main
    return parser.run()
  File "/usr/lib/python2.6/site-packages/kobo/cli.py", line 203, in run
    cmd.run(*cmd_args, **cmd_kwargs)
  File "/usr/lib/python2.6/site-packages/bkr/client/commands/cmd_task_add.py", line 25, in run
    self.set_hub(username, password)
  File "/usr/lib/python2.6/site-packages/kobo/client/__init__.py", line 58, in set_hub
    self.hub = HubProxyClass(conf=conf)
  File "/usr/lib/python2.6/site-packages/kobo/client/__init__.py", line 124, in __init__
    self._login(verbose=self._conf.get("DEBUG_XMLRPC"))
  File "/usr/lib/python2.6/site-packages/kobo/client/__init__.py", line 163, in _login
    if force or self._hub.auth.renew_session():
  File "/usr/lib64/python2.6/xmlrpclib.py", line 1199, in __call__
    return self.__send(self.__name, args)
  File "/usr/lib64/python2.6/xmlrpclib.py", line 1489, in __request
    verbose=self.__verbose
  File "/usr/lib/python2.6/site-packages/kobo/xmlrpc.py", line 155, in request
    result = transport_class.request(self, *args, **kwargs)
  File "/usr/lib/python2.6/site-packages/kobo/xmlrpc.py", line 99, in request
    self.send_content(h, request_body)
  File "/usr/lib64/python2.6/xmlrpclib.py", line 1349, in send_content
    connection.endheaders()
  File "/usr/lib64/python2.6/httplib.py", line 868, in endheaders
    self._send_output()
  File "/usr/lib64/python2.6/httplib.py", line 740, in _send_output
    self.send(msg)
  File "/usr/lib64/python2.6/httplib.py", line 699, in send
    self.connect()
  File "/usr/lib64/python2.6/httplib.py", line 683, in connect
    self.timeout)
  File "/usr/lib64/python2.6/socket.py", line 512, in create_connection
    raise error, msg
socket.error: [Errno 111] Connection refused
r self._hub.auth.renew_session():
  File "/usr/lib64/python2.6/xmlrpclib.py", line 1199, in __call__
    return self.__send(self.__name, args)
  File "/usr/lib64/python2.6/xmlrpclib.py", line 1489, in __request
    verbose=self.__verbose
  File "/usr/lib/python2.6/site-packages/kobo/xmlrpc.py", line 155, in request
    result = transport_class.request(self, *args, **kwargs)
  File "/usr/lib/python2.6/site-packages/kobo/xmlrpc.py", line 99, in request
    self.send_content(h, request_body)
  File "/usr/lib64/python2.6/xmlrpclib.py", line 1349, in send_content
    connection.endheaders()
  File "/usr/lib64/python2.6/httplib.py", line 868, in endheaders
    self._send_output()
  File "/usr/lib64/python2.6/httplib.py", line 740, in _send_output
    self.send(msg)
  File "/usr/lib64/python2.6/httplib.py", line 699, in send
    self.connect()
  File "/usr/lib64/python2.6/httplib.py", line 683, in connect
    self.timeout)
  File "/usr/lib64/python2.6/socket.py", line 512, in create_connection
    raise error, msg
socket.error: [Errno 111] Connection refused

This got me a little bit confused until I realized what's the cause.

IMO ~/.beaker file is always needed and the unknown "default" will never work. Thus beaker should write an error if this file is not present. This would definitley spare me some time finding the cause of bkr not working.

Version-Release number of selected component (if applicable):
beaker-client-0.5.19-0.el6.noarch

How reproducible:
always

Steps to Reproduce:
1. rm -rf ~/.beaker
2. use bkr (example: bkr test-add package)
  
Actual results:
See description

Expected results:
Meaningful error that beaker is not congiured using ~/.beaker file

Additional info:

Comment 1 Marian Csontos 2010-04-30 09:54:11 UTC
Reminding me the move of ~/.beaker to ~/.beaker/client as suggested in Bug 584423 would make it more serious, as everyone would run into it if not handled by rpm's update.

Comment 2 Bill Peck 2010-06-16 19:34:33 UTC
current version says if your config file is missing and that its using the default one.


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