Technical Articles
Setting sizeLimit for html5 repository on Cloud Foundry
You may come across the following error when deploying your html5 app (e.g. UI5) to Cloud Foundry:
Error: maximum file length exceeded
We use the HTML5 Application Repository to serve static content for web applications like UI5 apps.
The error occurs because the default limit (in MB) for the content deployed to an html5-apps-repo service instance (service plan app-host) is 2.
The fix is documented in KB 2764058 which instructs us to set the sizeLimit in the mta.yaml (multi-target application archive) file to a higher value. Sadly, it isn’t very specific about where in the file you should do it.
We configure the required services in the resources section and we put the size limit against the repo-host service, like this:
resources:
- name: my-cf-ui_html5_repo_runtime
parameters:
service-plan: app-runtime
service: html5-apps-repo
type: org.cloudfoundry.managed-service
- name: my-cf-ui_html5_repo_host
parameters:
service-plan: app-host
service: html5-apps-repo
config:
sizeLimit: 8
type: org.cloudfoundry.managed-service
Here we set the limit to 8MB. Don’t forget to check your indentation!
Note that alternatively you can set the parameter in the service instance directly:
cf update-service my-cf-ui_html5_repo_host -c '{ "sizeLimit": 8 }'
Bear in mind that setting size limit in the mta means that it will be set automatically in each environment as you deploy the mta, which is probably advantageous. I would only use update-service if I was deploying using cf push rather than cf deploy.
Hi Mike,
Thanks for the blog.This was the info I was looking for.
Unfortunately,I am facing an error while changing the sizeLimit to anything other than 2.
I’ve tried it from CLI,WEBIDE,Cockpit.All tries gave the same below error.
Please have a look at it.
Thanks.
Hi Joseph, I wonder if this could be related to the sub-account entitlements. How many units are allocated to your sub-account against the HTML5 Applications service?
Hi Mike,
Below is are the entitlement details in my account for HTML5 Applications service.
I don't see it as an issue.
Thanks.