cancel
Showing results for 
Search instead for 
Did you mean: 

Deploy HTML 5 Modules via WEB IDE and MTA on cloud foundry failed

0 Kudos

Hello SAP Community

I deployed an HTML 5 component as described in this blog: https://blogs.sap.com/2017/09/20/html5-application-to-the-cloud-foundry-environment-within-sap-cloud...

Then I added a folder with a compiled angular project (e.g. dist folder of a new created angular project.) inside the webapp folder. The new folder contains one html file, an ico file, js files and js.map files.

This project can be build with MTA tools, but when deployed the job fails with the following error log:

10:02:39 (DeployService) Deployment in progress.
10:02:39 (DeployService) Deploying /mtaAngularDev/mta_archives/mtaAngularDev_0.0.3.mtar to endpoint: https://api.cf.eu10.hana.ondemand.com, organization: S#########trial_trial, space: dev.
10:09:44 (DeployService) Target: https://deploy-service.cfapps.eu10.hana.ondemand.com/slprot/S#########trial_trial/dev/slpPreparing to deploy /mtaAngularDev/mta_archives/mtaAngularDev_0.0.3.mtarPrepare deployment filesChecking if there are conflicting processesFound 1 conflicting processesAborting process 3a34e08a-312b-11ea-8267-eeee0a9fb7a5Uploading mtar archiveStarting deploymentDeploying in org "S#########trial_trial" and space "dev"Detected MTA schema version: "3"Detected deployed MTA with ID "mtaAngularDev" and version "0.0.3"Detected new MTA version: "0.0.3"Deployed MTA version: "0.0.3"Service "dest_mtaAngularDev" exists but doesnt have any bound applicationsProcessing service "uaa_mtaAngularDev"...Processing service "mtaAngularDev_html5_repo_runtime"...Processing service "mtaAngularDev_html5_repo_host"...Processing service "dest_mtaAngularDev"...Setting service "uaa_mtaAngularDev" parameters from "xs-security.json"Updating service "uaa_mtaAngularDev"...Updating application "mtaAngularDev_appRouter"...Application "mtaAngularDev_appRouter" attributes are not modified and will not be updatedUploading application "mtaAngularDev_appRouter"...Stopping application "mtaAngularDev_appRouter"...Staging application "mtaAngularDev_appRouter"...Application "mtaAngularDev_appRouter" stagedStarting application "mtaAngularDev_appRouter"...Application "mtaAngularDev_appRouter" started and available at "S#########trial-trial-dev-mtaangulardev-approuter.cfapps.eu10.hana.ondemand.com"Deleting discontinued configuration entries for application "mtaAngularDev_appRouter"...Updating application "mtaAngularDev_ui_deployer"...Application "mtaAngularDev_ui_deployer" attributes are not modified and will not be updatedUploading application "mtaAngularDev_ui_deployer"...Staging application "mtaAngularDev_ui_deployer"...Application "mtaAngularDev_ui_deployer" stagedStarting application "mtaAngularDev_ui_deployer"...Application "mtaAngularDev_ui_deployer" startedError executing application "mtaAngularDev_ui_deployer": Deployment of html5 application content failed [Deployment Id: deploy-83138cd4-312c-11ea-8267-eeee0a9fb7a5]Stopping application "mtaAngularDev_ui_deployer"...A step of the process has failed. Retrying it may solve the issue.To download logs of the process, use the multi-target application plug-in for the Cloud Foundry CLI command "cf dmol -i SOME-LOG-ID" directly in your Cloud Foundry space.For more information see https://help.sap.com/viewer/65de2977205c403bbc107264b8eccf4b/Cloud/en-US/e93b231895b64cbc9221a629535... failed.

Once failed, this cannot be undone. Even removing the folder again, build the MTA and try a deployment will cause the same error to happen.

How can I repair the deployment after it once failed, without creating a complete new project?

Also I would like to know, if there is a better way to deploy such a compiled HTML folder to the HTML 5 Application Repository?

Best regards

Willi

joachimvanpraet
Active Participant
0 Kudos

Can you check the log file of the mtaAngularDev_ui_deployer application?

you can run this command in your cmd:

cf logs mtaAngularDev_ui_deployer

and try to deploy again, maybe there is not enough memory assigned to the deployer application.

0 Kudos

Hey Joachim,

thank your for your response! When i run this command, i recieve:

C:\somepath>cf logs htmlDeployer_ui_deployer
Retrieving logs for app htmlDeployer_ui_deployer in org S##########trial_trial / space dev as some@e-mail.com...


App 'htmlDeployer_ui_deployer' not found.
FAILED

Do not mind the different prefix, i set up a new project (same settings) with the name "htmlDeployer".

However this lead me to check the logs on the cloud foundry platform and I found this log very interesting:

