Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Unable to remove library from VS Code #4896

Open
gojimmypi opened this issue Apr 11, 2024 · 5 comments
Open

Unable to remove library from VS Code #4896

gojimmypi opened this issue Apr 11, 2024 · 5 comments

Comments

@gojimmypi
Copy link

I'm logged into Windows 11 Pro 22H2 (22621.3447) as a regular user (not a member of local Administrators group) and using PlatformIO Core 6.1.14·Home 3.4.4 for VS Code 1.88.0, specifically:

image

I'm working on wolfSSL for PlatformIO as described in platformio/platformio-registry#85

The install of the wolfSSL library works well, but the removal (or update) from VS Code fails with this error:

image

Here's the full error:

WARNING: This command is deprecated and will be removed in the next releases.
Please use `pio pkg uninstall` instead.
Resolving esp32dev dependencies...
Removing wolfSSL @ 5.6.6-test7
[email protected] has been removed!
[WinError 5] Access is denied: 'C:\\Users\\gojimmypi\\Documents\\PlatformIO\\Projects\\ESP_IDF_Hello_World\\.pio\\libdeps\\esp32dev\\wolfSSL\\src\\src'
Please manually remove the file `C:\Users\gojimmypi\Documents\PlatformIO\Projects\ESP_IDF_Hello_World\.pio\libdeps\esp32dev\wolfSSL\src\src`
[WinError 5] Access is denied: 'C:\\Users\\gojimmypi\\Documents\\PlatformIO\\Projects\\ESP_IDF_Hello_World\\.pio\\libdeps\\esp32dev\\wolfSSL\\src\\wolfcrypt\\src\\port\\Espressif'
Please manually remove the file `C:\Users\gojimmypi\Documents\PlatformIO\Projects\ESP_IDF_Hello_World\.pio\libdeps\esp32dev\wolfSSL\src\wolfcrypt\src\port\Espressif`
[WinError 5] Access is denied: 'C:\\Users\\gojimmypi\\Documents\\PlatformIO\\Projects\\ESP_IDF_Hello_World\\.pio\\libdeps\\esp32dev\\wolfSSL\\src\\wolfcrypt\\src\\port'
Please manually remove the file `C:\Users\gojimmypi\Documents\PlatformIO\Projects\ESP_IDF_Hello_World\.pio\libdeps\esp32dev\wolfSSL\src\wolfcrypt\src\port`
[WinError 5] Access is denied: 'C:\\Users\\gojimmypi\\Documents\\PlatformIO\\Projects\\ESP_IDF_Hello_World\\.pio\\libdeps\\esp32dev\\wolfSSL\\src\\wolfcrypt\\src'
Please manually remove the file `C:\Users\gojimmypi\Documents\PlatformIO\Projects\ESP_IDF_Hello_World\.pio\libdeps\esp32dev\wolfSSL\src\wolfcrypt\src`
[WinError 5] Access is denied: 'C:\\Users\\gojimmypi\\Documents\\PlatformIO\\Projects\\ESP_IDF_Hello_World\\.pio\\libdeps\\esp32dev\\wolfSSL\\src\\wolfcrypt'
Please manually remove the file `C:\Users\gojimmypi\Documents\PlatformIO\Projects\ESP_IDF_Hello_World\.pio\libdeps\esp32dev\wolfSSL\src\wolfcrypt`
[WinError 5] Access is denied: 'C:\\Users\\gojimmypi\\Documents\\PlatformIO\\Projects\\ESP_IDF_Hello_World\\.pio\\libdeps\\esp32dev\\wolfSSL\\src\\wolfssl\\openssl'
Please manually remove the file `C:\Users\gojimmypi\Documents\PlatformIO\Projects\ESP_IDF_Hello_World\.pio\libdeps\esp32dev\wolfSSL\src\wolfssl\openssl`
[WinError 5] Access is denied: 'C:\\Users\\gojimmypi\\Documents\\PlatformIO\\Projects\\ESP_IDF_Hello_World\\.pio\\libdeps\\esp32dev\\wolfSSL\\src\\wolfssl\\wolfcrypt'
Please manually remove the file `C:\Users\gojimmypi\Documents\PlatformIO\Projects\ESP_IDF_Hello_World\.pio\libdeps\esp32dev\wolfSSL\src\wolfssl\wolfcrypt`
[WinError 5] Access is denied: 'C:\\Users\\gojimmypi\\Documents\\PlatformIO\\Projects\\ESP_IDF_Hello_World\\.pio\\libdeps\\esp32dev\\wolfSSL\\src\\wolfssl'
Please manually remove the file `C:\Users\gojimmypi\Documents\PlatformIO\Projects\ESP_IDF_Hello_World\.pio\libdeps\esp32dev\wolfSSL\src\wolfssl`
[WinError 5] Access is denied: 'C:\\Users\\gojimmypi\\Documents\\PlatformIO\\Projects\\ESP_IDF_Hello_World\\.pio\\libdeps\\esp32dev\\wolfSSL\\src'
Please manually remove the file `C:\Users\gojimmypi\Documents\PlatformIO\Projects\ESP_IDF_Hello_World\.pio\libdeps\esp32dev\wolfSSL\src`
[WinError 5] Access is denied: 'C:\\Users\\gojimmypi\\Documents\\PlatformIO\\Projects\\ESP_IDF_Hello_World\\.pio\\libdeps\\esp32dev\\wolfSSL'
Please manually remove the file `C:\Users\gojimmypi\Documents\PlatformIO\Projects\ESP_IDF_Hello_World\.pio\libdeps\esp32dev\wolfSSL`

