Skip to content
This repository has been archived by the owner on Nov 1, 2022. It is now read-only.

Weave cloud deploy page error with '---' at EOF #1925

Closed
dwight-biddle opened this issue Apr 11, 2019 · 13 comments · Fixed by #1931
Closed

Weave cloud deploy page error with '---' at EOF #1925

dwight-biddle opened this issue Apr 11, 2019 · 13 comments · Fixed by #1931
Assignees

Comments

@dwight-biddle
Copy link

It appears that when flux syncs a yaml that has a '---' at the end of the file, the application works correctly, and the yaml is applied, but afterwards the Weave Cloud interface for deployments has the following error:
parsing YAML doc from "{pathToYaml}": yaml: did not find expected node content'

When I remove the '---' at the end of the file, this error goes away.

The only effect this has is that it prevents me from doing manual deployments, and we could add validation for this, BUT this seems like a Weave specific problem that should be resolved, since it is valid kubernetes syntax.

@2opremio
Copy link
Contributor

2opremio commented Apr 11, 2019

Yep, it seems that both --- and ... should be valid at the end of the document.

Out of curiosity, do you need the --- at the end of the file for some reason?

@2opremio 2opremio added the bug label Apr 11, 2019
@2opremio 2opremio self-assigned this Apr 11, 2019
@dwight-biddle
Copy link
Author

dwight-biddle commented Apr 12, 2019 via email

@2opremio
Copy link
Contributor

Yeah, we should obviously support it since it's valid Yaml. I just wanted to understand whether there was a specific need for it.

@aronne
Copy link

aronne commented Apr 12, 2019

This has been a problem for our team as well. We have a repository that contains yaml definitions for tens of services and if even one of them has a trailing triple-dash (which is quite common if you are doing helm template XXX > output.yaml), flux chokes and stops automation of all workloads in the cluster.

Here's an example from the end of the file of one of our manifests that helm template generated which triggers this error:

---
# Source: sample-webapp/templates/configmap.yaml


<EOF>

@2opremio
Copy link
Contributor

2opremio commented Apr 12, 2019

Can you provide a full file causing the problem? (please redact whatever you see fit).

I made a fix but it seems that the test I created is bogus and I cannot reproduce the problem.

@2opremio
Copy link
Contributor

@aronne are you also using Weave Cloud?

@aronne
Copy link

aronne commented Apr 12, 2019

@2opremio Here's a redacted sample yaml file:

sample.yaml

We're using v1.12.0 of flux which is installed using the Helm Chart. We're not using Weave Cloud.

@2opremio
Copy link
Contributor

Thanks a lot. A simple parsing unit test for that file passes.

It must be something more intricate. I will take a deeper look.

@2opremio
Copy link
Contributor

2opremio commented Apr 12, 2019

I have found the problem, it happens when flux edits the file to automatically release a newer image. The cause is a combination of:

  1. Kubeyaml (which is what we use for updating the manifests) incorrectly adding ... (Yaml's end-of-document marker) after every --- preceding an empty document. Kubeyaml, should respect the original structure.
  2. Flux choking on ... when trying to re-parse the file.

I'll fix it in kubeyaml and add a few tests so that it doesn't happen again.

@dwight-biddle
Copy link
Author

dwight-biddle commented Apr 13, 2019 via email

@2opremio
Copy link
Contributor

2opremio commented Apr 13, 2019

Excellent! Thanks for jumping on this.

No problem

What is normally the turnaround for release once you have a fix ready to go?

It's ad-hoc. Check the dates in CHANGELOG.md for specific historical details

Are you blocked by this?

And how would we go about patching through weave cloud... rerun the yaml generated in the “update cluster” section of the configuration page? Or does flux self-update?

It depends on how you installed flux. To the best of my knowledge, If you followed the instructions from Weave Cloud, an agent is installed which will automatically upgrade flux.

Flux itself doesn't self-update.

@dwight-biddle
Copy link
Author

dwight-biddle commented Apr 13, 2019 via email

@dwight-biddle
Copy link
Author

Confirmed this works in our environment, thanks for addressing this so promptly!

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants