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

Salesforce Integration as Knative Serverless Service fails #1713

Closed
MaciekLeks opened this issue Sep 24, 2020 · 2 comments
Closed

Salesforce Integration as Knative Serverless Service fails #1713

MaciekLeks opened this issue Sep 24, 2020 · 2 comments

Comments

@MaciekLeks
Copy link

MaciekLeks commented Sep 24, 2020

I wrote some simple integration in CamelSource to emit a Platform Event, like so:

apiVersion: sources.knative.dev/v1alpha1
kind: CamelSource
metadata:
  name: camel-timer-source
spec:
  source:
    integration:
      configuration:
        - type: secret
          value: salesforce
      dependencies:
        - camel:log
        - camel:salesforce
        - camel:bean
    flow:
      from:
        uri: timer:tick
        parameters:
          period: 3s
        steps:
          - set-header:
              name: Content-Type
              constant: application/json
         - transform:
              simple: '{ "Field1__c": "${exchangeProperty.CamelTimerCounter}" }'
          - to: "log:received?showAll=true&multiline=true"
          - to:
              uri: "salesforce:createSObject?sObjectName=Test__e"
  sink:
    ref:
      apiVersion: messaging.knative.dev/v1alpha1
      kind: KafkaChannel
      name: salesforce-out

run as:

kubectl apply -f 02-camel-ticker.yaml

My salesforce.properties:

camel.component.salesforce.config.raw-payload=true
camel.component.salesforce.config.api-version=42.0
camel.component.salesforce.login-config.type=USERNAME_PASSWORD
camel.component.salesforce.login-config.login-url=...
camel.component.salesforce.login-config.instance-url=...
camel.component.salesforce.login-config.client-id=...
camel.component.salesforce.login-config.client-secret=...
camel.component.salesforce.login-config.user-name=...
camel.component.salesforce.login-config.password=...

is saved in a secret:

kubectl create secret generic salesforce --from-file=salesforce.properties

It works!

Now I'm trying to make it Knative Serverless Service:

- from:
    uri: timer:tick
    parameters:
      period: 3s
    steps:
      - set-header:
          name: Content-Type
          constant: application/json
      - set-body:
          constant: '{ "Field1__c": "test" }'
      - to:
          uri: "salesforce:createSObject?sObjectName=Test__e"

so I run it as follows:
kamel run --secret=salesforce --dependency camel:salesforce --dependency camel:log --dependency camel:bean 03-camel-ticker.yaml --dev

The results given by camel-k-operator says there is no matching credentials.

