cancel
Showing results for 
Search instead for 
Did you mean: 

Unable to subscribe to multi-tenant application

Hi,

I've cloned the repository here and I'm following the instruction to use this app as multi-tenant as described in the section "Deploy as Multitenant Application". However after having deployed my app to the Trial landscape, when trying to subscribe from a different subaccount to this app, I receive a "Subscription failed" error. Going deep into the error I see this:

{"subscriptions":[{"subdomain":"e4e45564portal","appName":"bookshop-java-public-e4e45564trial-dev","consumerTenantId":"881d838a-f28e-474f-90c2-c8348f963e98","globalAccountId":"bf4cb67e-7ed3-4154-b699-088e74780602","subaccountId":"881d838a-f28e-474f-90c2-c8348f963e98","state":"SUBSCRIBE_FAILED","error":"subscribe failed. Error: subscribe failed in create callback. Parameters: rootSubscription: RootSubscription : { xsuaaAppId: bookshop-java-public-e4e45564trial-dev!b64266, consumerTenant: 881d838a-f28e-474f-90c2-c8348f963e98, subdomain: e4e45564portal }. Error description: Timestamp: Mon Mar 01 10:15:11 UTC 2021, correlationId: ee8a5aad-12dc-488d-45c3-9380ea356088, Details: Error manage callbacks: Failed to call callback url PUT: https://e4e45564trial-dev-bookshop-java-public-srv.cfapps.eu10.hana.ondemand.com/mt/v1.0/subscriptio..., correlationId: ee8a5aad-12dc-488d-45c3-9380ea356088, appName: bookshop-java-public-e4e45564trial-dev and consumer tenant: 881d838a-f28e-474f-90c2-c8348f963e98. Body: SubscriptionCallbackPayloadDto(subscriptionAppName=bookshop-java-public-e4e45564trial-dev, subscriptionAppId=bookshop-java-public-e4e45564trial-dev!b64266, subscribedTenantId=881d838a-f28e-474f-90c2-c8348f963e98, subscribedSubaccountId=881d838a-f28e-474f-90c2-c8348f963e98, subscribedZoneId=null, subscribedSubdomain=e4e45564portal, subscribedLicenseType=TRIAL, subscribedCrmId=null, subscriptionAppPlan=null, subscriptionAppAmount=null, dependantServiceInstanceAppIds=null, userId=simmaco.ferriero@sap.com, userInfo=UserInfoPojo(userId=simmaco.ferriero@sap.com, userGuid=00f2c5d1-d979-410d-aeed-dcc9662a4110, userName=simmaco.ferriero@sap.com, email=simmaco.ferriero@sap.com, subIdp=I045523, sub=00f2c5d1-d979-410d-aeed-dcc9662a4110), appProviderCustomProperties=null, dependentServiceInstanceAppIds=null, additionalInformation={tenantMetadataUrl=https://e4e45564portal.authentication.eu10.hana.ondemand.com/saml/metadata}, globalAccountGUID=bf4cb67e-7ed3-4154-b699-088e74780602, eventType=CREATE) Reason: returned value from application: 500 INTERNAL_SERVER_ERROR, with body: Failed to process subscription of tenant '881d838a-f28e-474f-90c2-c8348f963e98'","dependencies":[],"createdOn":"Mon Mar 01 10:14:59 UTC 2021","changedOn":"Mon Mar 01 10:15:12 UTC 2021"}]} 

What could be the problem?

Simmaco

marcbecker
Advisor
Advisor
0 Kudos

You should find additional information about this error in the logs of your "bookshop-java-public-srv" application (e.g. full Java stracktrace). Can you please provide these logs here to further narrow down the cause of the error?

Accepted Solutions (0)

Answers (5)

Answers (5)

0 Kudos

I was also facing the same issue ..But i am not able to solve the problem...can any one suggest a solution

christoffer_fuss
Participant
0 Kudos

For me this solution is working as well, thank you very much 🙂
I see the books in the fiori application but I have 2 questions:

  1. I dont see a HDI container for the subscribed tenant in my Database Explorer.
  2. I cannot assign the admin role to use the "Manage Books" app becuase I cannot create the admin role based on the role template "admin". The role is always created with the role template "Extension Admin"

Is this working for you simmaco.ferriero?

Best regards,

Chris

0 Kudos

Hi, just for information. I managed to make it working by changing the package.json file inside the sidecar to this:

{
    "name": "deploy",
    "dependencies": {
        "@sap/cds": "^4.5.3",
        "@sap/cds-mtx": "^1.1.2",
        "@sap/hdi-deploy": "^4.0.3",
        "@sap/instance-manager": "^2.2.0",
        "@sap/xssec": "^3.0.9",
        "@sap/hana-client": "^2.7.23",
        "express": "^4.17.1",
        "passport": "^0.4.1"
    },
    "scripts": {
        "start": "node server.js"
    }
}


and then removing and recreating the subscription.

Not sure if this is the right solution, but worked for me.

Simmaco

eckart_liemke
Explorer
0 Kudos

Hi Simmaco,

yes, with @sap/cds-mtx@1.1.3, the robustness of the container creation has been slightly improved.

Regards,

Eckart

former_member269715
Discoverer
0 Kudos

Try setting the HANA Instance's "Allowed connections" option to "Allow all IP addresses" allowall.png. This solved the issue for me but I have to figure out why the "Deny all IP addresses (except Business Technology Platform)" option was throwing an error.


If you have more than one instance running then you have to mention which one to pick up in the subscription handler

0 Kudos

Hi,

in my case it's already set in this way, so I think that the problem is different.

Simmaco

0 Kudos

Thanks for your answer, Marc. Here it is the log.

Cosnider that I just cloned the repo and followed those indications, without adding anything else. So, I think you should be able to replicate the same behaviour as well.

Simmaco

bookshop-java-public-srv-2021-03-01-12-53-49207000.txt

marcbecker
Advisor
Advisor
0 Kudos

Unfortunately the logs point to an issue in a different component: "Caused by: com.sap.cloud.mt.subscription.exceptions.InternalError: Sidecar returned http status 500". Can you please share the logs of the "bookshop-java-public-sidecar" application in your space?

former_member269715
Discoverer
0 Kudos

I am having a similar issue as well. Subscription fails with srv app giving the logs simlar to the original question.

"c.s.c.m.s.SubscriberSidecarImpl : Sidecar returned http status 500"

and

"Failed to process subscription of tenant '2995b828-ddff-4d9f-ae9b-3df0fafec20a' (service 'MtSubscriptionService$Default', event 'SUBSCRIBE', entity '<no entity>')

However the mtx-sidecar logs says something which goes like "Error: Instance, but no bindings for tenant". I am unable to figure out what does it mean.

I suspect it is failing to create the HDI instance.


mtx-sidecar.txt

eckart_liemke
Explorer
0 Kudos

Hi Simmaco,

the error that you see in the mtx-sidecar logs is already an aftereffect of an prior failure.

Could you try to unsubscribe and subscribe again and check in the logs of the mtx-sidecar what the initial error is?

How many databases do you have mapped to your cf space?

Thanks,

Eckart

0 Kudos

Hi Eckart,

I have just one database instance on my Trial landscape. I'm attaching here again some new logs.

Simmaco

bookshop-java-public-sidecar-2021-03-02-11-42-3276.txt

bookshop-java-public-srv-2021-03-02-11-42-18704000.txt