onyxia-api icon indicating copy to clipboard operation
onyxia-api copied to clipboard

Onyxia fails to parse some manifests

Open olevitt opened this issue 2 years ago • 3 comments

Since the latest dependencies bump it seems Onyxia fails to parse some manifests. I'm trying to reproduce

2023-06-19 08:48:26.661 ERROR 7 --- [nio-8080-exec-7] o.a.c.c.C.[.[.[.[dispatcherServlet]      : Servlet.service() for servlet [dispatcherServlet] in context with path [/api] threw exception [Request processing failed; nested exception is java.util.concurrent.ExecutionException: while scanning a block scalar
 in reader, line 150, column 26:
    pre-entrypoint-script: |
                           ^
 the leading empty lines contain more spaces (3) than the first non-empty line.
 in reader, line 151, column 1:
    ---
    ^
] with root cause

org.snakeyaml.engine.v2.exceptions.ScannerException: while scanning a block scalar
 in reader, line 150, column 26:
    pre-entrypoint-script: |
                           ^
 the leading empty lines contain more spaces (3) than the first non-empty line.
 in reader, line 151, column 1:
    ---
    ^

	at org.snakeyaml.engine.v2.scanner.ScannerImpl.scanBlockScalar(ScannerImpl.java:1546) ~[snakeyaml-engine-2.6.

olevitt avatar Jun 19 '23 09:06 olevitt

#247 is just a workaround, preventing crash but failing to retrieve URLs due to not being able to parse some manifests.
This issue is therefore still relevant

olevitt avatar Sep 04 '23 16:09 olevitt

Do you have some example manifests?

johnksv avatar Dec 18 '23 23:12 johnksv

Not sure what exactly triggers the parsing fail but it seems some manifests that are ok with Helm / Kubernetes are not for the parser Onyxia-API (indirectly) uses.
It seems to be edge cases like this one : https://github.com/InseeFrLab/helm-charts-interactive-services/issues/115

command:
            - sh
            - -c
            - |

This does not make much sense in the real life (it was due to a bug in the package) but it's nonetheless allowed by both Helm and Kubernetes so it can happen in real life.
Not sure we can do much to tweak the parser fabric8's kubernetes client so I'm really not hopeful we can solve this issue but at least I added a workaround so that the request does not fail, only the URL won't be retrieved.

olevitt avatar Dec 19 '23 09:12 olevitt