I'm able to otherwise manually delete the library as noted in the error message, but that is of course not ideal.

See example staging versions: https://registry.platformio.org/libraries/wolfssl-staging/wolfSSL/versions

The example above was with 5.6.6-test6 installed, attempting to remove and upgrade.

The error seems related to permissions and/or antivirus (not the library itself), as I also see this error:

image

Does PlatformIO modify attributes at registry library install time?

This is not limited to my wolfSSL library, as I also see the error for this Adafruit library:

image

Thanks for taking a look at this.

@ivankravets ivankravets transferred this issue from platformio/platformio-registry Apr 11, 2024
@ivankravets
Copy link
Member

Do you use any antivirus tools?

@gojimmypi
Copy link
Author

yes, the "action blocked" screen snip is from antivirus.

btw, I tried to contact PlatformIO regarding the upcoming official wolfSSL, but received this error:

image

Cloudflare Ray ID: 872c961548482f64

Perhaps you could contact me: jim (at) wolfssl.com ? Thanks

@gojimmypi
Copy link
Author

Update on this topic. It appears that the anti-virus software is complaining about exactly what the message indicates: "attempted to modify attributes". The odd thing isthat the operation seems to have been partially successful, and is also the problem with library removal.

Specifically, it appears the platformio.exe has a good intention to flag things as read only. But it fails. The result in the read-only flag apparently neither set nor cleared. Note the checkbox for read-only status:

image

The checkbox looks like this when read-only:

image

and like this when not read-only:

image

At library removal time, all the files are successfully removed, but as seen in the error message above, the directories are the things that were not deleted.

Perhaps this could be fixed with something as easy as a config or prompt asking to flag things as read-only or not? I suspect library removal would proceed as desired if the read-only flag had not been touched.

@ivankravets
Copy link
Member

Could you provide an output of

pio system info

See the related code https://github.com/platformio/platformio-core/blob/develop/platformio/fs.py#L212

@gojimmypi
Copy link
Author

Hi @ivankravets

I've confirmed that if I manually flag all the files and all the directories in the wolfSSL directory as R/W, later removal and/or upgrade works just fine.

Specifically this directory:

C:\\Users\\gojimmypi\\Documents\\PlatformIO\\Projects\\ESP_IDF_Hello_World\\.pio\\libdeps\\esp32dev\\wolfSSL\\

Could you provide an output of pio system info

C:\Users\gojimmypi>pio system info
--------------------------  ----------------------------------------------------------
PlatformIO Core             6.1.14
Python                      3.11.7-final.0
System Type                 windows_amd64
Platform                    Windows-10
File System Encoding        utf-8
Locale Encoding             cp1252
PlatformIO Core Directory   C:\Users\gojimmypi\.platformio
PlatformIO Core Executable  C:\Users\gojimmypi\.platformio\penv\Scripts\platformio.exe
Python Executable           C:\Users\gojimmypi\.platformio\penv\Scripts\python.exe
Global Libraries            0
Development Platforms       1
Tools & Toolchains          19
--------------------------  ----------------------------------------------------------

We are providing two different Official wolfSSL libraries: standard and another specifically for Arduino:

There are also two different versions: the stable release versions (above) and these staging updates, with the latest post-release changes.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants