SAP/ui5-tooling

Install of Libraries Permanently Fails for `3.1.3`

texttechne opened this issue ยท 11 comments

Expected Behavior

When starting the app, missing library packages get installed automatically.
This should run without any error.

Current Behavior

When starting:

info graph:helpers:ui5Framework Using SAPUI5 version: 1.111.0
info ui5Framework:npm:Installer Installing missing package @sapui5/sap.ushell...
info ui5Framework:npm:Installer Installing missing package @sapui5/sap.ui.generic.app...
info ui5Framework:npm:Installer Installing missing package @sapui5/sap.suite.ui.generic.template...
info ui5Framework:npm:Installer Installing missing package @sapui5/sap.esh.search.ui...
info ui5Framework:npm:Installer Installing missing package @sapui5/sap.collaboration...
info ui5Framework:npm:Installer Installing missing package @openui5/sap.ui.integration...
info ui5Framework:npm:Installer Installing missing package @sapui5/sap.ui.export...
info ui5Framework:npm:Installer Installing missing package @sapui5/sap.suite.ui.commons...
info ui5Framework:npm:Installer Installing missing package @sapui5/sap.fe.navigation...
info ui5Framework:npm:Installer Installing missing package @openui5/sap.ui.rta...
info ui5Framework:npm:Installer Installing missing package @sapui5/sap.insights...
info ui5Framework:npm:Installer Installing missing package @sapui5/sap.fe.placeholder...
info ui5Framework:npm:Installer Installing missing package @openui5/sap.uxap...
info ui5Framework:npm:Installer Installing missing package @sapui5/sap.ui.vk...
info ui5Framework:npm:Installer Installing missing package @sapui5/sap.ui.vbm...
info ui5Framework:npm:Installer Installing missing package @openui5/sap.ui.ux3...
info ui5Framework:npm:Installer Installing missing package @openui5/sap.ui.commons...
info ui5Framework:npm:Installer Installing missing package @sapui5/sap.ui.richtexteditor...


Error Message:
Resolution of framework libraries failed with errors:
  1. Failed to resolve library sap.ui.richtexteditor: Failed to extract package @sapui5/sap.ui.richtexteditor@1.111.0: EPERM: operation not permitted, unlink 'XXX\.ui5\framework\cacache\tmp\f9bad011'
  2. Failed to resolve library sap.ui.vk: Failed to extract package @sapui5/sap.ui.vk@1.111.0: EPERM: operation not permitted, unlink 'XXX\.ui5\framework\cacache\tmp\a5b5f82e'
  3. Failed to resolve library sap.ui.vbm: Failed to extract package @sapui5/sap.ui.vbm@1.111.0: EPERM: operation not permitted, unlink 'XXX\.ui5\framework\cacache\tmp\d9387cf9'
  4. Failed to resolve library sap.ui.rta: Failed to extract package @openui5/sap.ui.rta@1.111.0: EPERM: operation not permitted, unlink 'XXX\.ui5\framework\cacache\tmp\8ca85076'
  5. Failed to resolve library sap.fe.placeholder: Failed to extract package @sapui5/sap.fe.placeholder@1.111.0: EPERM: operation not permitted, unlink 'XXX\.ui5\framework\cacache\tmp\a5750639'
  6. Failed to resolve library sap.insights: Failed to extract package @sapui5/sap.insights@1.111.0: EPERM: operation not permitted, unlink 'XXX\.ui5\framework\cacache\tmp\5fb53d69'
  7. Failed to resolve library sap.ushell: Failed to extract package @sapui5/sap.ushell@1.111.0: EPERM: operation not permitted, unlink 'XXX\.ui5\framework\cacache\tmp\e4ef8025'
...

Steps to Reproduce the Issue

  1. Use an existing UI5 app
  2. change the UI5 version in ui5.yaml
  3. run your app

Context

Happened to a colleague of mine and to me on different machines. We also used different projects.

  • UI5 Module Version (output of ui5 --version when using the CLI): 8.19.3
  • Node.js Version: 16 and 18
  • OS/Platform: Windows
  • UI5 Module Version (output of ui5 --version when using the CLI): 8.19.3

