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

Cannot load Knative configuration from file or env variable #654

Closed
Emmerson-Miranda opened this issue May 12, 2019 · 22 comments
Closed

Cannot load Knative configuration from file or env variable #654

Emmerson-Miranda opened this issue May 12, 2019 · 22 comments
Labels

Comments

@Emmerson-Miranda
Copy link

Hello,

I trying to run the examples

  • oc create -f messages-channel.yaml
  • kamel run feed.groovy

In minikube console I have following message:
Failed to resolve endpoint: knative://channel/messages due to: Cannot load Knative configuration from file or env variable

Please find attached minishift log file.

feed-845b4f57b-8zqtz.log

Am I missing some configuration steps ?

@lburgazzoli
Copy link
Contributor

This should have been fixed in the latest code, can you try to use kamel-k from master ?

@Emmerson-Miranda
Copy link
Author

Hi,

I'm using last version of camel-k and deployed on top minishift v1.33.0+ba29431

Cheers

@Emmerson-Miranda
Copy link
Author

BTW Im using macOS Mojave 10.14.4

@nicolaferraro
Copy link
Member

Do you have Knative installed on your Minishift? Which installation procedure did you follow?

@lburgazzoli lburgazzoli added the status/waiting-for-feedback Needs some feedback label Jun 21, 2019
@lburgazzoli
Copy link
Contributor

@Emmerson-Miranda are you still experiencing this issue ?

@sully6768
Copy link

sully6768 commented Aug 19, 2019

I am experiencing this issue on OCP 4.1 using Camel-K 1.0.0-M1 and Knative 0.7.1.

@sully6768
Copy link

Here are the logs:
printer-7c659d566f-55jtc-integration.log

Steps:
OCP 4.1.8 installed on AWS

I logged into the OCP console and installed the Knative Server and Event operators. Afterwards, I created the message-channel and the words-channel in-memory channels using the Knative Event Operator in the console. I then installed the Camel-K CRDs
./kamel install --cluster-setup

I did this because I wasn't sure which project to install the two message channels.

I then created the user bob as a basic user
oc adm policy add-role-to-user basic-user bob

After logging in as the bob user I created the camel-k-project and ran the operator install in that project:
oc new-project camel-k-project
./kamel install

After that deployed I ran the basic sample install which worked corectly. Then I tried to install the knative printer.groovy file as instructed:
./kamel run examples/knative/printer.groovy

