You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@camel.apache.org by GitBox <gi...@apache.org> on 2020/07/30 07:34:15 UTC

[GitHub] [camel-k] squakez opened a new issue #1648: Build error when using traits

squakez opened a new issue #1648:
URL: https://github.com/apache/camel-k/issues/1648


   Hi team,
   I am using `kamel` version `1.0.1` to run some integration. It seems that when I tries using `traits` (Jolokia, for instance), the operator build fails with this trace error:
   ```
   {"level":"info","ts":1596093483.0354865,"logger":"camel-k.controller.integration","msg":"Invoking action platform-setup","request-namespace":"syndesis","request-name":"hello","api-version":"camel.apache.org/v1","kind":"Integration","ns":"syndesis","name":"hello"}
   {"level":"error","ts":1596093483.0358343,"logger":"controller-runtime.controller","msg":"Reconciler error","controller":"integration-controller","request":"syndesis/hello","error":"error during trait customization: json: cannot unmarshal string into Go struct field jolokiaTrait.enabled of type bool","errorVerbose":"json: cannot unmarshal string into Go struct field jolokiaTrait.enabled of type bool\nerror during trait customization\ngithub.com/apache/camel-k/pkg/trait.Apply\n\tgithub.com/apache/camel-k@/pkg/trait/trait.go:47\ngithub.com/apache/camel-k/pkg/controller/integration.(*platformSetupAction).Handle\n\tgithub.com/apache/camel-k@/pkg/controller/integration/platform_setup.go:54\ngithub.com/apache/camel-k/pkg/controller/integration.(*ReconcileIntegration).Reconcile\n\tgithub.com/apache/camel-k@/pkg/controller/integration/integration_controller.go:273\nsigs.k8s.io/controller-runtime/pkg/internal/controller.(*Controller).reconcileHandler\n\tsigs.k8s.io/controller-runtime@v0.5.2
 /pkg/internal/controller/controller.go:256\nsigs.k8s.io/controller-runtime/pkg/internal/controller.(*Controller).processNextWorkItem\n\tsigs.k8s.io/controller-runtime@v0.5.2/pkg/internal/controller/controller.go:232\nsigs.k8s.io/controller-runtime/pkg/internal/controller.(*Controller).worker\n\tsigs.k8s.io/controller-runtime@v0.5.2/pkg/internal/controller/controller.go:211\nk8s.io/apimachinery/pkg/util/wait.JitterUntil.func1\n\tk8s.io/apimachinery@v0.18.2/pkg/util/wait/wait.go:152\nk8s.io/apimachinery/pkg/util/wait.JitterUntil\n\tk8s.io/apimachinery@v0.18.2/pkg/util/wait/wait.go:153\nk8s.io/apimachinery/pkg/util/wait.Until\n\tk8s.io/apimachinery@v0.18.2/pkg/util/wait/wait.go:88\nruntime.goexit\n\truntime/asm_amd64.s:1357","stacktrace":"github.com/go-logr/zapr.(*zapLogger).Error\n\tgithub.com/go-logr/zapr@v0.1.1/zapr.go:128\nsigs.k8s.io/controller-runtime/pkg/internal/controller.(*Controller).reconcileHandler\n\tsigs.k8s.io/controller-runtime@v0.5.2/pkg/internal/controller/controller
 .go:258\nsigs.k8s.io/controller-runtime/pkg/internal/controller.(*Controller).processNextWorkItem\n\tsigs.k8s.io/controller-runtime@v0.5.2/pkg/internal/controller/controller.go:232\nsigs.k8s.io/controller-runtime/pkg/internal/controller.(*Controller).worker\n\tsigs.k8s.io/controller-runtime@v0.5.2/pkg/internal/controller/controller.go:211\nk8s.io/apimachinery/pkg/util/wait.JitterUntil.func1\n\tk8s.io/apimachinery@v0.18.2/pkg/util/wait/wait.go:152\nk8s.io/apimachinery/pkg/util/wait.JitterUntil\n\tk8s.io/apimachinery@v0.18.2/pkg/util/wait/wait.go:153\nk8s.io/apimachinery/pkg/util/wait.Until\n\tk8s.io/apimachinery@v0.18.2/pkg/util/wait/wait.go:88"}
   ```
   This is coming from a simple integration as below:
   ```
   $ kamel describe integration hello
   Name:                hello
   Namespace:           syndesis
   Creation Timestamp:  Thu, 30 Jul 2020 09:17:53 +0200
   Phase:               
   Runtime Version:     
   Kit:                 
   Image:               
   Version:             
   Sources:
     Name          Language  Compression  Ref  Ref Key
     hello.groovy  groovy    false             
   Traits:
     Jolokia:
       Configuration:
         Enabled:  true
   ```
   It happens the same with Prometheus trait, which are the ones I am using. 


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [camel-k] squakez commented on issue #1648: Build error when using traits

