Skip to content

YAML-ParseException/Malformed inline YAML string on start #865

@hbruch

Description

@hbruch

Observed behavior (please include a screenshot if possible)

When running datatools-ui with yarn run start, I often encounter YAML parse issues like this:

Error: Malformed inline YAML string or datatools-ui/node_modules/yamljs/lib/Parser.js:270 throw new ParseException('Unable to parse.', this.getRealCurrentLineNb() + 1, this.currentLine);

Logging the stacktrace yields something like:

at Parser.parse (./datatools-ui/node_modules/yamljs/lib/Parser.js:270:16)
    at Function.Yaml.parse (./datatools-ui/node_modules/yamljs/lib/Yaml.js:20:25)
    at DestroyableTransform._transform (./datatools-ui/node_modules/mastarm/lib/js-transform.js:92:47)
    at DestroyableTransform.Transform._read (./datatools-ui/node_modules/mastarm/node_modules/readable-stream/lib/_stream_transform.js:177:10)
    at DestroyableTransform.Transform._write (./datatools-ui/node_modules/mastarm/node_modules/readable-stream/lib/_stream_transform.js:164:83)
    at doWrite (./datatools-ui/node_modules/mastarm/node_modules/readable-stream/lib/_stream_writable.js:409:139)
    at writeOrBuffer (./datatools-ui/node_modules/mastarm/node_modules/readable-stream/lib/_stream_writable.js:398:5)
    at DestroyableTransform.Writable.write (./datatools-ui/node_modules/mastarm/node_modules/readable-stream/lib/_stream_writable.js:307:11)
    at DuplexWrapper.ondata (./datatools-ui/node_modules/readable-stream/lib/_stream_readable.js:619:20)
    at DuplexWrapper.emit (events.js:198:13)
at Parser.parse (./datatools-ui/node_modules/yamljs/lib/Parser.js:270:10)
    at Function.Yaml.parse (./datatools-ui/node_modules/yamljs/lib/Yaml.js:20:25)
    at DestroyableTransform._transform (./datatools-ui/node_modules/mastarm/lib/js-transform.js:92:47)
    at DestroyableTransform.Transform._read (./datatools-ui/node_modules/mastarm/node_modules/readable-stream/lib/_stream_transform.js:177:10)
    at DestroyableTransform.Transform._write (./datatools-ui/node_modules/mastarm/node_modules/readable-stream/lib/_stream_transform.js:164:83)
    at doWrite (./datatools-ui/node_modules/mastarm/node_modules/readable-stream/lib/_stream_writable.js:409:139)
    at writeOrBuffer (./datatools-ui/node_modules/mastarm/node_modules/readable-stream/lib/_stream_writable.js:398:5)
    at DestroyableTransform.Writable.write (./datatools-ui/node_modules/mastarm/node_modules/readable-stream/lib/_stream_writable.js:307:11)
    at DuplexWrapper.ondata (./datatools-ui/node_modules/readable-stream/lib/_stream_readable.js:619:20)
    at DuplexWrapper.emit (events.js:198:13)

I suspect mastarm YAML parsing as culprit: the yaml file may be chunked and mastarm's js-transform seems to expect the whole file to be passed in one single call.

Expected behavior

No parse error should occure, as the YAML is correctly formatted.

Steps to reproduce the problem

Any special notes on configuration used

Version of datatools-ui and datatools-server if applicable (exact commit hash or branch name)

datatools-ui: b240cb6
datatools-server: v4.1.0

Perhaps there is a workaround to prevent this kind of issue? Otherwise, this would add another reason to replace mastarm (#819)

Metadata

Metadata

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions