Giter Site home page Giter Site logo

Syntax Error in iLOv2 about python-hpilo HOT 7 CLOSED

seveas avatar seveas commented on September 26, 2024
Syntax Error in iLOv2

from python-hpilo.

Comments (7)

seveas avatar seveas commented on September 26, 2024

That's a fairly old firmware version, current version is 2.20 try updating it:

hpilo_cli ip.goes.here. update_rib_firmware filename=latest

If it still fails after that, I'll need debug output:

hpilo_cli -dd ip.goes.here get_ahs_status

from python-hpilo.

kellerkind avatar kellerkind commented on September 26, 2024

Issue remains:

Connecting to testserver5c:443
Sending XML request, 132 bytes
POST /ribcl HTTP/1.1
Host: localhost
Content-Length: 52
Connection: Close


<?xml version="1.0"?>
<RIBCL VERSION="2.0"></RIBCL>
Received 170 bytes


HTTP/1.1 404 Not Found
Content-Type:text/html

<HTML><HEAD><TITLE>Remote Insight</TITLE></HEAD><BODY>
<H1>Request Error</H1>
HTTP/1.1 404 Not Found
</BODY></HTML>
Connecting to testserver5c:443
Sending XML request, 158 bytes
<?xml version="1.0"?>
<RIBCL VERSION="2.0"><LOGIN PASSWORD="********"><GET_AHS_STATUS /></RIB_INFO></LOGIN></RIBCL>
Received 630 bytes


<?xml version="1.0"?>
<RIBCL VERSION="2.22">
<RESPONSE
    STATUS="0x0000"
    MESSAGE='No error'
     />
</RIBCL>
<?xml version="1.0"?>
<RIBCL VERSION="2.22">
<RESPONSE
    STATUS="0x0000"
    MESSAGE='No error'
     />
</RIBCL>
<?xml version="1.0"?>
<RIBCL VERSION="2.22">
<RESPONSE
    STATUS="0x0000"
    MESSAGE='No error'
     />
</RIBCL>
<?xml version="1.0"?>
<RIBCL VERSION="2.22">
<RESPONSE
    STATUS="0x0000"
    MESSAGE='No error'
     />
</RIBCL>
<?xml version="1.0"?>
<RIBCL VERSION="2.22">
<RESPONSE
    STATUS="0x0001"
    MESSAGE='Syntax error: Line #0: syntax error near "" in the line: ""'
    />
</RIBCL>
Traceback (most recent call last):
  File "/appl/vwlinux/bin/python/bin/hpilo_cli", line 255, in <module>
    main()
  File "/appl/vwlinux/bin/python/bin/hpilo_cli", line 173, in main
    results = [getattr(ilo, method)(**params)]
  File "/appl/vwlinux/bin/python/lib/python2.6/site-packages/hpilo.py", line 690, in get_ahs_status
    return self._info_tag('RIB_INFO', 'GET_AHS_STATUS')
  File "/appl/vwlinux/bin/python/lib/python2.6/site-packages/hpilo.py", line 543, in _info_tag
    header, message = self._request(root)
  File "/appl/vwlinux/bin/python/lib/python2.6/site-packages/hpilo.py", line 163, in _request
    message = self._parse_message(data)
  File "/appl/vwlinux/bin/python/lib/python2.6/site-packages/hpilo.py", line 436, in _parse_message
    raise IloError(message, status)
hpilo.IloError: Syntax error: Line #0: syntax error near "" in the line: ""

Firmware:

>>> ilo.get_fw_version()
{'license_type': 'iLO 2 Advanced', 'firmware_version': '2.20', 'management_processor': 'iLO2', 'firmware_date': 'May 08 2013'}

from python-hpilo.

seveas avatar seveas commented on September 26, 2024

Ah crap, bug in the output sanitizer, making it show incorrect XML :)

Anyway, I'm afraid the bug is not in python-hpilo, but in your expectations. AHS, and thus GET_AHS_STATUS is only supported in iLO 4. The fact that the iLO returns 'Syntax error' is a known issue which is annoying but impossible to fix in python-hpilo.

from python-hpilo.

kellerkind avatar kellerkind commented on September 26, 2024

Hi Dennis,

isnt it possible to catch all this syntax error crap in a special exception e.g. IloSyntaxError? Maybe you could also check if the command is valid for the current iLO version? A List with iLO version and their supported set of commands would be great and a timesaver. Did you thought about that?

Cheers,
Gunnnar

Command output:

>>> ilo.get_all_cables_status()
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/appl/env/bin/python/lib/python2.6/site-packages/hpilo.py", line 1259, in get_all_cables_status
    return self._raw(('SERVER_INFO', {'MODE': 'READ'}), ('GET_ALL_CABLES_STATUS', {}))
  File "/appl/env/bin/python/lib/python2.6/site-packages/hpilo.py", line 530, in _raw
    header, message = self._request(root)
  File "/appl/env/bin/python/lib/python2.6/site-packages/hpilo.py", line 163, in _request
    message = self._parse_message(data)
  File "/appl/env/bin/python/lib/python2.6/site-packages/hpilo.py", line 436, in _parse_message
    raise IloError(message, status)
hpilo.IloError: Syntax error: Line #0: syntax error near "" in the line: ""

from python-hpilo.

seveas avatar seveas commented on September 26, 2024

It is possible, but there are a few problems with it:

  • It requires me to maintain that list
  • The iLO version isn't always known to the code yet, so the exception handler may need to do another XML call to get that version
  • There are functions where this is a per-argument thing (mod_global_settings comes to mind)
  • There may be actual genuine syntax errors due to bugs

So, so far I've not been in favor of that, and instead warned about it in the documentation. I may catch the error and reraise it with a diffetent message, such as 'Syntax error: Line #0: syntax error near "" in the line: "". You may have tried to use a feature this iLO version does not support'

from python-hpilo.

seveas avatar seveas commented on September 26, 2024

I've now added that in adee97b.

from python-hpilo.

kellerkind avatar kellerkind commented on September 26, 2024

That looks better to me. I can throw explaining error messages everytime from within my script. The pitty is the unclear error message from iLO remains in the scenarios you explained. The additional text is explaining the situation, when people run the script, that are not common with the iLO.

Thanks,
Gunnar

from python-hpilo.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.