Issue after upgrading Sub-tenant-management App

Hello,

I recently upgraded the Sub-tenant-management app (available at GitHub - SoftwareAG/cumulocity-subtenant-management: Tool for managing subtenants from a c8y management or enterprise tenant) from version 1018.0.191 to 1018.503.1.
While the application loads successfully when run locally, I encounter an issue when trying to fetch data from sub-tenants. The following error is thrown:

{
    "error": "security/Unauthorized",
    "message": "xsrf attack detected",
    "info": "https://cumulocity.com/guides/users-guide/getting-started/"
}

when the application is deployed, it throws the following error

TypeError: Cannot read properties of undefined (reading 'fetch')
    at e.value (68919.fe61b1993fee30d15da1.js:2:14760)
    at new e (68919.fe61b1993fee30d15da1.js:2:13380)
    at v (app.8048d7c15a26de897bd7.js:2:7895)
    at new e (app.8048d7c15a26de897bd7.js:2:9376)
    at Object.e_Factory [as factory] (ɵfac.js:1:1)
    at Qu.hydrate (13822.53c1cc9e47defd6fcfab.js:2:76319)
    at Qu.get (13822.53c1cc9e47defd6fcfab.js:2:74945)
    at fe (13822.53c1cc9e47defd6fcfab.js:2:21016)
    at pe (13822.53c1cc9e47defd6fcfab.js:2:21090)
    at Object.o [as factory] (13822.53c1cc9e47defd6fcfab.js:2:77744)

Any hints or guidance on why this problem might be occurring would be highly appreciated.

Thank you for your support.

Thanks,
Divya K

Hi @Divya.Krishnamurthy,

I’ve looked yesterday into upgrading that repo to 1020+ and I did not encounter any of these issues.
The xsrf attack detected error might be an issue related to the cookies on your local host, try clearing the cookies.

Regarding the Cannot read properties of undefined (reading 'fetch') error it would help to know where it ran into that issue to further debug this.
Maybe try deploying a development build of your application, where the application is not minified, so we can identify the actual files and lines where this issue happens.

Regards,
Tristan

1 Like