Repository navigation
Description
Important
Please read this issue carefully!
TL;DR: Contact your AV/EDR vendor if you're experiencing the kinds of problems described below. Get a ticket number from them, and work with them directly. uv can sometimes work around AV/EDR vendor bugs and excessive locking, but we want those problems reported to the vendor first.
This is a resource for users experiencing issues with uv under the following conditions:
- You're using uv on Windows (any version of Windows)
- You're using Windows with an antivirus or endpoint detection and response (EDR) product, including (but not limited to) any of the following:
- Windows Defender
- BitDefender
- Avast
- SecuPrint
- Netskope
- You're experiencing errors on various uv operations (things like
uv syncanduv lock), including:The system cannot open the device or file specified. (os error -2147024786)Access is denied. (os error 5)Access is denied. OS Code Error -2147024891- uv gets quarantined or deleted entirely by your AV/EDR product
(The list of products/vendors above is not exhaustive, and is supplied for keyword search purposes, not because other vendors are any more or less problematic.)
If you satisfy all of the conditions above (or are seeing errors similar but not identical to (3)), then there is a very good chance that your AV or EDR vendor/product is intefering with uv.
uv makes a best effort to work around many common deficiencies in AV/EDR products, typically by introducing more resiliency and retries. However, these are fundamentally workarounds, and there is a virtually limitless number of ways in which AV/EDR products can violate uv's runtime invariants in ways that are impossible for uv to detect.
Thereforee, before filing a new AV/EDR-related issue with uv, we ask you to do the following:
- Please contact your AV/EDR vendor and inform them that their software is causing problems for your workflow. Please do this through your support contract with them.
- Please get a confirmation from them that they've received your contact, and that they don't already have a workaround/mitigation/configuration change that your org can apply.
- Please share the ticket ID in your new issue so that others who have the same vendor can cross-reference it.
Prior references:
- uv venv: Windows PE resource error due to Bitdefender Incident Sensor #20567
- "Access is denied. (os error 5)" during .venv updates and database write errors for Python installed via uv #16747
- Windows AV software causes 0.5 second delay for unsigned binaries #10288
- Access is Denied on Windows with uv sync. OS Code Error -2147024891 #17430
Access is deniederror on windows whenuv sync#15968
Activity
Access is deniederror on windows whenuv sync#15968 as a duplicate of this issueMasterRoshan commentedon Aug 4, 2026
I went through the trouble of creating an MRE specifically around trampoline creation. It involves having uv sleep which allows a simulated AV to win a lock on a temporary trampoline .exe
main...MasterRoshan:uv:main
python scripts\av_sim.py.\target\debug\uv.exe pip install --reinstall cowsaymbellgardt commentedon Aug 4, 2026
We are currently facing this issue (BitDefender GravityZone) and it is causing me endless grief, so I decided to look into it a bit. In my understanding, the main cause of the issue is that when uv writes the PE resources to the trampoline it does a
write_resource(https://github.com/astral-sh/uv/blob/main/crates/uv-trampoline-builder/src/lib.rs#L479) which does anEndUpdateResourceW(https://github.com/astral-sh/uv/blob/main/crates/uv-trampoline-builder/src/lib.rs#L317). This call re-opens the file for reading and writing without resource sharing. It essentially requests full, exclusive access to an executable file it just wrote. Do you see how AV software might have a problem with that?Our IT department will contact BitDefender, but after looking into it, I think this is not an issue to be fixed on the side of the AV vendors, because that software is just doing its job. By creating an executable file and then "trying to prevent other processes from opening it" (I know this is not the intent, but that's how it looks to the AV software) uv is kind of overstaying its welcome.
This was the first time I looked at the uv source and I'm only a beginner at Rust, so I couldn't really tell you how to solve the issue but I would really appreciate it if someone more knowledgeable could look into it. If I'm completely wrong about this, I'd also appreciate it if you told me why.
Thank you very much for working on uv which is one of my favorite development tools. You guys rule!
(Full disclosure: the investigation was performed with the help of AI tools. I did not use AI to write this post and I made sure I understood and validated the findings as per your AI policy)
woodruffw commentedon Aug 4, 2026
Hey folks, we realized that this issue was misleading (sorry about that) -- my original goal here was to help people aggregate support IDs for their vendors, not engage in further root causing. In many cases we already know the root cause (AV/EDR vendors taking exclusive locks on files and then holding them for long periods), and we consider it a bug in the vendor's code or a company's profile/configuration rather than uv (since uv is operating only on data/files it controls).
If you're experiencing a new problem (e.g. with a new vendor or a failure mode not tracked above), please file a new issue and we'll triage it.
zanieb commentedon Sep 9, 2026
As of https://github.com/astral-sh/uv/releases/tag/0.12.12, we sign our binaries. This won't immediately resolve issues with antivirus false positives, but should help in the long-term.