The beaker-client package does not ship with any config file (just an example one), the expectation is that the user will set up a config file pointing at their preferred Beaker instance. But if you install beaker-client and forget to set up a config it will fall back to connecting to https://localhost/hub/xmlrpc which is not useful. Steps to reproduce: 1. Delete (or temporarily remove) /etc/beaker/client.conf and $HOME/.beaker_client/config 2. Install beaker-client 3. Run bkr whoami Actual results: XML-RPC connection to localhost failed: Connection refused, 5 retries left XML-RPC connection to localhost failed: Connection refused, 4 retries left XML-RPC connection to localhost failed: Connection refused, 3 retries left XML-RPC connection to localhost failed: Connection refused, 2 retries left XML-RPC connection to localhost failed: Connection refused, 1 retry left Traceback (most recent call last): File "bkr/client/main.py", line 86, in <module> sys.exit(main()) File "bkr/client/main.py", line 64, in main return cmd.run(*cmd_args, **cmd_opts.__dict__) File "bkr/client/commands/cmd_whoami.py", line 56, in run self.set_hub(**kwargs) File "bkr/client/__init__.py", line 71, in set_hub proxy_user=proxy_user) File "bkr/client/command.py", line 279, in set_hub self.hub = HubProxy(conf=self.conf, auto_login=auto_login) File "bkr/common/hub.py", line 68, in __init__ self._login() File "bkr/common/hub.py", line 95, in _login if force or self._hub.auth.renew_session(): File "/usr/lib64/python2.7/xmlrpclib.py", line 1233, in __call__ return self.__send(self.__name, args) File "/usr/lib64/python2.7/xmlrpclib.py", line 1591, in __request verbose=self.__verbose File "bkr/common/xmlrpc.py", line 563, in request result = transport_class.request(self, *args, **kwargs) File "/usr/lib64/python2.7/xmlrpclib.py", line 1273, in request return self.single_request(host, handler, request_body, verbose) File "bkr/common/xmlrpc.py", line 437, in _single_request self.send_content(h, request_body) File "/usr/lib64/python2.7/xmlrpclib.py", line 1448, in send_content connection.endheaders(request_body) File "/usr/lib64/python2.7/httplib.py", line 997, in endheaders self._send_output(message_body) File "/usr/lib64/python2.7/httplib.py", line 850, in _send_output self.send(msg) File "/usr/lib64/python2.7/httplib.py", line 812, in send self.connect() File "/usr/lib64/python2.7/httplib.py", line 1204, in connect HTTPConnection.connect(self) File "/usr/lib64/python2.7/httplib.py", line 793, in connect self.timeout, self.source_address) File "/usr/lib64/python2.7/socket.py", line 571, in create_connection raise err socket.error: [Errno 111] Connection refused Expected results: An error message indicating that no config file was found, and where to put one.
On Gerrit: http://gerrit.beaker-project.org/#/c/4209/
This seems regressive behavior to me. This prevents me from using "bkr" if I don't have a configuration file. So, if i just want to quickly do something, i am not allowed to do that.
I am going to reopen this bug to further discuss it. I think one way to go about this is that if I am specifying --hub, the configuration file is not checked. Otherwise, even if I am specifying --hub because I want to perform a one-off operation, I can't if I don't have a configuration file.
(In reply to Amit Saha from comment #10) > I am going to reopen this bug to further discuss it. I think one way to go > about this is that if I am specifying --hub, the configuration file is not > checked. Otherwise, even if I am specifying --hub because I want to perform > a one-off operation, I can't if I don't have a configuration file. Even, bkr --help errors out.
(In reply to Amit Saha from comment #9) > This seems regressive behavior to me. This prevents me from using "bkr" if I > don't have a configuration file. > > So, if i just want to quickly do something, i am not allowed to do that. I do not see this is a regressive behaviour as you just forgot to set up a configuration file. As what dan said in comment 4, beaker-client expects users to set up a config file.
(In reply to matt jia from comment #12) > (In reply to Amit Saha from comment #9) > > This seems regressive behavior to me. This prevents me from using "bkr" if I > > don't have a configuration file. > > > > So, if i just want to quickly do something, i am not allowed to do that. > > I do not see this is a regressive behaviour as you just forgot to set up a > configuration file. As what dan said in comment 4, beaker-client expects > users to set up a config file. This is why I consider this regressive behavior: Before this, I could use bkr CLI to do this without having a configuration file: (since I am a one-off user, for example) bkr <sub-command> --hub=https://beaker.server.com But now, I cannot. Asking the user to always have a configuration file even when the important piece of data, --hub is supplied is something I would not like.
(In reply to Amit Saha from comment #13) > (In reply to matt jia from comment #12) > > (In reply to Amit Saha from comment #9) > > > This seems regressive behavior to me. This prevents me from using "bkr" if I > > > don't have a configuration file. > > > > > > So, if i just want to quickly do something, i am not allowed to do that. > > > > I do not see this is a regressive behaviour as you just forgot to set up a > > configuration file. As what dan said in comment 4, beaker-client expects > > users to set up a config file. > > This is why I consider this regressive behavior: > > Before this, I could use bkr CLI to do this without having a configuration > file: (since I am a one-off user, for example) > > bkr <sub-command> --hub=https://beaker.server.com > > But now, I cannot. Asking the user to always have a configuration file even > when the important piece of data, --hub is supplied is something I would not > like. Well, the thing is this behaviour is never ever officially supported by us. And for you suggestion in comment 10, I do not think it will work in the current code structure.
(In reply to matt jia from comment #14) > (In reply to Amit Saha from comment #13) > > (In reply to matt jia from comment #12) > > > (In reply to Amit Saha from comment #9) > > > > This seems regressive behavior to me. This prevents me from using "bkr" if I > > > > don't have a configuration file. > > > > > > > > So, if i just want to quickly do something, i am not allowed to do that. > > > > > > I do not see this is a regressive behaviour as you just forgot to set up a > > > configuration file. As what dan said in comment 4, beaker-client expects > > > users to set up a config file. > > > > This is why I consider this regressive behavior: > > > > Before this, I could use bkr CLI to do this without having a configuration > > file: (since I am a one-off user, for example) > > > > bkr <sub-command> --hub=https://beaker.server.com > > > > But now, I cannot. Asking the user to always have a configuration file even > > when the important piece of data, --hub is supplied is something I would not > > like. > > Well, the thing is this behaviour is never ever officially supported by us. > And for you suggestion in comment 10, I do not think it will work in the > current code structure. Trying to fix that: http://gerrit.beaker-project.org/#/c/4225/
I agree that bkr --help should always work, and bkr --hub should be enough to run without a config file (assuming that no auth is needed).
http://gerrit.beaker-project.org/#/c/4243/
Beaker 20.2 has been released.