att-comdev / deckhand

This project has moved to OpenStack.
https://www.airshipit.org/
Apache License 2.0
9 stars 5 forks source link

DeckHand Client Returning 'NoneType' object #18

Closed eanylin closed 6 years ago

eanylin commented 6 years ago

We have a valid revision in deckhand that was created using Shipyard CLI

We will end up with NoneType object error if we try and make use of the deckhand client to retrieve the revision. It is difficult to troubleshoot this kind of problems as we are not getting much information on why the deckhand client error out. We will need better logging in order to identify the issue causing this error

Note that communications between airflow workers and deckhand is via the internal interface and not public interface. Hence we need to set the endpoint_type to internal instead of using the default public.


airflow@airflow-worker-864d4f946c-m84wg:~$ python3
Python 3.5.2 (default, Nov 23 2017, 16:37:01)
[GCC 5.4.0 20160609] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> from keystoneauth1.identity import v3 as keystone_v3
>>> from keystoneauth1 import session as keystone_session
>>> from deckhand.client import client as deckhand_client
>>> revision_id = 1
>>> keystone_auth = {}
>>> sess = None
>>> keystone_auth = {'project_name': 'service', 'user_domain_name': 'default', 'project_domain_name': 'default', 'username': 'shipyard', 'password': 'password', 'auth_url': 'http://keystone-api.ucp.svc.cluster.local:80/v3'}
>>> auth = keystone_v3.Password(**keystone_auth)
>>> sess = keystone_session.Session(auth=auth)
>>> deckhandclient = deckhand_client.Client(session=sess, endpoint_type='internal')
>>> deckhandclient.revisions.get(1)
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/src/deckhand/deckhand/client/revisions.py", line 45, in get
    return self._get(url)
  File "/src/deckhand/deckhand/client/base.py", line 224, in _get
    resp, body = self.api.client.get(url)
  File "/usr/local/lib/python3.5/dist-packages/keystoneauth1/adapter.py", line 304, in get
    return self.request(url, 'GET', **kwargs)
  File "/src/deckhand/deckhand/client/client.py", line 63, in request
    raise exceptions.from_response(resp, body, url, method)
  File "/src/deckhand/deckhand/client/exceptions.py", line 122, in from_response
    kwargs.update({
AttributeError: 'NoneType' object has no attribute 'update'
>>>
fmontei commented 6 years ago

This has been resolved.