Showing results for 
Search instead for 
Did you mean: 

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



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 = [
    const access_strategy = {
        path: '/.*',
        methods: supportedMethodsList,
        // mutators: [{
        //     handler: 'header',
        //     config: {
        //         headers: {
        //             "x-forwarded-host": forwardUrl,
        //         }
        //     },
        // }],
        accessStrategies: [{
            handler: 'allow'

    const apiRuleTemplate = {
        apiVersion: '',
        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;



Why aren't you using .yaml?
0 Kudos

if you're talking about deployment, I've used the yaml files as indicated in

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

apiVersion: in deployment-services.yaml.

Major change was in createApiRule.js, since kyma dashboard was restricting creation to 
apiVersion: '',
 kind: 'APIRule',
View Entire Topic
Product and Topic Expert
Product and Topic Expert
0 Kudos

Hi @George_James 

We are very happy to welcome you to our SAP BTP Learning Group 

This is the perfect place for you to ask questions related to our SAP Business Technology Platform Learning Journeys or to our certification published on SAP Learning and get SAP expert advice and support.

While the topic you addressed  isn't specifically covered here  and since it can hardly be answered without in-depth knowledge, I can point you to an excellent resource to help find an answer to your question.
Please access the
SAP Developers Tutorial Navigator Develop and Register Multitenant Application in the SAP BTP Kyma R... 
Click the Feedback option there and choose the channel that fits best for your 

In your case I recommend to post the question  in our SAP community where you can directly exchange with experienced experts with project Background -  SAP Community is a public space where anyone can start discussions and questions are answered by anyone.

Please always feel free to come back to our SAP BTP Learning group to ask your questions related to our SAP Business Technology Platform Learning Journeys or to our certification published on SAP Learning  and collaborate with other learners to reach your learning goals and to prepare for your SAP Certification exams. However, for your particular question, I'd recommend the resource above.

I hope this helps, and best of luck!