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

Integration Platform issues when using the Operator #3297

Closed
utherp0 opened this issue May 24, 2022 · 11 comments
Closed

Integration Platform issues when using the Operator #3297

utherp0 opened this issue May 24, 2022 · 11 comments

Comments

@utherp0
Copy link

utherp0 commented May 24, 2022

This is an odd one; on OpenShift 4.10 when you install Camel-K/Integration it does not create by default an Integration Platform. When you create a default one and then create an Integration using 'kamel run' (in this case a simple Event reader - see https://github.com/utherp0/functest2/blob/main/camelk/EventReader.java) the integration fails. If you then delete the Integration Platform, and then run the Integration without a platform present the Operator will create an IP and the Integration runs.

However, if you create an Integration before you create a default Integration Platform the integration fails to start.

This is always repeatable on OCP4.10.

@christophd
Copy link
Contributor

When no IntegrationPlatform is present it gets created automatically with the 1st integration. So it should also work if you just install the operator and run the integration. The default platform gets created automatically as you have already mentioned.

Maybe the custom IntegrationPlatform that you have created manually is different to the automatically created one? Could you please check any difference that might cause the error?

Also when creating an IntegrationPlatform manually please mind that the platform needs to be in "Ready" state before starting an integration.

Could you please reproduce the error once again and share the operator logs so we can see why the integration was failing.

Many thanks!

@utherp0
Copy link
Author

utherp0 commented May 24, 2022

So, I think the problem I am seeing is that if I create a default ip before I run the integration it fails; the default is just 'as is', taking all the defaults on the Ux for the ip.

Creating one with no ip present does create the ip:

uther@ilawson-mac camelk % oc project camelktest
Now using project "camelktest" on server "https://api.cluster-nq5hk.nq5hk.sandbox542.opentlc.com:6443".
uther@ilawson-mac camelk % oc get ip
No resources found in camelktest namespace.
uther@ilawson-mac camelk % kamel run EventReader.java
integration "event-reader" created
uther@ilawson-mac camelk % oc get ip
NAME PHASE
camel-k Ready
uther@ilawson-mac camelk % oc get integration
NAME PHASE KIT REPLICAS
event-reader Building Kit kit-ca69lbu4gbef2b5j58f0

@christophd
Copy link
Contributor

would be good to see the error from the logs so I can have an idea what went wrong.

Are you using a global operator? where is that operator running (maybe in namespace camelktest)?

@utherp0
Copy link
Author

utherp0 commented May 24, 2022

Yup - I'm installing operator namespace bound, i.e. the operator is running locally. Once the test has completed (the build is taking a while) I'll spin up another namespace and create the ip first which should cause the problem, and will get the logs

@utherp0
Copy link
Author

utherp0 commented May 25, 2022

So, replicated it; there are no errors in the Operator log other than a repeat of:

{"level":"error","ts":1653463966.870432,"logger":"cmd","msg":"couldn't get resource list for metrics.k8s.io/v1beta1: the server is currently unable to handle the request\n","stacktrace":"github.com/apache/camel-k/vendor/k8s.io/klog/v2.(*loggingT).output\n\tgithub.com/apache/camel-k/vendor/k8s.io/klog/v2/klog.go:914\ngithub.com/apache/camel-k/vendor/k8s.io/klog/v2.(*loggingT).printDepth\n\tgithub.com/apache/camel-k/vendor/k8s.io/klog/v2/klog.go:733\ngithub.com/apache/camel-k/vendor/k8s.io/klog/v2.ErrorDepth\n\tgithub.com/apache/camel-k/vendor/k8s.io/klog/v2/klog.go:1451\ngithub.com/apache/camel-k/vendor/k8s.io/apimachinery/pkg/util/runtime.logError\n\tgithub.com/apache/camel-k/vendor/k8s.io/apimachinery/pkg/util/runtime/runtime.go:114\ngithub.com/apache/camel-k/vendor/k8s.io/apimachinery/pkg/util/runtime.HandleError\n\tgithub.com/apache/camel-k/vendor/k8s.io/apimachinery/pkg/util/runtime/runtime.go:108\ngithub.com/apache/camel-k/vendor/k8s.io/client-go/discovery/cached/memory.(*memCacheClient).ServerResourcesForGroupVersion\n\tgithub.com/apache/camel-k/vendor/k8s.io/client-go/discovery/cached/memory/memcache.go:101\ngithub.com/apache/camel-k/vendor/k8s.io/client-go/discovery.fetchGroupVersionResources.func1\n\tgithub.com/apache/camel-k/vendor/k8s.io/client-go/discovery/discovery_client.go:361"}

The Camel-k Pod is in crash loop backoff (the behaviour I see when I have the ip issues):

Caused by: org.apache.camel.ResolveEndpointFailedException: Failed to resolve endpoint: knative://event/techtalkevent due to: Cannot load Knative configuration from file or env variable
at org.apache.camel.impl.engine.AbstractCamelContext.doGetEndpoint(AbstractCamelContext.java:962)
at org.apache.camel.impl.engine.AbstractCamelContext.getEndpoint(AbstractCamelContext.java:844)
at org.apache.camel.support.CamelContextHelper.getMandatoryEndpoint(CamelContextHelper.java:58)
at org.apache.camel.reifier.AbstractReifier.resolveEndpoint(AbstractReifier.java:177)
at org.apache.camel.reifier.RouteReifier.doCreateRoute(RouteReifier.java:94)
at org.apache.camel.reifier.RouteReifier.createRoute(RouteReifier.java:74)
... 30 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:278)
at org.apache.camel.component.knative.KnativeComponent.createEndpoint(KnativeComponent.java:226)
at org.apache.camel.support.DefaultComponent.createEndpoint(DefaultComponent.java:171)
at org.apache.camel.impl.engine.AbstractCamelContext.doGetEndpoint(AbstractCamelContext.java:928)
... 35 more

This error goes away if I remove the ip I created and use 'kamel run' to create the Integration. It only occurs when I create an ip from the Operator page and take all the defaults (i.e. just hit create). When I do that the ip does create - it is in a state of running when I create the integration.

@christophd
Copy link
Contributor

what does it mean if you say the operator is running locally? you are running the operator namespace scoped on a single namespace or on your local machine?

@utherp0
Copy link
Author

utherp0 commented May 25, 2022

The Operator is deployed into the namespace rather than across the Cluster, by local I mean namespace bound
Screenshot 2022-05-25 at 09 12 20

@mathianasj
Copy link

i am seeing this issue as well

@christophd
Copy link
Contributor

could you please do a kubectl get integrationplatform camel-k -o yaml for both the manual created ip and the automatically created ip. This will print the custom resource and we can see any difference that makes the one succeed while the other fails

@mathianasj
Copy link

I figured out the problem I missed in the documentation that if installed on openshift I did not create an IP once I removed it everything started working.

@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!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants