[openstack-dev] [Magnum] API response on k8s failure

Ton Ngo ton at us.ibm.com
Thu Sep 17 06:07:26 UTC 2015


Hi Ryan,
     There is a bug opened with a similar failure symptom, although I am
not sure if the cause is the same:
https://bugs.launchpad.net/magnum/+bug/1481889

Trying to use kubectl to deploy the V1 manifest, I get this error message:
Error: unable to recognize "redis-master.yaml": no object named "Pod" is
registered

Clearly the error handling from the k8s handler needs to be improved.  If
the bug above is different from what you found, I think opening a new bug
would be best.

Ton Ngo,




From:	Adrian Otto <adrian.otto at rackspace.com>
To:	"OpenStack Development Mailing List (not for usage questions)"
            <openstack-dev at lists.openstack.org>
Date:	09/14/2015 05:34 PM
Subject:	Re: [openstack-dev] [Magnum] API response on k8s failure



Ryan,

Thanks for sharing this. Sorry you got out to a bumpy start. I suggest you
do file a bug for this against magnum and we can decide how best to handle
it. I can not tell from your email what the kubectl would do with the same
input. We might have an opportunity to make both better.

If you need guidance for how to file a bug, feel free to email me directly
and I can point you in the right direction.

Thanks,

Adrian

> On Sep 14, 2015, at 3:05 PM, Ryan Rossiter <rlrossit at linux.vnet.ibm.com>
wrote:
>
> I was giving a devstacked version of Magnum a try last week, and from a
new user standpoint, I hit a big roadblock that caused me a lot of
confusion. Here's my story:
>
> I was attempting to create a pod in a k8s bay, and I provided it with an
sample manifest from the Kubernetes repo. The Magnum API then returned the
following error to me:
>
> ERROR: 'NoneType' object has no attribute 'host' (HTTP 500)
>
> I hunted down the error to be occurring here [1]. The k8s_api call was
going bad, but conductor was continuing on anyways thinking the k8s API
call went fine. I dug through the API calls to find the true cause of the
error:
>
> {u'status': u'Failure', u'kind': u'Status', u'code': 400, u'apiVersion':
u'v1beta3', u'reason': u'BadRequest', u'message': u'Pod in version v1
cannot be handled as a Pod: no kind "Pod" is registered for version "v1"',
u'metadata': {}}
>
> It turned out the error was because the manifest I was using had
apiVersion v1, not v1beta3. That was very unclear by Magnum originally
sending the 500.
>
> This all does occur within a try, but the k8s API isn't throwing any sort
of exception that can be caught by [2]. Was this caused by a regression in
the k8s client? It looks like the original intention of this was to catch
something going wrong in k8s, and then forward on the message & error code
on to let the magnum API return that.
>
> My question here is: does this classify as a bug? This happens in more
places than just the pod create. It's changing around API returns (quite a
few of them), and I don't know how that is handled in the Magnum project.
If we want to have this done as a blueprint, I can open that up and target
it for Mitaka, and get to work. If it should be opened up as a bug, I can
also do that and start work on it ASAP.
>
> [1]
https://github.com/openstack/magnum/blob/master/magnum/conductor/handlers/k8s_conductor.py#L88-L108

> [2]
https://github.com/openstack/magnum/blob/master/magnum/conductor/handlers/k8s_conductor.py#L94

>
> --
> Thanks,
>
> Ryan Rossiter (rlrossit)
>
>
>
__________________________________________________________________________
> OpenStack Development Mailing List (not for usage questions)
> Unsubscribe:
OpenStack-dev-request at lists.openstack.org?subject:unsubscribe
> http://lists.openstack.org/cgi-bin/mailman/listinfo/openstack-dev

__________________________________________________________________________
OpenStack Development Mailing List (not for usage questions)
Unsubscribe: OpenStack-dev-request at lists.openstack.org?subject:unsubscribe
http://lists.openstack.org/cgi-bin/mailman/listinfo/openstack-dev


-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.openstack.org/pipermail/openstack-dev/attachments/20150916/3a0c21e5/attachment.html>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: graycol.gif
Type: image/gif
Size: 105 bytes
Desc: not available
URL: <http://lists.openstack.org/pipermail/openstack-dev/attachments/20150916/3a0c21e5/attachment.gif>


More information about the OpenStack-dev mailing list