cancel
Showing results for 
Search instead for 
Did you mean: 

Subscribing a Kyma based Multi tenant app in consumer account fails with :create APIRule error

George_James
Advisor
Advisor

Mission: https://developers.sap.com/mission.cp-kyma-multitenant.html 
--------------------------

Hi All,

I'm new to Kyma, BTP and all things cloud. Was trying to implement the above tutorial for a Kyma based multitenant app. The backend and app router are deployed to the cluster successfully. I tried subscribing from a Consumer subaccount, but it fails with following error:
Technical Details:
subscribe failed. Error: subscribe failed in create callback.

 Error description: Timestamp: Fri Feb 03 09:53:47 GMT 2023, correlationId: 8007ab48-fa1b-4d3a-73cc-d67f2a4efe42, Details: Error manage callbacks: Failed to call callback url.....
eventType=CREATE) Reason: returned value from application: 500 INTERNAL_SERVER_ERROR, with body: create APIRule error

 

As the error log contains uuids to subaccounts, I havent pasted the whole log, do let me know what else to add.
While exploring the API Rule resource, I found that the Kyma runtime is enforcing beta1 version, so I tweaked the 'createApiRule.js' to create a v1beta APIRule, but the same error still occurs. Could someone support on this?

 

 

 

 

 

module.exports = {
    createApiRule: createApiRule
}

function createApiRule(svcName, svcPort, host, clusterName) {

    let forwardUrl = host + '.' + clusterName;
    const supportedMethodsList = [
        'GET',
        'POST',
        'PUT',
        'PATCH',
        'DELETE',
        'HEAD',
    ];
    const access_strategy = {
        path: '/.*',
        methods: supportedMethodsList,
        // mutators: [{
        //     handler: 'header',
        //     config: {
        //         headers: {
        //             "x-forwarded-host": forwardUrl,
        //         }
        //     },
        // }],
        accessStrategies: [{
            handler: 'allow'
        }],
    };

    const apiRuleTemplate = {
        apiVersion: 'gateway.kyma-project.io/v1beta1',
        kind: 'APIRule',
        metadata: {
            name: host + '-apirule',
        },
        spec: {
            gateway: 'kyma-gateway.kyma-system.svc.cluster.local',
            host: host,
            service: {                
                name: svcName,
                port: svcPort,
            },
            rules: [access_strategy],
        },
    };
    return apiRuleTemplate;
}

 

 

LuizGomes
Participant
Why aren't you using .yaml?
George_James
Advisor
Advisor
0 Kudos

if you're talking about deployment, I've used the yaml files as indicated in
https://github.com/SAP-samples/btp-kyma-runtime-multitenancy-tutorial/tree/main/Mission%20-%20Develo...

few changes I've done is change some services, which were updated to latest apiVersion. eg:
apiVersion: servicecatalog.k8s.io/v1beta1 was giving an error so changed to 

apiVersion: services.cloud.sap.com/v1 in deployment-services.yaml.

Major change was in createApiRule.js, since kyma dashboard was restricting creation to 
apiVersion: 'gateway.kyma-project.io/v1beta1',
 kind: 'APIRule',
View Entire Topic
Pettmark
Explorer

Hi,

Did you ever find a solution for this? I am facing the same issue. The problem arise after the following steps have been conducted.

1. Created a slack instance in Open Connectors and tested the connector with response 200.

Pettmark_0-1666957185924.png

2. Created an API provider of type Open Connector with organization- and user secret from the slack instance.

Pettmark_1-1666957367439.png

3. Tried to click Test Connection(which is not a part of the exercise) and got the same error.

Pettmark_2-1666957513693.png

4. Went on to the next step and created an API an deployed it.

Pettmark_3-1666957590874.png

5. Followed the exercised and tried to test the API as described in the exercise. 

 

Pettmark_9-1666957851783.png

6. Clicked "send" and got the same error.

Pettmark_10-1666957910704.png

Have anyone found the solution for this?

Best regards,

Petter

 

 

 

 

 

 

 

 

liyana87
Explorer
0 Kudos

Hi Pettmark,

Trust you doing great,

Did you happend to solve this issue? I'm doing the learning and face exactly the same problem with you.

Or if anyone could help to solve this?

 

Thanks in advance.

Best Regards,
Liyana

Pettmark
Explorer

Hi,

Yes. I waited a dew days and then it worked...

Best regards,

Petter

Sidney
Product and Topic Expert
Product and Topic Expert

Hi Petter,

Thank you for your reply! 

Sorry I replied late. I faced the same issue but just like other repliers to your comment, I waited for another day and checked, it resolved automatically.

BR,

Sindy