solo-io / gloo

The Cloud-Native API Gateway and AI Gateway
https://docs.solo.io/
Apache License 2.0
4.1k stars 446 forks source link

Error converting YAML to JSON - Found character that cannot start any token #1453

Closed david-freistrom closed 5 months ago

david-freistrom commented 5 years ago

Describe the bug Tiller server respond with an Error while trying to convert YAML to json: 'found character that cannot start any token' for different yaml templates

To Reproduce

  1. helm repo add gloo https://storage.googleapis.com/solo-public-helm
  2. helm fetch --untar=true --untardir=. gloo/gloo
  3. helm install gloo --namespace gloo-system -f gloo/values-knative.yaml

Expected behavior Deploy Knative with Gloo

Additional context

Error: YAML parse error on gloo/templates/1-gloo-deployment.yaml: error converting YAML to JSON: yaml: line 36: found character that cannot start any token

or

Error: YAML parse error on gloo/templates/3-discovery-deployment.yaml: error converting YAML to JSON: yaml: line 32: found character that cannot start any token

or more depend on which template comes first

ilackarms commented 5 years ago

following the steps above, I was not able to reproduce:

helm repo add gloo https://storage.googleapis.com/solo-public-helm

"gloo" has been added to your repositories
helm fetch --untar=true --untardir=. gloo/gloo

test with helm template:

helm template gloo --namespace gloo-system -f gloo/values-knative.yaml
#
# manifest content omitted
#

install:

helm install gloo --namespace gloo-system -f gloo/values-knative.yaml
NAME:   binging-ladybug
LAST DEPLOYED: Wed Oct 23 08:37:27 2019
NAMESPACE: gloo-system
STATUS: DEPLOYED

RESOURCES:
==> v1/ConfigMap
NAME                           DATA  AGE
gloo-usage                     0     1s
knative-external-proxy-config  1     1s
knative-internal-proxy-config  1     1s

==> v1/Deployment
NAME                    READY  UP-TO-DATE  AVAILABLE  AGE
discovery               0/1    1           0          1s
gloo                    0/1    1           0          1s
ingress                 0/1    1           0          1s
knative-external-proxy  0/1    1           0          1s
knative-internal-proxy  0/1    1           0          1s

==> v1/Pod(related)
NAME                                     READY  STATUS             RESTARTS  AGE
discovery-84c957ddb8-xdzxg               0/1    ContainerCreating  0         1s
gloo-66cb5564db-7n6m9                    0/1    ContainerCreating  0         1s
ingress-7b848764d7-c5257                 0/1    ContainerCreating  0         1s
knative-external-proxy-c777b5768-9spvq   0/1    ContainerCreating  0         1s
knative-internal-proxy-648996db66-tj5v7  0/1    ContainerCreating  0         1s

==> v1/Service
NAME                    TYPE          CLUSTER-IP    EXTERNAL-IP  PORT(S)                     AGE
gloo                    ClusterIP     10.7.243.197  <none>       9977/TCP,9988/TCP,9966/TCP  1s
knative-external-proxy  LoadBalancer  10.7.252.54   <pending>    80:31055/TCP,443:32607/TCP  1s
knative-internal-proxy  ClusterIP     10.7.254.216  <none>       80/TCP,443/TCP              1s

what version of helm are you using? my side:

helm version
Client: &version.Version{SemVer:"v2.14.3", GitCommit:"0e7f3b6637f7af8fcfddb3d2941fcc7cbebb0085", GitTreeState:"clean"}
Server: &version.Version{SemVer:"v2.14.3", GitCommit:"0e7f3b6637f7af8fcfddb3d2941fcc7cbebb0085", GitTreeState:"clean"}
pushm0v commented 5 years ago

I've this issue on my cluster as well, my helm info : Client: &version.Version{SemVer:"v2.15.1", GitCommit:"cf1de4f8ba70eded310918a8af3a96bfe8e7683b", GitTreeState:"clean"} Server: &version.Version{SemVer:"v2.15.0", GitCommit:"c2440264ca6c078a06e088a838b0476d2fc14750", GitTreeState:"clean"}

ghost commented 4 years ago

Make sure you're using spaces instead of tabs.

Credit: https://github.com/moraes/config/issues/1#issuecomment-18842169

Maduflavins commented 4 years ago

Make sure you're using spaces instead of tabs.

Credit: moraes/config#1 (comment)

wow so am supposed to use four line spaces instead of tabs

jorgonzalez commented 4 years ago

Make sure you're using spaces instead of tabs. Credit: moraes/config#1 (comment)

wow so am supposed to use four line spaces instead of tabs

cat -T yourfile.yaml | grep "^^I"

RorisangSitoboli commented 2 years ago

Use two spaces instead of tab-as stated earlier.

AdarshNaidu commented 2 years ago

This command worked for me

find . -name '*.yaml' ! -type d -exec bash -c 'expand -t 4 "$0" > /tmp/e && mv /tmp/e "$0"' {} \;

src: https://stackoverflow.com/questions/11094383/how-can-i-convert-tabs-to-spaces-in-every-file-of-a-directory

totovelo10 commented 1 year ago

This command worked for me

find . -name '*.yaml' ! -type d -exec bash -c 'expand -t 4 "$0" > /tmp/e && mv /tmp/e "$0"' {} \;

src: https://stackoverflow.com/questions/11094383/how-can-i-convert-tabs-to-spaces-in-every-file-of-a-directory

This very helpful!

github-actions[bot] commented 11 months ago

This issue has been marked as stale because of no activity in the last 180 days. It will be closed in the next 180 days unless it is tagged "no stalebot" or other activity occurs.

github-actions[bot] commented 5 months ago

This issue has been closed due to no activity in the last 12 months.