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

Invalid JSON Patch error when running simple Camel-K example with 1.0.0-RC1 #1190

Closed
lreimer opened this issue Jan 12, 2020 · 2 comments · Fixed by #1291
Closed

Invalid JSON Patch error when running simple Camel-K example with 1.0.0-RC1 #1190

lreimer opened this issue Jan 12, 2020 · 2 comments · Fixed by #1291
Milestone

Comments

@lreimer
Copy link

lreimer commented Jan 12, 2020

Just wanted to give the latest Camel-K release 1.0.0-RC1 a try. Installation went OK. Camel-K itself is running. I then issue the simple command kamel run hello.groovy.

After some time the started build-kit pod will end up in an Init:Error state. Reason seems to be that the builder init container stops and exits with an error. The last line in the logs of the init container ist the following:

{"level":"error","ts":1578825389.8346853,"logger":"camel-k.builder","msg":"","error":"Invalid JSON Patch","stacktrace":"github.com/go-logr/zapr.(*zapLogger).Error\n\tgithub.com/go-logr/zapr@v0.1.1/zapr.go:128\ngithub.com/apache/camel-k/pkg/util/log.Logger.Error\n\tgithub.com/apache/camel-k@/pkg/util/log/log.go:74\ngithub.com/apache/camel-k/pkg/cmd/builder.exitOnError\n\tgithub.com/apache/camel-k@/pkg/cmd/builder/builder.go:105\ngithub.com/apache/camel-k/pkg/cmd/builder.Run\n\tgithub.com/apache/camel-k@/pkg/cmd/builder/builder.go:91\ngithub.com/apache/camel-k/pkg/cmd.(*builderCmdOptions).run\n\tgithub.com/apache/camel-k@/pkg/cmd/builder.go:51\ngithub.com/spf13/cobra.(*Command).execute\n\tgithub.com/spf13/cobra@v0.0.5/command.go:830\ngithub.com/spf13/cobra.(*Command).ExecuteC\n\tgithub.com/spf13/cobra@v0.0.5/command.go:914\ngithub.com/spf13/cobra.(*Command).Execute\n\tgithub.com/spf13/cobra@v0.0.5/command.go:864\nmain.main\n\tgithub.com/apache/camel-k@/cmd/kamel/main.go:46\nruntime.main\n\truntime/proc.go:203"}

I am running everything locally on a Mac using Docker Desktop with Kubernetes enabled:

  • Engine: 19.03.5
  • Kubernetes: v1.14.8
@lreimer
Copy link
Author

lreimer commented Jan 12, 2020

Here is the output when I describe the build pod:

$ kubectl describe pod camel-k-kit-bodfc1v0hp20sgnj6nfg

Name:           camel-k-kit-bodfc1v0hp20sgnj6nfg-builder
Namespace:      default
Priority:       0
Node:           docker-desktop/192.168.65.3
Start Time:     Sun, 12 Jan 2020 11:37:01 +0100
Labels:         camel.apache.org/build=kit-bodfc1v0hp20sgnj6nfg
                camel.apache.org/component=builder
Annotations:    <none>
Status:         Failed
IP:             10.1.4.95
IPs:            <none>
Controlled By:  Build/kit-bodfc1v0hp20sgnj6nfg
Init Containers:
  builder:
    Container ID:  docker://530b629fc6996b812c4f2c449ad776725df95ef14ed58801907b338363a33b05
    Image:         docker.io/apache/camel-k:1.0.0-RC1
    Image ID:      docker-pullable://apache/camel-k@sha256:fc0f9d73e752b84b68808bcb7144de195862db0408f23358e0fb6a77dbda814d
    Port:          <none>
    Host Port:     <none>
    Command:
      kamel
      builder
      --namespace
      default
      --build-name
      kit-bodfc1v0hp20sgnj6nfg
      --task-name
      builder
    State:          Terminated
      Reason:       Error
      Exit Code:    1
      Started:      Sun, 12 Jan 2020 11:37:04 +0100
      Finished:     Sun, 12 Jan 2020 11:37:27 +0100
    Ready:          False
    Restart Count:  0
    Environment:    <none>
    Mounts:
      /builder from camel-k-builder (rw)
      /var/run/secrets/kubernetes.io/serviceaccount from camel-k-builder-token-f2h9z (ro)
