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

Related to #1190: add more logs when patch fails #1291

Merged
merged 2 commits into from
Feb 21, 2020

Conversation

nicolaferraro
Copy link
Member

@nicolaferraro nicolaferraro commented Feb 21, 2020

Fix #1190

Release Note

NONE

@nicolaferraro
Copy link
Member Author

It seems the CI error that's happening constantly is due to this specific problem.. logs should tell something this time..

@astefanutti
Copy link
Member

Yes it's very possible the patch creation is still a bit fragile, especially in edge / error cases.

@nicolaferraro
Copy link
Member Author

Yes it's very possible the patch creation is still a bit fragile, especially in edge / error cases.

Forgot the log was json in this case, but it's clear that the patch is empty:

{"level":"error","ts":1582287788.2336826,"logger":"camel-k.builder","msg":"\n--- patch ---\n\n-------------\n","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:108\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"}

Should we just skip the patch in this case or it is a signal of some other error @astefanutti ?

@astefanutti
Copy link
Member

Generally patching should be skipped when the patch is empty, I'm just surprised the build output leads to an empty patch, which means the build status hasn't changed after the build has run.

@nicolaferraro
Copy link
Member Author

Generally patching should be skipped when the patch is empty, I'm just surprised the build output leads to an empty patch, which means the build status hasn't changed after the build has run.

I'm not sure why it's doing another build to be honest.. a yaml integration has been already run previously and they look similar:

first one

- from:
    uri: "timer:yaml"
    parameters:
      period: "5s"
    steps:
      - set-header:
          name: "m"
          constant: "string!"
      - set-body:
          simple: "Magic${header.m}"
      - to: "log:info"

second:

- from:
    uri: "timer:yaml"
    parameters:
      period: "1s"
    steps:
      - set-body:
          constant: "Hello Camel K from yaml"
      - to: "log:info"

@nicolaferraro
Copy link
Member Author

Seems to fix.. I'm merging to rebase other PRs

@nicolaferraro nicolaferraro merged commit e9635ca into apache:master Feb 21, 2020
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 this pull request may close these issues.

Invalid JSON Patch error when running simple Camel-K example with 1.0.0-RC1
3 participants