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

[CF Multitenant deploy error] Unable to start application aisaas-srv-${space}, Error acquiring tenant t0 #18

Open
AlfredWangTJ opened this issue Apr 24, 2024 · 6 comments

Comments

@AlfredWangTJ
Copy link

Hi Experts,

I'm following the instruction to deploy this package for Cloud Foundry Runtime / Multitenant scenario, but I got below error when executing step 3-deploy/2-DeployTheApplication: npm run deploy.

Application "aisaas-srv-cf_space_us10" staged
Starting application "aisaas-srv-cf_space_us10"...
Error starting application "aisaas-srv-cf_space_us10": Some instances have crashed. Check the logs of your application for more information.
Download the application logs via the dmol command and check them for more information.

image

I downloaded aisaas-srv-cf_space_us10.log for details, This is the error I found but I have no idea what is the cause since I'm new to CAP.

Error: Error acquiring tenant t0: unknown error

image

The log file is attached:
aisaas-srv-cf_space_us10.log

Could you please suggest how to fix this error, thanks a lot.

BTW:
Before this step, another error raised in step 3-deploy/1-BuildTheComponents: npm run build:mbt

cds.service.protocols.protocol4(...).startsWith is not a function

I did not capture a screenshot, according to a blog, I updated the version of @sap/cds-dk. This is what I have done.
# Run in folder: ./multi-tenant/code
npm i @sap/cds-dk

After executing this npm command, the 'startsWith' error is fixed but I'm not sure whether this could cause the error above when upload and deploy the Application to Cloud Foundry.

@kay-schmitteckert
Copy link
Contributor

Hi @AlfredWangTJ,

there was an update on cds. The related implementation is fixed already in this multitenant repo (https://github.com/SAP-samples/btp-cap-multitenant-saas/) and this fix now has been also applied for this repo. Could you please pull the latest version, rebuild with respect to the updates .cdsrc.json and deploy again?

Best
Kay

@AlfredWangTJ
Copy link
Author

AlfredWangTJ commented Apr 25, 2024

Hi Kay,

The issue is fixed after build the latest version. Thanks a lot.

I find another issue when creating Subscriptions of the service for 'premium plan'.

Couldn't subscribe to GenAI Mail Insights cf_space_us10. Please try again. If the problem persists, open a support case for this application.

Technical Details:
Subscribe failed. Error: Subscribe failed in create callback. Error: CorrelationId: 6a4f8da7-6369-48fc-6777-ca5aed02d380, Please open a ticket for application/service with appName: aisaas-cf_space_us10-BTP###flx. Failed to call callback. URL: PUT https://btp###flx-cf-space-us10-aisaas-srv.cfapps.us10.hana.ondemand.com/-/cds/saas-provisioning/tenant/85b###911. Consumer tenant: 85b###911. Callback response: {"error":{"code":"500","message":"Internal Server Error"}}. status code: 500 INTERNAL_SERVER_ERROR

image
image

Tried to access the URL: GET https://btp###flx-cf-space-us10-aisaas-srv.cfapps.us10.hana.ondemand.com/-/cds/saas-provisioning/tenant/85b###911 with browser and got '401-Unauthorized' error, this may not help because no credentials is attached when request the URL with browser.

{"error":{"code":"401","message":"Unauthorized"}}

log file for aisaas-srv-cf_space_us10 attached:
aisaas-srv-cf_space_us10-2024-04-25 03_49_04.566+0000.txt

image
image

This issue only occurred for 'premium plan', the 'default plan' can be subscribed successfully. After subscribe a 'default plan' and assign relevant roles to subaccount user. I got 404 error when try to open the application.

image

404 Not Found: Requested route ('genai-email-insights-n75htxcn-aisaas-cf_space_us10.cfapps.us10.hana.ondemand.com') does not exist.

@kay-schmitteckert
Copy link
Contributor

Glad that this worked out! Thanks for the feedback.

Which credentials did you use in the credential store? From your personal user? If yes, is 2FA activated? Usually this causes such problems. If not, could you double check your credentials that they are correct?

Best
Kay

@AlfredWangTJ
Copy link
Author

Hi Kay,

I'm using the I-User email and the global Windows AD password (Because SSO enabled, NO separate password for BTP is set), besides, NO 2FA is enabled.
I have double checked the credential store, the configuration follows the instruction, so I think there maybe some other potential issues during the Subscription process.

Thanks and Regards.

@kay-schmitteckert
Copy link
Contributor

Thanks for the confirmation. Did you entitle the service "Cloud Management Service" with "central plan"?

@AlfredWangTJ
Copy link
Author

Hi Kay,

Thanks a lot for the timely reply. I checked the entitlements and seems I missed out 'central plan' for 'Cloud Management Service' in my subaccount. After adding this entitlement and re-deploy the App, I can subscribe to 'premium plan' successfully.

Another thing I notice that the BTP platform may have some kind of cache related to a session, if I subscribe immediately after the deployment, this error will persist. Only after I clear the cookies and re-login to BTP platform (or open a new In-private window in browser) could I make the subscription successfully.

However, after subscription and add roles to consumer subaccount, I got an HTTP 500 error when authorizing the access, could this be some kind of issue related to credential store?

image
image
image

I have downloaded the application log for aisaas-cf_space_us10 and caputre a nerwork .har file for reference.
aisaas-cf_space_us10-2024-04-26 03_27_42.067+0000.txt
genai-email-insights.har.txt

I did not get much error details from the log this time, only a message 'query does not exist for request url /aisaasui/index-cdn.html' with level 'log' but not 'error'.

image

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