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

Kamelet binding to an explicit URI failing #1774

Closed
christophd opened this issue Oct 21, 2020 · 2 comments · Fixed by #1776
Closed

Kamelet binding to an explicit URI failing #1774

christophd opened this issue Oct 21, 2020 · 2 comments · Fixed by #1776
Assignees
Milestone

Comments

@christophd
Copy link
Contributor

I use a KameletBinding to an explicit URI pointing to a service in my cluster. The KameletBinding creates an integration that fails with:

Caused by: org.apache.camel.FailedToCreateRouteException: Failed to create route route1 at: >>> To[knative:endpoint/sink] <<< in route: Route(route1)[From[kamelet:timer-source?message=Hello+world%... because of Failed to resolve endpoint: knative://endpoint/sink due to: Cannot load Knative configuration from file or env variable
	at org.apache.camel.reifier.RouteReifier.doCreateRoute(RouteReifier.java:385)
	at org.apache.camel.reifier.RouteReifier.createRoute(RouteReifier.java:112)
	at org.apache.camel.quarkus.core.FastCamelContext.startRouteDefinitions(FastCamelContext.java:830)
	at org.apache.camel.quarkus.core.FastCamelContext.startRouteDefinitions(FastCamelContext.java:582)
	at org.apache.camel.impl.engine.AbstractCamelContext.doInit(AbstractCamelContext.java:2680)
	at org.apache.camel.quarkus.core.FastCamelContext.doInit(FastCamelContext.java:468)
	at org.apache.camel.support.service.BaseService.init(BaseService.java:83)
	at org.apache.camel.impl.engine.AbstractCamelContext.init(AbstractCamelContext.java:2452)
	at org.apache.camel.support.service.BaseService.start(BaseService.java:111)
	at org.apache.camel.impl.engine.AbstractCamelContext.start(AbstractCamelContext.java:2469)
	at org.apache.camel.quarkus.main.CamelMain.doStart(CamelMain.java:75)
	at org.apache.camel.support.service.BaseService.start(BaseService.java:115)
	at org.apache.camel.quarkus.main.CamelMain.startEngine(CamelMain.java:120)
	at org.apache.camel.quarkus.main.CamelMainRuntime.start(CamelMainRuntime.java:49)
	... 10 more
Caused by: org.apache.camel.ResolveEndpointFailedException: Failed to resolve endpoint: knative://endpoint/sink due to: Cannot load Knative configuration from file or env variable
	at org.apache.camel.impl.engine.AbstractCamelContext.doGetEndpoint(AbstractCamelContext.java:888)
	at org.apache.camel.impl.engine.AbstractCamelContext.getEndpoint(AbstractCamelContext.java:777)
	at org.apache.camel.support.CamelContextHelper.resolveEndpoint(CamelContextHelper.java:123)
	at org.apache.camel.reifier.SendReifier.resolveEndpoint(SendReifier.java:43)
	at org.apache.camel.reifier.SendReifier.createProcessor(SendReifier.java:36)
	at org.apache.camel.reifier.ProcessorReifier.makeProcessor(ProcessorReifier.java:752)
	at org.apache.camel.reifier.ProcessorReifier.addRoutes(ProcessorReifier.java:495)
	at org.apache.camel.reifier.RouteReifier.doCreateRoute(RouteReifier.java:383)
	... 23 more
Caused by: java.lang.IllegalStateException: Cannot load Knative configuration from file or env variable
	at org.apache.camel.component.knative.KnativeComponent.getKnativeConfiguration(KnativeComponent.java:277)
	at org.apache.camel.component.knative.KnativeComponent.createEndpoint(KnativeComponent.java:223)
	at org.apache.camel.support.DefaultComponent.createEndpoint(DefaultComponent.java:240)
	at org.apache.camel.impl.engine.AbstractCamelContext.doGetEndpoint(AbstractCamelContext.java:855)
	... 30 more

I have no Knative eventing/serving enabled on my cluster but the integration tries to use Knative as sink.

Here is the source generated by the binding:

data:
  content: |
    - from:
        steps:
        - to: knative:endpoint/sink
        uri: kamelet:timer-source?message=Hello+world%21

Here is the KameletBinding that I am using

apiVersion: camel.apache.org/v1alpha1
kind: KameletBinding
metadata:
  name: timer-source-uri
spec:
  source:
    ref:
      kind: Kamelet
      apiVersion: camel.apache.org/v1alpha1
      name: timer-source
    properties:
      message: "Hello world!"
  sink:
    uri: http://greeting-service.yaks-demo/greeting
@nicolaferraro nicolaferraro added this to the 1.3.0 milestone Oct 21, 2020
@nicolaferraro
Copy link
Member

Strange, there's an e2e test about that: https://github.com/apache/camel-k/blob/master/e2e/yaks/common/kamelet-binding/timer-source-binding-display.yaml (needs to be completely changed using latest news on Yaks)

Do you have knative enabled on the cluster? That may be the issue.

@nicolaferraro
Copy link
Member

I confirm this happens on non-knative clusters. Need a to fix.

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.

2 participants