Posted by GitBox <gi...@apache.org>.
squakez commented on issue #1648:
URL: https://github.com/apache/camel-k/issues/1648#issuecomment-668577264


   Thanks @astefanutti , I am good with aligning CLI and operator. Maybe some warning in case of a CLI operating on a different operator version may be good to let the user know about that. I can create an issue requesting that.


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [camel-k] jamesnetherton commented on issue #1648: Build error when using traits

Posted by GitBox <gi...@apache.org>.
jamesnetherton commented on issue #1648:
URL: https://github.com/apache/camel-k/issues/1648#issuecomment-677736963


   Is this fixed on master? I think I'm seeing a similar problem.
   
   ```
   kamel run examples/Sample.java -t quarkus.enabled=true
   ```
   
   ```
   {"level":"error","ts":1597937313.632321,"logger":"controller-runtime.controller","msg":"Reconciler error","controller":"integration-controller","request":"camel-k/sample","error":"IntegrationKit.camel.apache.org \"kit-bsv9d8aiqjq5bpuijdp0\" is invalid: spec.traits.quarkus.configuration.enabled: Invalid value: \"boolean\": spec.traits.quarkus.configuration.enabled in body must be of type string: \"boolean\"","stacktrace":"github.com/go-logr/zapr.(*zapLogger).Error\n\tgithub.com/go-logr/zapr@v0.1.1/zapr.go:128\nsigs.k8s.io/controller-runtime/pkg/internal/controller.(*Controller).reconcileHandler\n\tsigs.k8s.io/controller-runtime@v0.5.2/pkg/internal/controller/controller.go:258\nsigs.k8s.io/controller-runtime/pkg/internal/controller.(*Controller).processNextWorkItem\n\tsigs.k8s.io/controller-runtime@v0.5.2/pkg/internal/controller/controller.go:232\nsigs.k8s.io/controller-runtime/pkg/internal/controller.(*Controller).worker\n\tsigs.k8s.io/controller-runtime@v0.5.2/pkg/internal/control
 ler/controller.go:211\nk8s.io/apimachinery/pkg/util/wait.JitterUntil.func1\n\tk8s.io/apimachinery@v0.18.2/pkg/util/wait/wait.go:152\nk8s.io/apimachinery/pkg/util/wait.JitterUntil\n\tk8s.io/apimachinery@v0.18.2/pkg/util/wait/wait.go:153\nk8s.io/apimachinery/pkg/util/wait.Until\n\tk8s.io/apimachinery@v0.18.2/pkg/util/wait/wait.go:88"}
   ```
   


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [camel-k] astefanutti edited a comment on issue #1648: Build error when using traits

Posted by GitBox <gi...@apache.org>.
astefanutti edited a comment on issue #1648:
URL: https://github.com/apache/camel-k/issues/1648#issuecomment-677745025


   > It's my first time hacking on the project in 6 months, so there's a chance I've screwed something up 😛.
   
   I'll let you argue with CI 😉. Joke aside, have you re-installed the CRDs?


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [camel-k] astefanutti commented on issue #1648: Build error when using traits

Posted by GitBox <gi...@apache.org>.
astefanutti commented on issue #1648:
URL: https://github.com/apache/camel-k/issues/1648#issuecomment-677738109


   @jamesnetherton it should be :) Could you check the `kamel` CLI and the operator versions are aligned?


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [camel-k] nicolaferraro commented on issue #1648: Build error when using traits

