cancel
Showing results for 
Search instead for 
Did you mean: 

How to implement Multitenancy of HTML5 Application Repository?

iashishsingh
Participant
0 Kudos

Hello,

I am trying to create a multitenant app which uses HTML5 Application Repository for hosting the UI apps.

The MTA for frontend looks like this.

The Approuter which is deployed via a separate MTA like this.

The tenant subscription works fine. However, UI is not accessible and the approuter returns:

503 Service Temporary Unavailable error

The approuter logs show following details:

Could not get html5 repo token from subscriber subaccount mtapptest01 fetching from provider subaccount <br>Error: Error getting client_credentials token for html5-apps-repo-rt from subaccount mtapptest01 <br>errorRequest failed with status code 401

Do you have any insights into how we can overcome this? This is the reference help doc.

Many thanks!

Accepted Solutions (1)

Accepted Solutions (1)

gregorw
Active Contributor

Please check if returning a dependency to the destination service as I've described in Deploy SaaS Solutions (MTX) - Dependencies to Destination / Connectivity Service helps you.

iashishsingh
Participant
0 Kudos

Thanks Gregor! Let me try that out and get back.

iashishsingh
Participant
0 Kudos

Hi Gregor,

Thanks a lot for sharing the mtx example, it helped resolve the issue! I am able to serve the UI from the HTML5 app repo now.

The issue was in the incorrect html app name in the route defined in xs-app.json. The html app manifest declared the app id which contained a hyphen (-): mtcapui-bookshop and the route in the approuter's xs-app.json used the same name. However, the routes should contain the app id such that there are no hyphens or underscores with everything in lowercase i.e. mtcapuibookshop

After this change, the UI is being served which is a great outcome! However, the approuter logs still show following error which is same as the initial error:

{"written_at":"2022-02-07T06:42:06.209Z","written_ts":1644216126209000000,"csn_component":"-","correlation_id":"467c314c-404f-4bd5-4d5e-45fdf7e33250","type":"log","logger":"nodejs-logger","layer":"/Dynamic routing","level":"info","container_id":"10.0.201.22","component_type":"application","component_id":"7bbdb628-2e17-414d-96ea-17ae7fc78a50","component_name":"mtcap","component_instance":-1,"source_instance":-1,"organization_id":"a394c404-5c9e-4752-a602-b2172473de86","organization_name":"asmtsmartloadersand","space_id":"e6d19e1a-6987-4c03-9685-60aee9097849","space_name":"backend","request_id":"467c314c-404f-4bd5-4d5e-45fdf7e33250","msg":"Could not get html5 repo token from subscriber subaccount subtest01 fetching from provider subaccount Error: Error getting client_credentials token for html5-apps-repo-rt from subaccount subtest01 errorRequest failed with status code 401"}

Any thoughts on what might be causing this?

lgonzalezc
Employee
Employee
0 Kudos

Hi. Were you able to solve the issue?

Sergen_Batman
Explorer
0 Kudos

Hi,

Were you able to fix the 401 issue?

BR

Sergen

Answers (0)