galaxyproject / planemo

Command-line utilities to assist in developing Galaxy and Common Workflow Language artifacts - including tools, workflows, and training materials.
https://planemo.readthedocs.io/
MIT License
90 stars 85 forks source link

planemo autoupdate may fail on tools but exit code is 0 #1478

Open lldelisle opened 2 months ago

lldelisle commented 2 months ago

Hi, I noticed it with the autoupdate CI, if you get for example a tool with a problem in the XML like https://github.com/bgruening/galaxytools/tree/master/tools/rna_tools/inforna When you run planemo autoupdate ., you get in the stderr:

galaxy.util ERROR: Error parsing file /home/ldelisle/Documents/mygit/galaxytools/tools/rna_tools/inforna/inforna.xml
Traceback (most recent call last):
  File "/home/ldelisle/planemo/lib/python3.11/site-packages/galaxy/util/__init__.py", line 352, in parse_xml
    tree = cast(ElementTree, etree.parse(str(fname), parser=parser))
                             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "src/lxml/etree.pyx", line 3548, in lxml.etree.parse
  File "src/lxml/parser.pxi", line 1879, in lxml.etree._parseDocument
  File "src/lxml/parser.pxi", line 1905, in lxml.etree._parseDocumentFromURL
  File "src/lxml/parser.pxi", line 1808, in lxml.etree._parseDocFromFile
  File "src/lxml/parser.pxi", line 1180, in lxml.etree._BaseParser._parseDocFromFile
  File "src/lxml/parser.pxi", line 618, in lxml.etree._ParserContext._handleParseResultDoc
  File "src/lxml/parser.pxi", line 728, in lxml.etree._handleParseResult
  File "src/lxml/parser.pxi", line 657, in lxml.etree._raiseParseError
  File "/home/ldelisle/Documents/mygit/galaxytools/tools/rna_tools/inforna/inforna.xml", line 38
lxml.etree.XMLSyntaxError: attributes construct error, line 38, column 54
Error loading tool with path /home/ldelisle/Documents/mygit/galaxytools/tools/rna_tools/inforna/inforna.xml
Traceback (most recent call last):
  File "/home/ldelisle/planemo/lib/python3.11/site-packages/galaxy/tool_util/loader_directory.py", line 104, in _load_tools_from_path
    tool_element = loader_func(possible_tool_file)
                   ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/ldelisle/Documents/mygit/galaxytools/tools/rna_tools/inforna/inforna.xml", line 38
lxml.etree.XMLSyntaxError: attributes construct error, line 38, column 54
galaxy.util ERROR: Error parsing file /home/ldelisle/Documents/mygit/galaxytools/tools/rna_tools/inforna/inforna.xml
Traceback (most recent call last):
  File "/home/ldelisle/planemo/lib/python3.11/site-packages/galaxy/util/__init__.py", line 352, in parse_xml
    tree = cast(ElementTree, etree.parse(str(fname), parser=parser))
                             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "src/lxml/etree.pyx", line 3548, in lxml.etree.parse
  File "src/lxml/parser.pxi", line 1879, in lxml.etree._parseDocument
  File "src/lxml/parser.pxi", line 1905, in lxml.etree._parseDocumentFromURL
  File "src/lxml/parser.pxi", line 1808, in lxml.etree._parseDocFromFile
  File "src/lxml/parser.pxi", line 1180, in lxml.etree._BaseParser._parseDocFromFile
  File "src/lxml/parser.pxi", line 618, in lxml.etree._ParserContext._handleParseResultDoc
  File "src/lxml/parser.pxi", line 728, in lxml.etree._handleParseResult
  File "src/lxml/parser.pxi", line 657, in lxml.etree._raiseParseError
  File "/home/ldelisle/Documents/mygit/galaxytools/tools/rna_tools/inforna/inforna.xml", line 38
lxml.etree.XMLSyntaxError: attributes construct error, line 38, column 54
Error loading tool with path /home/ldelisle/Documents/mygit/galaxytools/tools/rna_tools/inforna/inforna.xml
Traceback (most recent call last):
  File "/home/ldelisle/planemo/lib/python3.11/site-packages/galaxy/tool_util/loader_directory.py", line 104, in _load_tools_from_path
    tool_element = loader_func(possible_tool_file)
                   ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/ldelisle/Documents/mygit/galaxytools/tools/rna_tools/inforna/inforna.xml", line 38
lxml.etree.XMLSyntaxError: attributes construct error, line 38, column 54
/home/ldelisle/Documents/mygit/galaxytools/tools/rna_tools/inforna/inforna.xml could not be updated - the following error was raised: not well-formed (invalid token): line 38, column 53

And in the stdout:

Auto-updating tool /home/ldelisle/Documents/mygit/galaxytools/tools/rna_tools/inforna/inforna.xml
Could not update /home/ldelisle/Documents/mygit/galaxytools/tools/rna_tools/inforna/inforna.xml due to malformed xml.

But exit code is 0 while I would expect it to be 0.