#2020-01-07T12:39:12.995Z# - #error# Error while uploading resources to Server; Status: 400 Response: "Upload application content failed { CODE: '1001' } validation error: Error while parsing request; Error: maximum file length exceeded"

It seems, like the original error is caused by file upload of a large file.

0 Kudos

Update:
My cf tool was logged in to a wrong space. I corrected that and get the logs via

cf dmol -i SOME-LOG-ID-NUM-BER

This was suggested in the logs i posted above. The other command was busy for several minutes, beofre I aborted it.

Still the logs contain the one with the file length

Accepted Solutions (1)

Accepted Solutions (1)

0 Kudos

This note resolves the sizing issue:

https://launchpad.support.sap.com/#/notes/0002764058
Unfortunately the MTA format is not proper described there. I tried
ID: htmlDeployer
_schema-version: '2.1'
parameters:
  deploy_mode: html5-repo
  config:
sizeLimit: 4
version: 0.0.8

Can anyone tell me how to correctly set the size limit in the mta?

The sizing works with the cf tool with

cf update-service my-app-host -c app-host-config.json

and a app-host-config:

{"sizeLimit": 4}

or directly within the app host creation.

This does not solve the issue with the "unfixable" deployment of the Web IDE. Once broken, you need to recreate the whole project.

mariusobert
Developer Advocate
Developer Advocate

Hello again Wilhelm,

the correct way to define the repo size in the mta.yaml file is as follows:

  - name: html5_repo_host
    parameters:
      service-plan: app-host
      service: html5-apps-repo
      config:
        sizeLimit: 6

<br>

as you can see, the sizeLimit config parameter needs to be appended to the definition of the resource.

For the other issue, this seems to be a bug indeed. I would assume that you don't have to delete the entire project, but only the "html5 app repo host plan". In either case, this is still a valid bug. It would be great if you could open a reproducable BCP issue for component BC-CP-CF-HTML5

Thanks!

PS: Besides this bug, does everything work as expected now?

Thank you very much Marius! Totally makes sense to apply this parameter to the app-host.

I do not (yet) know what you mean by BCP, but I would like to create such a reproducible issue/ bug report. Also I can close this question afterwards. 🙂

/@ PS: Yes it works as expected. Unfortunately neither my trial accout html5 quota nor the quota of my org cf account is sufficient to deploy the simple angular app (>10 mb). So me and my team now want to know, if we should host html5 apps with another instance (e.g. a tomcat server) or with the html5 repo ( Where can we find the cost plan for this entitlement?). So the next question would be about the benefits of the html5 repository in the cloud foundry environment. That should maybe be discussed in another question.

mike_zaschka
Active Participant
0 Kudos

wilhelmbecker: Did you receive any answer to your question about the sizing? I do not find any valuable information on this and it's kind of hard to understand that in an enterprise cloud platform we have to deal with size limits in megabytes.

Answers (1)

Answers (1)

mariusobert
Developer Advocate
Developer Advocate

Hi Wilhelm,

if I understand you right, you only use the Web IDE to deploy your angular app that you build somewhere else, right?

In this case, I'd recommend to use your local machine to manage the content of the HTML5 App Repo. This CF CLI plugin will help you to do so:

cf html5-push -n <host service ID> .

You can also use the (standard) CF CLI to remove the html5 app repo host service to remove the entire repo:

cf delete-service -f <html5 host service name>

Or the plugin to remove the content

cf html5-delete --content <host service ID>
0 Kudos

Hey Marius,

Thank you for your fast response!

Yes my intention is to deploy a compiled app. I tried the html5 plugin before with the simple example on the by you linked page and ended up with the error:

C:\somepath>cf html5-pushPushing HTML5 applications in org somesubbaccount / space somespace as
some@e-mail.com...panic: runtime error: invalid memory address or nil pointer dereference[signal 0xc0000005 code=0x0 addr=0x10 pc=0x746e81]

As this error may be related to the fixed:

https://github.com/SAP/cf-html5-apps-repo-cli-plugin/issues/16

I tried to build the newest version of this tool and failed ☹ (I already created an issue in this git to solve this problem)

However you provided me the missing parameter “-n <html5 host service name>”. Thank you!

I tested the id, but the name is required. (In future this parameter should be moved to the manifest.json, as it will be depreciated). This got me one step farther.

C:\somepath>cf html5-push -n htmlDeployer_html5_repo_hostRedeploying HTML5 applications in org S##########trial_trial / space dev
as some@mail.com...FAILEDCould not upload applications to app-host-id
'some-app-host-id' :  maximum file length
exceeded

So now I get the same issue as in the Web IDE.

FYI: Switching to the Web IDE helped with the concept of MTA deployment, as this seems to be more practiced by the community until now. I expect that this approach should work with the Web IDE. Furthermore the Web IDE deployment cannot be simply undone by another build with “normal sized” files. So this Web IDE problem persists.