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

MongoDB sink: error during trait customization: component not found for uri #4058

Closed
fourstepper opened this issue Feb 14, 2023 · 8 comments
Closed
Labels
area/kamelets kind/bug Something isn't working

Comments

@fourstepper
Copy link

fourstepper commented Feb 14, 2023

Hi, I am having issues setting up the MongoDB sink using the included kamelet

I am trying to set up a mongoDB sink with RMQ source using a kameletbinding after installing the camel-k operator 1.11.x

This issue was also discussed on Zulip here

My full configuration is:

apiVersion: camel.apache.org/v1alpha1
kind: KameletBinding
metadata:
  name: rmq-source-mongodb-sink-test
  namespace: event-store
spec:
  source:
    ref:
      kind: Kamelet
      apiVersion: camel.apache.org/v1alpha1
      name: heu-rabbitmq-source # custom kamelet defined where we configure URL query params
    properties:
      username: "infra-eventstore-postman"
      password: "<REDACTED>"
      addresses: <REDACTED>:5672
      exchangeName: op-ex
      routingKey: infra-eventstore
      vhost: op-vh
      queue: infra-eventstore-test.1
  sink:
    ref:
      kind: Kamelet
      apiVersion: camel.apache.org/v1alpha1
      name: mongodb-sink
    properties:
      hosts: "mongo-mongodb-headless.event-store:27017"
      database: "event-store"
      collection: "event-store"
      createCollection: true
      username: "event-store"
      password: "<REDACTED>"

This throws the following error in the KameletBindings' status that leaves me a bit puzzled and stuck:

Status:
  Conditions:
    Last Transition Time:  2023-02-14T11:46:19Z
    Last Update Time:      2023-02-14T11:53:07Z
    Message:               error during trait customization: component not found for uri "{{local-mongodb}}:test?collection=%7B%7Bcollection%7D%7D&createCollection=%7B%7B%3FcreateCollection%7D%7D&database=%7B%7Bdatabase%7D%7D&hosts=%7B%7Bhosts%7D%7D&operation=insert&password=%7B%7B%3Fpassword%7D%7D&username=%7B%7B%3Fusername%7D%7D&writeConcern=%7B%7B%3FwriteConcern%7D%7D" in camel catalog runtime version 1.16.0
    Reason:                InitializationFailed
    Status:                False
    Type:                  Ready
  Observed Generation:     3
  Phase:                   Error

This is probably somehow related to this line, but I still don't have many ideas on how to fix the issue https://github.com/apache/camel-kamelets/blob/main/kamelets/mongodb-sink.kamelet.yaml#L106

This isn't even mentioned in the docs anywhere and I am using the stock Kamelet that comes with the operator when installing it using the helm-chart

@oscerd
Copy link
Contributor

oscerd commented Feb 14, 2023

@squakez as far as I remember this always worked in this way. Do you have any clue? I'll try to reproduce btw

@squakez
Copy link
Contributor

squakez commented Feb 15, 2023

I have the feeling it can be a regression when we introduced #3640 - basically there is a check that verify the components exists in the catalog, but, in this case since it's a variable, it may be not the case. @tadayosi wdyt?

@squakez squakez added the kind/bug Something isn't working label Feb 15, 2023
@oscerd
Copy link
Contributor

oscerd commented Feb 15, 2023

There are multiple kamelets using that approach. I think this is important to fix for 1.12.0. Let me add it to the list.

@oscerd oscerd mentioned this issue Feb 15, 2023
@christophd
Copy link
Contributor

I think this is the same as #3896

The issue #3896 has already been fixed in #3901

@squakez
Copy link
Contributor

squakez commented Feb 15, 2023

Yes, thanks @christophd , it seems it will be fixed in 1.12. I wonder if it makes sense to backport to 1.11 and 1.10 branches as well, as it looks to be failing on those versions as well. Do you think you can have a look?

@oscerd
Copy link
Contributor

oscerd commented Feb 15, 2023

Probably it doesn't make sense to do it on 1.11. It's not an LTS, we released 1.11.1 just for OpenJDK troubles

@squakez
Copy link
Contributor

squakez commented Feb 27, 2023

This should be fixed with 1.12.0 just released. @fourstepper can you please have a look and confirm if it now works?

@fourstepper
Copy link
Author

Hi @squakez , I can confirm that this works now, thank you!

I will therefore close this issue

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/kamelets kind/bug Something isn't working
Projects
None yet
Development

No branches or pull requests

4 participants