You got this error in the UI or in the tomcat logs? I tried to search the code base but couldn’t find the error that says “Request Entity Too Large”. May I know the size of file you are uploading?
@jetisco4u this is usually a setting in either the nginx gateway or tomcat web server you are running, I don’t believe there is any limit enforced by DHIS2 itself. This depends on how your server is configured. You can look at, for example, the client_max_body_size setting in nginx.conf or one of these settings in Tomcat
@austin@rithvik I managed to reduce the size and it seems to be passing. But then I keep getting the error Failed to load resource: the server responded with a status of 409 (). I have tried to follow the best principles from app-platform. I have tried to keep the app simple but don’t know what is throwing the error and there are no further clue to debug.
When I inspect the console, I saw the error pointing to this line in api.js }) => fetch(`${this.baseUrl}/api/${url}`,
When are you getting this error? When you upload the app or when you are loading your custom application? If it’s your custom app, how are you resolving this.baseUrl ?
@rithvik when I upload my custom app. I am not setting any value for baseUrl. I thought the system will pick it since I am using the app-platform. Do I need to set it up and where should I do that? I didn’t see any reference to it in the repo except for when uploading to the app hub which I am not.
@jetisco4u ,
My bad, I assumed you are getting this error when you are loading your app (I assumed the error was from your code). As now you mentioned, it is when you are uploading the app from app manager, I’m not sure on the root cause.
Hello @austin and @rithvik I am back to the error on Failed to install app: Request Entity Too Large.. I didn’t try your suggested solution then because I just reduce the size of the app and it was working. Now I have a live instance of DHIS2 running on a domain. I have a basic custom app built using the app platform. I have uploaded it with no issue in the localhost instance. But when I tried to do same in the live server instance, I get the error above. I checked the client_max_body_size in nginx.conf and it is set at 10m. Shouldn’t that be enough to upload an app of 1.59mb?
EDITED
I set the client_max_body_size to 200M as per @austing advice. When I tried again, the error didn’t show but I run into the baseUrl error.