camel-k-operator-74c76d7478-65v9q camel-k-operator [INFO] Building camel-k-integration 1.1.1
camel-k-operator-74c76d7478-65v9q camel-k-operator [INFO] --------------------------------[ jar ]---------------------------------
camel-k-operator-74c76d7478-65v9q camel-k-operator [INFO]
camel-k-operator-74c76d7478-65v9q camel-k-operator [INFO] --- camel-k-maven-plugin:1.4.1:generate-dependency-list (default-cli) @ camel-k-integration ---
camel-k-operator-74c76d7478-65v9q camel-k-operator [INFO] ------------------------------------------------------------------------
camel-k-operator-74c76d7478-65v9q camel-k-operator [INFO] BUILD SUCCESS
camel-k-operator-74c76d7478-65v9q camel-k-operator [INFO] ------------------------------------------------------------------------
camel-k-operator-74c76d7478-65v9q camel-k-operator [INFO] Total time:  2.283 s
camel-k-operator-74c76d7478-65v9q camel-k-operator [INFO] Finished at: 2020-09-24T14:38:53Z
camel-k-operator-74c76d7478-65v9q camel-k-operator [INFO] ------------------------------------------------------------------------
camel-k-operator-74c76d7478-65v9q camel-k-operator {"level":"info","ts":1600958333.4652996,"logger":"camel-k.builder","msg":"step done in 4.428595 seconds","step":"github.com/apache/camel-k/pkg/builder/runtime/ComputeDependencies","phase":20,"name":"kit-btmatq5mqpm5ihe80gqg","task":"builder"}
camel-k-operator-74c76d7478-65v9q camel-k-operator {"level":"info","ts":1600958333.4653776,"logger":"camel-k.builder","msg":"executing step","step":"github.com/apache/camel-k/pkg/builder/IncrementalImageContext","phase":30,"name":"kit-btmatq5mqpm5ihe80gqg","task":"builder"}
camel-k-operator-74c76d7478-65v9q camel-k-operator {"level":"info","ts":1600958333.4736035,"logger":"camel-k.builder","msg":"step done in 0.008197 seconds","step":"github.com/apache/camel-k/pkg/builder/IncrementalImageContext","phase":30,"name":"kit-btmatq5mqpm5ihe80gqg","task":"builder"}
camel-k-operator-74c76d7478-65v9q camel-k-operator {"level":"info","ts":1600958333.4736774,"logger":"camel-k.builder","msg":"executing step","step":"github.com/apache/camel-k/pkg/builder/spectrum/Publisher","phase":40,"name":"kit-btmatq5mqpm5ihe80gqg","task":"builder"}
camel-k-operator-74c76d7478-65v9q camel-k-operator spectrum - 2020/09/24 14:38:53 No matching credentials were found, falling back on anonymous
camel-k-operator-74c76d7478-65v9q camel-k-operator spectrum - 2020/09/24 14:38:53 Pulling base image 10.109.211.188/a/camel-k-kit-btln5pdmqpmaptfa8qi0@sha256:b30531f85fdc89c0f2a120110a2af2811d3017ffa2e2c0bca572f8b80b8c5d3d (insecure=true)...
camel-k-operator-74c76d7478-65v9q camel-k-operator {"level":"info","ts":1600958333.4922576,"logger":"camel-k.builder","msg":"step failed with error: could not pull base image image 10.109.211.188/a/camel-k-kit-btln5pdmqpmaptfa8qi0@sha256:b30531f85fdc89c0f2a120110a2af2811d3017ffa2e2c0bca572f8b80b8c5d3d: GET http://10.109.211.188/v2/a/camel-k-kit-btln5pdmqpmaptfa8qi0/manifests/sha256:b30531f85fdc89c0f2a120110a2af2811d3017ffa2e2c0bca572f8b80b8c5d3d: MANIFEST_UNKNOWN: manifest unknown; map[Name:a/camel-k-kit-btln5pdmqpmaptfa8qi0 Revision:sha256:b30531f85fdc89c0f2a120110a2af2811d3017ffa2e2c0bca572f8b80b8c5d3d]","step":"github.com/apache/camel-k/pkg/builder/spectrum/Publisher","phase":40,"name":"kit-btmatq5mqpm5ihe80gqg","task":"builder"}
camel-k-operator-74c76d7478-65v9q camel-k-operator {"level":"info","ts":1600958333.4923496,"logger":"camel-k.builder","msg":"dependencies: [camel:bean camel:core-languages camel:log camel:salesforce camel:timer mvn:org.apache.camel.k/camel-k-loader-yaml mvn:org.apache.camel.k/camel-k-runtime-main]"}

...and the whole play stops.

Any ideas?

Kubernetes version: 1.19.2
Knative: latest for all components

@nicolaferraro
Copy link
Member

I think the relevant problem is here: MANIFEST_UNKNOWN: manifest unknown
This is an issue that happened more in the past. There are some incompatibilities between the registry and the client...

I think that doing a kamel reset will trigger a new build from scratch, so you'd see the integration running again.

This is independent from what you write in the DSL.

P.s. to make a serverless service, you probably need to start from something scalable, e.g. from: uri: knative:endpoint/service

@MaciekLeks
Copy link
Author

@nicolaferraro What can I say. You are the boss, that is, kamel reset did the job.

As far to serverless service you are right. I forgot to mention that it's not a serverless version of code.

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

No branches or pull requests

2 participants