Take the 2-minute tour ×
Ask Ubuntu is a question and answer site for Ubuntu users and developers. It's 100% free, no registration required.

I always get

request to http://$MaaSServer/MAAS/metadata//2012-03-01/ failed, sleeping HTTP Error 500: INTERNAL SERVER ERROR

(screenshot not posted, I lack the reputation . . . ;-) )

now, when trying to commission any nodes. Calling the URL in the browser returns just a message about missing authentication headers. But that's not a 500.

I haven't found any logs so far, where to check for this error on the server side. Any ideas? Need more details?

Thanks in advance, Phil

EDIT:

maas.log while the calls are executed:

ERROR 2013-11-26 15:32:48,332 maasserver ################################ Exception: Undefined namespace prefix ################################
ERROR 2013-11-26 15:32:48,332 maasserver Traceback (most recent call last):
File "/usr/lib/python2.7/dist-packages/django/core/handlers/base.py", line 115, in get_response
response = callback(request, *callback_args, **callback_kwargs)
File "/usr/lib/python2.7/dist-packages/django/views/decorators/vary.py", line 19, in inner_func
response = func(*args, **kwargs)
File "/usr/lib/python2.7/dist-packages/piston/resource.py", line 167, in call
result = self.error_handler(e, request, meth, em_format)
File "/usr/lib/python2.7/dist-packages/piston/resource.py", line 165, in call
result = meth(request, *args, **kwargs)
File "/usr/lib/python2.7/dist-packages/maasserver/api_support.py", line 147, in dispatch
return function(self, request, *args, **kwargs)
File "/usr/lib/python2.7/dist-packages/metadataserver/api.py", line 247, in signal
self._store_commissioning_results(node, request)
File "/usr/lib/python2.7/dist-packages/metadataserver/api.py", line 207, in _store_commissioning_results
exit_status=script_result)
File "/usr/lib/python2.7/dist-packages/metadataserver/models/commissioningscript.py", line 173, in update_hardware_details
has_tag = evaluator(tag.definition)
File "xpath.pxi", line 322, in lxml.etree.XPathElementEvaluator.call (src/lxml/lxml.etree.c:132785)
File "xpath.pxi", line 242, in lxml.etree._XPathEvaluatorBase._handle_result (src/lxml/lxml.etree.c:131890)
File "xpath.pxi", line 227, in lxml.etree._XPathEvaluatorBase._raise_eval_error (src/lxml/lxml.etree.c:131718)
XPathEvalError: Undefined namespace prefix

share|improve this question
    
Ok, this seems to happen, when the commission script on the server side receives the lshw output and uses lxml to write the information out (to where ever). I added some logging statements to the commissioningscript.py file in the mentioned mehtod. The xml output returned is ok. The etree.parser finishes properly. The xml returned from the node has not xml namespace prefixes. And it seems that this function is mainly to update the cpu and memory information in the maas. I'll add some additional logging statements to try and find out, what exactly is the problem with the namespace. –  TypoPhil Nov 26 '13 at 16:15
    
Ok, the issue seems to be caused by a tag in MaaS that I created. The XPath part in the definition argument holds namespace prefixes. Looking at the hw details in the MaaS WebUI for a specific Server, all tags have 'lshw' as prefix. But the method update_hardware_details in commissioningscript.py receives the output from lshw -xml, which contains no namespace prefixes. Thus lxml's etree raise an exception about the namespace prefixes. I'll check if all is going well with the tag removed and if the tag works without. I does work with namespace prefixes though. –  TypoPhil Nov 26 '13 at 17:21

1 Answer 1

as I already pointed out in the comments, the issue lies with the handling of namespace prefixes in the method update_hardware_details in the file commissionscript.py. If the definition, the xpath expression, placed with the tag does contain namespace prefixes, the method tries calling etree's evaluator which raises an exception, as the namespaces are undefined.

The namespaces in the xpath expression are needed, because nodes that are already configured have stowed away a version of the hardware details with namespace prefixes. The tagging would fail without them.

I placed a bug in launchpad: [Bug 1255479] (Patch included)

This was already fixed at some point in the past, but as it seems, the changes got lost.

I patched my version of the file and this works for me now. Check the bug for even more details.

Phil

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.