Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Random Helm Output messages #907

Open
afmsavage opened this issue Mar 15, 2021 · 10 comments
Open

Random Helm Output messages #907

afmsavage opened this issue Mar 15, 2021 · 10 comments
Labels
bug A bug in the extension.

Comments

@afmsavage
Copy link

In the VSCode output window, there are sometimes very vague errors from the Helm extension that pop up every time you open up a helm based project. There is no detail around these messages, and I cannot figure out how to turn them off or where the error is coming from. There is no information in helm lint nor in the Problems tab. Please provide more information about why these are occuring. Example:

Unexpected characters ().

image

@bacongobbler
Copy link
Contributor

bacongobbler commented Mar 15, 2021

I could only find two locations where that error message can be found:

https://github.com/Azure/vscode-kubernetes-tools/blob/e134027df60019718c2a45e9b3df59d660a08fdb/src/helm.documentProvider.ts#L83-L90

https://github.com/Azure/vscode-kubernetes-tools/blob/929a87c101bbe46d5233f88c37c4868079b88846/src/helm.exec.ts#L417-L424

Try looking at your chart name in Chart.yaml.

Can you report back which version of the extension you are using? Thanks.

@afmsavage
Copy link
Author

Chart.yaml is generic, no issues in it that I can see or any ( ) characters.

apiVersion: v1
appVersion: "1.0"
name: mina
description: A Helm chart to deploy a 
version: 0.2.0
keywords:
  - m
maintainers:
- name: b
  email: hi@b.co
  url: https://b.co

Kubernetes Extension: v1.3.0

@bacongobbler
Copy link
Contributor

bacongobbler commented Mar 15, 2021

Hmm... Thanks for the report. I don't know where this error message might be reported from but perhaps other maintainers may know more.

https://github.com/Azure/vscode-kubernetes-tools/search?q=unexpected

@itowlson
Copy link
Collaborator

That message is coming via the Helm output logger (defined in src/logger.ts. I can't see anywhere it outputs that message format in the extension, which means it's coming either from Helm itself, via stdout or stderr, or from some other external source such as the YAML extension. The fact that you see it on load (without running any explicit commands) makes me wonder if it's coming from the completion provider or something... We may need to improve tracing to track it down...

@thernstig
Copy link

I have seen this issue for a long time, but never reported it. It happens every time I open a repo with Helm where I have the values.yaml file open. The output is the same as in the original post: Unexpected characters (). (seen in the Output for Helm). The annoying part is that this error actually opens the Output panel automatically, so I have to manually close it every time.

@afmsavage
Copy link
Author

I think I know why this is occurring in at least my project. The only place that I have ( )'s in my chart is in the serviceMonitor.spec.endpoints.sourceLabels.regex field where we are using this to ignore certain Prometheus metrics to save cycles. Not sure if this helps to track this issue down or not.

  endpoints:
    - port: {{ .Values.metrics.name }}
      interval: 10s
      metricRelabelings:
      - sourceLabels: [__name__]
        regex: '(Coda_Cryptography.*|Coda_Network_get.*|Coda_Object_lifetime.*|Coda_Scan.*|Coda_Snark.*)'
        action: drop

EDIT: Actually I completely missed that I have other parentheses in my statefulSet under a container's args field as well.

        args: [
          "daemon",
          "--peer-list-file", "$(PEERLIST_LOCATION)",
          "--block-producer-key", "/keystore/my-wallet",
          "--generate-genesis-proof", "true",
          "--file-log-level", "$(LOG_LEVEL)",
          "--metrics-port", {{ .Values.metrics.port | quote }},
          "--coinbase-receiver", "$(REWARDS_ADDRESS)"
          ]

@itowlson
Copy link
Collaborator

itowlson commented May 9, 2021

@bacongobbler Would Helm emit this message under these circumstances?

@itowlson itowlson added the bug A bug in the extension. label May 9, 2021
@bacongobbler
Copy link
Contributor

bacongobbler commented May 12, 2021

It's not an error message I'm familiar with. Usually Helm/Go errors also include some indication what file/line this error was emitted from, so I don't think it's Helm emitting the error.

https://github.com/helm/helm/search?q=Unexpected+characters&type=

@thernstig
Copy link

@afmsavage I've found out that this was due to some incorrectly formatted YAML. For some reason the YAML parser showed squiggly lines and it was marked red in the scrollbar in VS Code.

But it was Helm that gave the error we see in this thread in the Output panel.

@bacongobbler is there any strange behavior here with the Helm in the Output panel showing errors due to YAML parsing, that can be avoided so it doesn't look like this extension is responsible?

@Yann-J
Copy link

Yann-J commented Oct 27, 2022

Hey just to chime in that I've been facing a similar issue... in my case this was caused by some empty lines in the middle of commented text:

values.yaml snippet:

configOverrides:
  {}
  # extend_timeout: |
  #    # Extend timeout to allow long running queries.

  #    SUPERSET_WEBSERVER_TIMEOUT = ...
  # enable_oauth: |
...

Was causing this error:

Unexpected characters near "
# extend_timeout: |

# enable_oauth: |
# secret: |".

Removing the empty line has removed the warning...

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug A bug in the extension.
Projects
None yet
Development

No branches or pull requests

5 participants