Posted by GitBox <gi...@apache.org>.
nicolaferraro commented on issue #1648:
URL: https://github.com/apache/camel-k/issues/1648#issuecomment-668000352


   @squakez can you paste `kubectl get it -o yaml` to check if that's the issue?


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [camel-k] astefanutti commented on issue #1648: Build error when using traits

Posted by GitBox <gi...@apache.org>.
astefanutti commented on issue #1648:
URL: https://github.com/apache/camel-k/issues/1648#issuecomment-668539709


   Right, the camel-k 1.1.0 operator is not compatible with the `kamel` 1.0.0 CLI. One option is to use `kamel` 1.1.0. Generally, using _on par_ CLI is a good safety measure. It may be possible to handle downward compatibility, though that would ideally be a case for introducing a new API version, which comes with extra costs.


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [camel-k] squakez commented on issue #1648: Build error when using traits

Posted by GitBox <gi...@apache.org>.
squakez commented on issue #1648:
URL: https://github.com/apache/camel-k/issues/1648#issuecomment-668009766


   Thanks @nicolaferraro, this is the output of the failing integration:
   ```
   apiVersion: v1
   items:
   - apiVersion: camel.apache.org/v1
     kind: Integration
     metadata:
       creationTimestamp: 2020-08-03T12:59:22Z
       generation: 1
       managedFields:
       - apiVersion: camel.apache.org/v1
         fieldsType: FieldsV1
         fieldsV1:
           f:spec:
             .: {}
             f:sources: {}
             f:traits:
               .: {}
               f:jolokia:
                 .: {}
                 f:configuration:
                   .: {}
                   f:enabled: {}
           f:status: {}
         manager: kamel
         operation: Update
         time: 2020-08-03T12:59:22Z
       name: hello
       namespace: syndesis
       resourceVersion: "622532"
       selfLink: /apis/camel.apache.org/v1/namespaces/syndesis/integrations/hello
       uid: 32a7ae33-5792-4659-9dc5-2285c9cab3a1
     spec:
       sources:
       - content: |
           from('timer:tick?period=3000')
             .setBody().constant('Hello world from Camel K!')
             .to('log:info')
         name: hello.groovy
       traits:
         jolokia:
           configuration:
             enabled: "true"
   kind: List
   metadata:
     resourceVersion: ""
     selfLink: ""
   ```
   
   I've double checked the configuration and actually my `kamel` CLI installed version is `1.0.0` whilst the operator deployed image points to `1.1.0`, not sure if those are meant to be incompatible.


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [camel-k] jamesnetherton commented on issue #1648: Build error when using traits

Posted by GitBox <gi...@apache.org>.
jamesnetherton commented on issue #1648:
URL: https://github.com/apache/camel-k/issues/1648#issuecomment-677741617


   > @jamesnetherton it should be :) Could you check the `kamel` CLI and the operator versions are aligned?
   
   They should be because I've built them from the latest source. I'm actually running the operator from my IDE against a local cluster. Then creating integrations with the freshly built kamel binary as per normal.
   
   It's my first time hacking on the project in 6 months, so there's a chance I've screwed something up :stuck_out_tongue:.


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [camel-k] squakez closed issue #1648: Build error when using traits

Posted by GitBox <gi...@apache.org>.
squakez closed issue #1648:
URL: https://github.com/apache/camel-k/issues/1648


   


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [camel-k] jamesnetherton commented on issue #1648: Build error when using traits

Posted by GitBox <gi...@apache.org>.
jamesnetherton commented on issue #1648:
URL: https://github.com/apache/camel-k/issues/1648#issuecomment-677756670


   > have you re-installed the CRDs?
   
   Yep, that was it. I had stale CRDs :+1: 


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [camel-k] astefanutti commented on issue #1648: Build error when using traits

Posted by GitBox <gi...@apache.org>.
astefanutti commented on issue #1648:
URL: https://github.com/apache/camel-k/issues/1648#issuecomment-677745025


   > It's my first time hacking on the project in 6 months, so there's a chance I've screwed something up 😛.
   
   I'll let you argue with CI 😉. Joke aside, have you re-install the CRDs?


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [camel-k] nicolaferraro closed issue #1648: Build error when using traits