Containers:
  kaniko:
    Container ID:
    Image:         gcr.io/kaniko-project/executor:v0.14.0
    Image ID:
    Port:          <none>
    Host Port:     <none>
    Args:
      --dockerfile=Dockerfile
      --context=/builder/kit-bodfc1v0hp20sgnj6nfg/package/context
      --destination=docker.io/lreimer/camel-k-kit-bodfc1v0hp20sgnj6nfg:1108690
      --cache=false
      --cache-dir=/kaniko/cache
    State:          Waiting
      Reason:       PodInitializing
    Ready:          False
    Restart Count:  0
    Environment:    <none>
    Mounts:
      /builder from camel-k-builder (rw)
      /kaniko/.docker from kaniko-secret (rw)
      /var/run/secrets/kubernetes.io/serviceaccount from camel-k-builder-token-f2h9z (ro)
Conditions:
  Type              Status
  Initialized       False
  Ready             False
  ContainersReady   False
  PodScheduled      True
Volumes:
  camel-k-builder:
    Type:       EmptyDir (a temporary directory that shares a pod's lifetime)
    Medium:
    SizeLimit:  <unset>
  kaniko-secret:
    Type:        Secret (a volume populated by a Secret)
    SecretName:  docker-registry-secret
    Optional:    false
  camel-k-builder-token-f2h9z:
    Type:        Secret (a volume populated by a Secret)
    SecretName:  camel-k-builder-token-f2h9z
    Optional:    false
QoS Class:       BestEffort
Node-Selectors:  <none>
Tolerations:     node.kubernetes.io/not-ready:NoExecute for 300s
                 node.kubernetes.io/unreachable:NoExecute for 300s
Events:
  Type    Reason     Age   From                     Message
  ----    ------     ----  ----                     -------
  Normal  Scheduled  80m   default-scheduler        Successfully assigned default/camel-k-kit-bodfc1v0hp20sgnj6nfg-builder to docker-desktop
  Normal  Pulled     80m   kubelet, docker-desktop  Container image "docker.io/apache/camel-k:1.0.0-RC1" already present on machine
  Normal  Created    80m   kubelet, docker-desktop  Created container builder
  Normal  Started    80m   kubelet, docker-desktop  Started container builder

@antback
Copy link

antback commented Jan 26, 2020

I suffered same problem with same version of Docker Desktop and kubernetes in Windows 10. This is the error log trace:

{"level":"error","ts":1580057233.1165411,"logger":"camel-k.builder","msg":"","error":"Invalid JSON Patch","stacktrace":"github.com/go-logr/zapr.(*zapLogger).Error\n\tgithub.com/go-logr/zapr@v0.1.1/zapr.go:128\ngithub.com/apache/camel-k/pkg/util/log.Logger.Error\n\tgithub.com/apache/camel-k@/pkg/util/log/log.go:74\ngithub.com/apache/camel-k/pkg/cmd/builder.exitOnError\n\tgithub.com/apache/camel-k@/pkg/cmd/builder/builder.go:105\ngithub.com/apache/camel-k/pkg/cmd/builder.Run\n\tgithub.com/apache/camel-k@/pkg/cmd/builder/builder.go:91\ngithub.com/apache/camel-k/pkg/cmd.(*builderCmdOptions).run\n\tgithub.com/apache/camel-k@/pkg/cmd/builder.go:51\ngithub.com/spf13/cobra.(*Command).execute\n\tgithub.com/spf13/cobra@v0.0.5/command.go:830\ngithub.com/spf13/cobra.(*Command).ExecuteC\n\tgithub.com/spf13/cobra@v0.0.5/command.go:914\ngithub.com/spf13/cobra.(*Command).Execute\n\tgithub.com/spf13/cobra@v0.0.5/command.go:864\nmain.main\n\tgithub.com/apache/camel-k@/cmd/kamel/main.go:46\nruntime.main\n\truntime/proc.go:203"}

Full log file:
logs-from-builder-in-camel-k-kit-boms3f8j39sjnrplh4vg-builder.txt

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

Successfully merging a pull request may close this issue.

3 participants