I assume this is actually your npm version? Could you please double check the output of the command ui5 --version?

What terminal application are you using on Windows? Is it possibly a Subsystem for Linux (WSL)?

Please also attach the log output of your command when running it with the --log-level silly flag.

you're right, that was the npm version ๐Ÿ˜…

  • terminal: power shell and also command prompt

App that is running on 1.111.0 and switched to 1.112.0:

  • ui5 version: 3.0.4
  • Log for first ui5 serve run: ui5-start.log
  • From second run onwards it works

New App:

Workaround

Downgrading to 3.1.2 works; well, it behaves as the first app did: on the first run it fails, on the second run everything gets installed.

Since the 3.1.3 release happened today / yesterday, this would explain why we ran into this issue first: we upgraded this test project today / yesterday.

Hi @texttechne,

I was not able to reproduce the issue locally, but it seems that it might be something with the npm caching on Windows.

Would you mind running the following command and then try ui5 serve to see whether that's the case:
npm cache clean --force

Meanwhile, I'd continue to see whether there's something I could find within the code.

Cheers

Thank you for providing the logs.

In addition to what @d3xter666 wrote, could you also please try renaming the XXX\.ui5\framework directory to something else like 'XXX\.ui5\framework_backup and try running the ui5 command in your new app (using UI5 CLI 3.1.3) again?

This will cause all framework dependencies to be re-downloaded, but hopefully does not produce the error.

@RandomByte

In addition to what @d3xter666 wrote, could you also please try renaming the XXX.ui5\framework directory to something else like 'XXX.ui5\framework_backup and try running the ui5 command in your new app (using UI5 CLI 3.1.3) again?

Tried that already yesterday (it was so obvious ๐Ÿ˜‰), but today again. Result:

  • on the first run: 30 installations fail
  • from second run onwards: 3 installations fail (sap.ui.fl, sap.esh.search.ui, sap.ushell)

I also remember that I already found this problem with the first installation something like half a year ago. Since it fixes itself on the second install, I never bothered to create a ticket for that...

@RandomByte @d3xter666 are you working with Windows? It definitely seems to be related to the OS, especially when unlink is mentioned...

Would you mind running the following command and then try ui5 serve to see whether that's the case:
npm cache clean --force

So I did the following

  • npm cache clean --force
  • deleting the node_modules folder
  • renaming .ui5/framework
  • npm install
  • Run the app

First time 31 installations fail, from the second run onwards 2 installations fail (sap.ui.fl, sap.esh.search.ui).

Hi @texttechne,

Unfortunatelly, I'm still unable to reproduce the issue ๐Ÿ˜ž

Regarding the Windows machine, no, we do not have Windows. We try to reproduce the issue on VMs.

GIven the fact that some packages got "unlocked" leads me to the conclusion that there might be a separate process in there that migh be locking those resources and had not released them as of the time of unlinking.

I'm wondering of your setup. Could you be able to provide your package.json and ui5.yaml, se we could see the dependencies and the order of operations? Is there some middleware for the server for transpilation, for example?

I was wondering also whether the Terminal/Command prompt is important in that case. Would you share which terminal are you using on Windows:

  • Git bash
  • Command prompt
  • Power shell
  • something else

Cheers

Hi @d3xter666,
after some more research and trying one project on an non-company Windows machine: it works without any installation issues.
This as well as the fact that noone else (despite my colleagues) is experiencing this issue, leads me to think that the problem is due to our Antivirus software. It's unfortunately not that easy to directly verify that assumption, but I'll have a meeting with our IT guys later to ascertain it.

If the assumption is true then there's nothing you can do probably. Shall we close the issue for now and reopen if the assumption is wrong?

Hi @texttechne thanks a lot for your response and clarification. Let's close the issue for now and feel free to re-open it any time when we can do some improvements.

@RandomByte Finally, I was able to test it and it is indeed FortiClient which interfers here.
We've defined an exclusion rule now and it works like a charm.

Thanks for helping tracking this down.

@texttechne Thanks a lot for providing this feedback. Awesome that it works for you now.