Posted by GitBox <gi...@apache.org>.
nicolaferraro closed issue #1648:
URL: https://github.com/apache/camel-k/issues/1648


   


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [camel-k] astefanutti commented on issue #1648: Build error when using traits

Posted by GitBox <gi...@apache.org>.
astefanutti commented on issue #1648:
URL: https://github.com/apache/camel-k/issues/1648#issuecomment-668579393


   @squakez thanks for the feedback. I agree with you a warning would be useful.


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [camel-k] nicolaferraro commented on issue #1648: Build error when using traits

Posted by GitBox <gi...@apache.org>.
nicolaferraro commented on issue #1648:
URL: https://github.com/apache/camel-k/issues/1648#issuecomment-669827861


   Got the same issue with client and operator from master:
   
   Running:
   ```
   kamel run source.yaml -t quarkus.enabled=true
   ```
   
   Operator logs:
   ```
   {"level":"error","ts":1596706872.1788838,"logger":"controller-runtime.controller","msg":"Reconciler error","controller":"integration-controller","request":"camel-nf-sinkbinding/source","error":"IntegrationKit.camel.apache.org \"kit-bslt0e7ft8fnqb4uj5h0\" is invalid: spec.traits.quarkus.configuration.enabled: Invalid value: \"boolean\": spec.traits.quarkus.configuration.enabled in body must be of type string: \"boolean\"","stacktrace":"github.com/go-logr/zapr.(*zapLogger).Error\n\t/home/nferraro/go/pkg/mod/github.com/go-logr/zapr@v0.1.1/zapr.go:128\nsigs.k8s.io/controller-runtime/pkg/internal/controller.(*Controller).reconcileHandler\n\t/home/nferraro/go/pkg/mod/sigs.k8s.io/controller-runtime@v0.5.2/pkg/internal/controller/controller.go:258\nsigs.k8s.io/controller-runtime/pkg/internal/controller.(*Controller).processNextWorkItem\n\t/home/nferraro/go/pkg/mod/sigs.k8s.io/controller-runtime@v0.5.2/pkg/internal/controller/controller.go:232\nsigs.k8s.io/controller-runtime/pkg/internal/c
 ontroller.(*Controller).worker\n\t/home/nferraro/go/pkg/mod/sigs.k8s.io/controller-runtime@v0.5.2/pkg/internal/controller/controller.go:211\nk8s.io/apimachinery/pkg/util/wait.JitterUntil.func1\n\t/home/nferraro/go/pkg/mod/k8s.io/apimachinery@v0.17.6/pkg/util/wait/wait.go:152\nk8s.io/apimachinery/pkg/util/wait.JitterUntil\n\t/home/nferraro/go/pkg/mod/k8s.io/apimachinery@v0.17.6/pkg/util/wait/wait.go:153\nk8s.io/apimachinery/pkg/util/wait.Until\n\t/home/nferraro/go/pkg/mod/k8s.io/apimachinery@v0.17.6/pkg/util/wait/wait.go:88"}
   ```


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [camel-k] nicolaferraro commented on issue #1648: Build error when using traits

Posted by GitBox <gi...@apache.org>.
nicolaferraro commented on issue #1648:
URL: https://github.com/apache/camel-k/issues/1648#issuecomment-669843174


   My problem was that even `kubectl apply` couldn't manage to update the integrationkit CRD on an existing cluster, without returning any error (may there be some operator replacing the CRD?).


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [camel-k] nicolaferraro commented on issue #1648: Build error when using traits

Posted by GitBox <gi...@apache.org>.
nicolaferraro commented on issue #1648:
URL: https://github.com/apache/camel-k/issues/1648#issuecomment-667999900


   Perhaps latest changes in trait serialization/deserialization changed the way props should be set in the struct.
   
   I guess that setting `enabled: true` instead of `enabled: "true"` is a workaround.
   
   I don't know if we can/should improve mapping to overcome this issue (@astefanutti).
   


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org