Actions
Bug #13766
open[API] bug in libyaml / Pysch used by API server to parse yaml
Start date:
07/09/2018
Due date:
% Done:
50%
Estimated time:
(Total: 0.00 h)
Story points:
-
Release:
Release relationship:
Auto
Description
Since 0.13.11 ruamel.yaml produces files like this:
- id: #main/x type: File default: {class: File, location: keep:169f39d466a5438ac4a90e779bf750c7+53/blorp.txt, size: 16, basename: blorp.txt, nameroot: blorp, nameext: .txt}
The issue comes up from keep:169f39d466a5438ac4a90e779bf750c7+53/blorp.txt in "flow style" has an embedded ':' character.
Relevant changelog:
(0.13.11) 2017-01-23: - allow ':' in flow style scalars if not followed by space. Also don't quote such scalar as this is no longer necessary. - add python 3.6 manylinux wheel to PyPI
This is explicitly allowed by the YAML spec, however the API server rejects it:
<HttpError 422 when requesting https://172.17.0.2:8000/arvados/v1/workflows?alt=json returned "Definition is not valid yaml abc: (<unknown>): found unexpected ':' while scanning a plain scalar at line 22 column 38">
This seems to be a bug in libyaml, which is used by Pysch (the Ruby YAML engine). It was recently fixed:
https://github.com/yaml/libyaml/pull/104
However at the time of this writing there is no stable release of libyaml with this bugfix, only a prerelease 0.2.2-pre1
Pysch is part of the standard library. I don't know if it is tied to a particular libyaml, and how to upgrade which libyaml gets used.
Options:
- Wait for stable releases of libyaml / pysch (unknown amount of time)
- Downgrade ruamel.yaml (messy)
- Some kind of regex output fixup in a-c-r to ensure these values are quoted
- Some kind of regex input fixup on api server to ensure these values are quoted
- Emit plain block style yaml, not "round trip" (breaks tests, tedious but fixable)
- Emit plain json (breaks tests, tedious but fixable)
Actions