Bug 1040226

Summary: beaker-sync-tasks reads client config, logs in for no reason
Product: [Retired] Beaker Reporter: Dan Callaghan <dcallagh>
Component: generalAssignee: Amit Saha <asaha>
Status: CLOSED CURRENTRELEASE QA Contact: tools-bugs <tools-bugs>
Severity: unspecified Docs Contact:
Priority: unspecified    
Version: 0.15CC: aigao, asaha, dcallagh, ebaak, llim, qwan, rmancy, xjia
Target Milestone: 0.15.3   
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2014-02-03 04:52:11 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:

Description Dan Callaghan 2013-12-11 01:19:21 UTC
Seems like beaker-sync-tasks is reading Kobo config from somewhere (~/.beaker_client/config perhaps?) which interferes with its operation, including in tests:

ERROR: bkr.inttest.server.tools.test_sync_tasks:TestTaskLibrarySync.test_retrieve_tasks
  /usr/bin/vim +18  src/bkr/inttest/server/tools/test_sync_tasks.py  # test_retrieve_tasks
    task_sync = TaskLibrarySync(get_server_base())
  /usr/bin/vim +113 /home/dcallagh/work/beaker/Server/bkr/server/tools/sync_tasks.py  # __init__
    remote_proxy = self._get_server_proxy(self.remote)
  /usr/bin/vim +142 /home/dcallagh/work/beaker/Server/bkr/server/tools/sync_tasks.py  # _get_server_proxy
    hub = HubProxy(kobo_conf)
  /usr/bin/vim +170 /usr/lib/python2.6/site-packages/kobo/client/__init__.py  # __init__
    self._login(verbose=self._conf.get("DEBUG_XMLRPC"))
  /usr/bin/vim +224 /usr/lib/python2.6/site-packages/kobo/client/__init__.py  # _login
    raise ex
Krb5Error: (-1765328352, 'Ticket expired')

Also the stack trace shows that it is trying to log in but that is not necessary, the task library is available anonymously so it can skip logging in entirely.

Comment 1 Amit Saha 2013-12-11 01:24:35 UTC
I will also investigate if we can do away with using kobo at all, since the main reason for using Kobo was the initial design when we used XML-RPC to upload the tasks to the destination server as well and hence needed appropriate authentication.

Comment 3 Raymond Mancy 2013-12-11 01:40:07 UTC
IIRC all that we need to do is yank the Transport and Cookie related code and put it into Beaker somewhere.

Comment 4 Dan Callaghan 2013-12-11 01:43:22 UTC
The Transport and Cookie code are not needed in sync-tasks because it does not need to authenticate.

Comment 5 Raymond Mancy 2013-12-11 02:18:57 UTC
(In reply to Dan Callaghan from comment #4)
> The Transport and Cookie code are not needed in sync-tasks because it does
> not need to authenticate.

That was in response to "I will also investigate if we can do away with using kobo at all", which I assumed meant doing away with kobo from all of Beaker. I guess though it was just meant to be for beaker-sync-tasks.

Comment 6 Amit Saha 2013-12-12 10:32:01 UTC
http://gerrit.beaker-project.org/#/c/2615/1

Comment 9 Amit Saha 2013-12-23 02:16:29 UTC
http://gerrit.beaker-project.org/#/c/2641/

Comment 10 Amit Saha 2014-01-07 06:25:59 UTC
Apparently xmlrpclib.ServerProxy() doesn't add a /RPC2 to the proxy URL if it sees that the URL is of the form: http://localhost/bkr, so we need to add RPC2 explicitly before creating the ServerProxy object.

Comment 11 Amit Saha 2014-01-07 08:11:17 UTC
http://gerrit.beaker-project.org/#/c/2650/1

Comment 12 Amit Saha 2014-01-08 06:31:00 UTC
Suggested things to check during verification:

1. Should work without kobo
2. Should work when the remote is something like: http://beaker.server.com/bkr/
3. Successful task syncing

Comment 15 Nick Coghlan 2014-02-03 04:52:11 UTC
This change is included in the Beaker 0.15.3 maintenance release:

http://beaker-project.org/docs/whats-new/release-0.15.html#beaker-0-15-3