SAP / ui5-tooling

An open and modular toolchain to develop state of the art applications based on the UI5 framework
https://sap.github.io/ui5-tooling
Apache License 2.0
469 stars 71 forks source link

Install of Libraries Permanently Fails for `3.1.3` #831

Closed texttechne closed 1 year ago

texttechne commented 1 year ago

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.

RandomByte commented 1 year ago
  • 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.

texttechne commented 1 year ago

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

App that is running on 1.111.0 and switched to 1.112.0:

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.

d3xter666 commented 1 year ago

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

RandomByte commented 1 year ago

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.

texttechne commented 1 year ago

@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:

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...

texttechne commented 1 year ago

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

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

d3xter666 commented 1 year ago

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:

Cheers

texttechne commented 1 year ago

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?

flovogt commented 1 year ago

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.

texttechne commented 1 year ago

@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.

flovogt commented 1 year ago

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