This is when the error was thrown:
Exception in thread "main" org.apache.camel.FailedToCreateRouteException: Failed to create route route1: Route(route1)[From[knative:channel/words] -> [ConvertBodyTo[... because of Failed to resolve endpoint: knative://channel/words due to: Cannot load Knative configuration from file or env variable at org.apache.camel.reifier.RouteReifier.createRoute(RouteReifier.java:100) at org.apache.camel.impl.DefaultModel.start(DefaultModel.java:346) at org.apache.camel.impl.DefaultModel.startRoute(DefaultModel.java:320) at org.apache.camel.impl.DefaultModel.startRouteDefinitions(DefaultModel.java:313) at org.apache.camel.impl.DefaultModel.startRouteDefinitions(DefaultModel.java:292) at org.apache.camel.impl.AbstractModelCamelContext.startRouteDefinitions(AbstractModelCamelContext.java:330) at org.apache.camel.impl.engine.AbstractCamelContext.doStartCamel(AbstractCamelContext.java:2555) at org.apache.camel.impl.engine.AbstractCamelContext.lambda$doStart$2(AbstractCamelContext.java:2387) at org.apache.camel.impl.engine.AbstractCamelContext.doWithDefinedClassLoader(AbstractCamelContext.java:2404) at org.apache.camel.impl.engine.AbstractCamelContext.doStart(AbstractCamelContext.java:2385) at org.apache.camel.support.service.ServiceSupport.start(ServiceSupport.java:97) at org.apache.camel.impl.engine.AbstractCamelContext.start(AbstractCamelContext.java:2296) at org.apache.camel.main.Main.doStart(Main.java:117) at org.apache.camel.support.service.ServiceSupport.start(ServiceSupport.java:97) at org.apache.camel.main.MainSupport.run(MainSupport.java:196) at org.apache.camel.k.main.ApplicationRuntime.run(ApplicationRuntime.java:70) at org.apache.camel.k.main.Application.main(Application.java:44) Caused by: org.apache.camel.ResolveEndpointFailedException: Failed to resolve endpoint: knative://channel/words due to: Cannot load Knative configuration from file or env variable at org.apache.camel.impl.engine.AbstractCamelContext.getEndpoint(AbstractCamelContext.java:773) at org.apache.camel.support.CamelContextHelper.getMandatoryEndpoint(CamelContextHelper.java:55) at org.apache.camel.impl.engine.DefaultRouteContext.resolveEndpoint(DefaultRouteContext.java:114) at org.apache.camel.reifier.RouteReifier.doCreateRoute(RouteReifier.java:334) at org.apache.camel.reifier.RouteReifier.createRoute(RouteReifier.java:95) ... 16 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:129) at org.apache.camel.component.knative.KnativeComponent.createEndpoint(KnativeComponent.java:101) at org.apache.camel.support.DefaultComponent.createEndpoint(DefaultComponent.java:199) at org.apache.camel.impl.engine.AbstractCamelContext.getEndpoint(AbstractCamelContext.java:725) ... 20 more

@lburgazzoli
Copy link
Contributor

@sully6768 is this still an issue ?

@github-actions
Copy link
Contributor

github-actions bot commented Jun 6, 2020

This issue is stale because it has been open 30 days with no activity.
Remove stale label or comment or this will be closed in 7 days.

@christophd
Copy link
Contributor

this error indicates that Knative serving is missing on the cluster or that Camel K is misconfigured according to Knative serving (e.g. installation of Knative serving has been done after Camel K installation).

Serving is mandatory to inject proper K_SINK env var as part of sink binding when resolving broker URLs in the integration.

Reviewing Knative serving installation and Camel K configuration may help fixing this kind of error

@squakez
Copy link
Contributor

squakez commented Nov 22, 2022

@christophd this issue was closed long time ago, do you know if it's still relevant?

@christophd
Copy link
Contributor

@squakez I think users are still able to hit that error when Knative serving is missing/misconfigured. I actually hit that yesterday and wanted to share a potential root cause so others hitting this may have an idea

@squakez squakez reopened this Nov 22, 2022
@squakez squakez added area/knative Related to Knative and removed status/waiting-for-feedback Needs some feedback status/stale labels Nov 22, 2022
@christophd
Copy link
Contributor

The question is that comes to my mind is: Do we have an alternative way to configure a Knative component when serving is not available on the cluster. As mentioned at the moment we rely on the K_SINK injection mechanism provided by Knative Serving.

@christophd
Copy link
Contributor

I guess you will need to explicitly provide the Knative broker URL then as a component property when Serving is not available

@christophd
Copy link
Contributor

the same error message has been mentioned here: #1871

@lburgazzoli
Copy link
Contributor

the knative environment concept has been added for that purpose so if that json is properly crafted, the component should work. As today I think, the camel-k operator automatically configure the sinkbinding trait or something like that so a K_SINK is expected.

Maybe the operator can create a synthetic K_SINK env var if serving is not installed.

@christophd
Copy link
Contributor

Yes, K_SINK added by the Camel K operator could be a fallback option. But the user somehow needs to provide that broker URL in that case or do you think of adding some addressable resolver mechanism to the Camel K operator?

@lburgazzoli
Copy link
Contributor

both are fine with me, like:

  1. if user provide something use it
  2. try to resolve it on the operator
  3. if not resolved or missing requirements, don't deploy the integration (we have a similar issue opened already)

@github-actions
Copy link
Contributor

This issue has been automatically marked as stale due to 90 days of inactivity.
It will be closed if no further activity occurs within 15 days.
If you think that’s incorrect or the issue should never stale, please simply write any comment.
Thanks for your contributions!

@christophd
Copy link
Contributor

still relevant

@github-actions
Copy link
Contributor

This issue has been automatically marked as stale due to 90 days of inactivity.
It will be closed if no further activity occurs within 15 days.
If you think that’s incorrect or the issue should never stale, please simply write any comment.
Thanks for your contributions!

@squakez
Copy link
Contributor

squakez commented Apr 18, 2024

I think this is no longer relevant after the changes introduced in #5186 - please, create a new issue if any other problem happens again.

@squakez squakez closed this as not planned Won't fix, can't repro, duplicate, stale Apr 18, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

6 participants