tarilabs opened a new issue, #3937:
URL: https://github.com/apache/camel-k/issues/3937

   Hi,
   if this is not the correct place to report this kind of issues, kindly point 
me in the right direction (even chats).
   
   **TL;DR:** as part of a Maven-based project, I have some data transformation 
method which I want to use and define in my Kamelet in camel-k. So far I've 
tested with a Processor which prints out a property (start even smaller in 
scope), but both Kamelet and KameletBinding fail during build, or trying our a 
simple Integration flow with the same processor fail locally too. My main issue 
is that beyond a generic `exit status 1` I don't get much. What can I do, 
please?
   
   What I've tried so far.
   
   ## (propedeutic step) using flow with normal Camel
   
   First, my dummy Processor is [defined 
here](https://github.com/kiegroup/yard/blob/kamelet/yard-kdtable/src/main/java/org/drools/yard/kdtable/KdtableProcessor.java#L15).
   I define a very trivial flow:
   ```yaml
   - beans:
     - name: myp
       type: org.drools.yard.kdtable.KdtableProcessor
   - from:
       uri: "timer:yaml"
       parameters:
         period: "5000"
       steps:
         - setBody:
             constant: "Hello Camel K from yaml"
         - process:
             ref: myp
         - transform:
             simple: "${body.toUpperCase()}"
         - to: "log:info"
   ```
   If I try locally with `camel` (even before trying with camel-k in the 
picture) locally it works as I would expect, the property which happens to be 
defined in local application.properties is picked up in this case - or if I 
delete the .properties file, empty.
   
   <img width="1390" alt="image" 
src="https://user-images.githubusercontent.com/1699252/208460063-247ec808-cbd8-4ea0-8dd5-b222009c973e.png";>
   
   ## Attempt using Kamelet and Kamelet binding
   
   I would have expected for a Kamelet to be able to incorporate the 
Processor/Bean without too much issues as [described 
here](https://camel.apache.org/camel-k/1.11.x/configuration/dependencies.html#dependencies-kind-jitpack).
   Unfortunately it does not work, but most importantly I'm not able to figure 
out what is the issue.
   
   Example kamelet `mmk.kamelet.yaml` file:
   
   ```yaml
   apiVersion: camel.apache.org/v1alpha1
   kind: Kamelet
   metadata:
     name: mmk
     labels:
       camel.apache.org/kamelet.type: "action"
   spec:
     definition:
       title: "mmk"
       description: prova
       properties:
         milliseconds:
           title: Milliseconds
           description: The number of milliseconds of delay
           type: integer
           example: 1000
         yard.kdtable:
           title: prova
           description: prova
           type: object
     dependencies:
     - "camel:core"
     - "camel:kamelet"
     - "github:kiegroup/yard/kamelet"
     template:
       beans:
         - name: myp
           type: org.drools.yard.kdtable.KdtableProcessor
       from:
         uri: "kamelet:source"
         steps:
         - process:
             ref: myp
         - to: "log:info"
   ```
   
   Please notice supplied `github:kiegroup/yard/kamelet` which is the correct 
branch, per Camel doc.
   
   example kamelet binding `timer-source-binding.yaml` file:
   
   ```yaml
   apiVersion: camel.apache.org/v1alpha1
   kind: KameletBinding
   metadata:
     name: timer-source-binding
   spec:
     source:
       ref:
         kind: Kamelet
         apiVersion: camel.apache.org/v1alpha1
         name: timer-source
       properties:
         message: hello world
         period: 5000
     sink:
       ref:
         kind: Kamelet
         apiVersion: camel.apache.org/v1alpha1
         name: mmk
       properties:
         yard.kdtable: my asd value in KameletBinding
   ```
   
   as I apply both files on K8s (minikube) everything seems to kick-start, but 
then the build fails.
   
   <img width="1680" alt="image (46)" 
src="https://user-images.githubusercontent.com/1699252/208461323-8cabb68c-2b50-416c-9f61-fcc4552f5f5e.png";>
   
   I have tried to apply the SOP as [described in the Camel doc 
here](https://camel.apache.org/camel-k/1.11.x/troubleshooting/operating.html#_camelkbuilderror).
   Unfortunately is not very helpful:
   
   ```
   $ kubectl get builds.camel.apache.org -o json \
   > | jq -r '.items[]
   > | select(.status.phase == "Error")
   > | "-n \(.metadata.namespace) builds.camel.apache.org/\(.metadata.name)"' \
   > | xargs -L1 kubectl get -o 
jsonpath='{.metadata.namespace}{"/"}{.metadata.name}{"\nError: 
"}{.status.error}{"\n"}'
   default/kit-ceee81ifluhc7399ij5g
   Error: failure while building project: : exit status 1
   default/kit-ceeeiaafluhc7399ij90
   Error: failure while building project: : exit status 1
   ```
   
   ## attempt to use Integration flow
   
   As suggested in the Camel doc [for 
troubleshooting](https://camel.apache.org/camel-k/1.11.x/troubleshooting/debugging.html#:~:text=you%20can%20troubleshoot%20individually%20each%20Kamelet%20definition%20by%20focusing%20on%20the%20specification%20Flow),
 I've tried to redefine the flow as an Integration from the step1 above, so I 
just added the modeline for the same, resulting in:
   
   ```yaml
   # camel-k: language=yaml dependency=github:kiegroup/yard/kamelet
    
   - beans:
     - name: myp
       type: org.drools.yard.kdtable.KdtableProcessor
   - from:
       uri: "timer:yaml"
       parameters:
         period: "5000"
       steps:
         - setBody:
             constant: "Hello Camel K from yaml"
         - process:
             ref: myp
         - transform:
             simple: "${body.toUpperCase()}"
         - to: "log:info"
   ```
   
   but I'm met with analogous error:
   
   ```
   $ kamel local run test.yaml --verbose
   Modeline options have been loaded from source files
   Full command: kamel local run test.yaml --verbose 
--dependency=github:kiegroup/yard/kamelet 
   Command "run" is deprecated, consider using Camel JBang instead 
(https://camel.apache.org/manual/camel-jbang.html)
   Error: failed to compute transitive dependencies: failure while building 
project: [ERROR] Failed to execute goal 
io.quarkus:quarkus-maven-plugin:2.14.0.Final:build (default) on project 
camel-k-integration: Failed to build quarkus application: 
io.quarkus.builder.BuildException: Build failure: Build failed due to errors: 
exit status 1
   ```
   
   ## `exit status 1`
   
   How can I understand what's the problem that causing `exit status 1`, please?
   So far, I'm not able to fetch the "internal logs" which might give any clue 
of the issue, and I haven't found the case for this in the Camel manual (hope 
given enough proofs I've actually read it in the above report! 😅 )
   Thank you in advance,


-- 
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.

To unsubscribe, e-mail: commits-unsubscr...@camel.apache.org.apache.org

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

Reply via email to