Email (Optional)
j.wolf95@protonmail.com
Version
1.3.0
Which OS(es) are you using?
What happened?
On Windows, every reference-structure download during phase search fails with
[Errno 13] Permission denied on a temporary file. The server starts fine and
the web UI works; the failure occurs only when Dara fetches COD entries for the
search, e.g.:
Failed to download 9017498: [Errno 13] Permission denied: 'C:\Users\User1\AppData\Local\Temp\tmpyae69mru'
The same error repeats for other COD IDs, so no reference structures become
available and the search cannot proceed with database-retrieved phases.
To reproduce
- Windows 10/11, Python <3.12.x, 64-bit> in a fresh venv
pip install dara-xrd (version <x.y.z>)
dara server
- Open http://localhost:8898 and submit any pattern (tested with a
two-column .xy, Cu radiation, precursor formulas spanning Bi–Fe–O)
- Watch the server console during reference retrieval
Expected behavior
Reference CIFs download from COD and the search runs, as on Linux/macOS.
Actual behavior
Every download fails with [Errno 13] Permission denied on a file in the
user temp directory. Full console output:
<paste full traceback / log excerpt here>
What I ruled out
- Not folder permissions: redirected
TMP/TEMP to a user-owned directory
(C:\xrd\tmp) and restarted the server from the same shell — same error at
the new location.
- Added an antivirus exclusion for the temp directory — no change.
- The machine has normal internet access (pip installs etc. work); the temp
file is created, so this does not look like a network or ACL problem.
Suspected cause
This looks like the well-known Windows limitation with
tempfile.NamedTemporaryFile(delete=True): on Windows the file cannot be
reopened by name (e.g. by a download/parse step) while the creating handle is
still open, which raises exactly [Errno 13] Permission denied even though
permissions are fine. If the downloader writes to a NamedTemporaryFile and
then reopens it by path, that would reproduce this on every Windows machine
while working normally on Linux/macOS.
Possible fixes: delete=False with explicit cleanup, tempfile.mkstemp +
os.close before reuse, or downloading directly into the Dara cache/server
directory instead of the OS temp dir.
Environment
- OS: Windows <10/11, version>
- Python: <3.12.x> (64-bit, venv)
- dara-xrd: <x.y.z>
- Install:
pip install dara-xrd, default MontyDB backend, default settings
- BGMN: <bundled / Profex-BGMN bundle x.y on PATH / not yet configured>
Additional context
Workaround for my use case would also be welcome: a way to supply local CIF
files as the reference set through the web UI / REST POST /api/submit, which
would bypass database retrieval entirely for closed chemical systems. If it
already exists, a pointer in the docs would help. Happy to test a patch on
Windows.
Code snippet
Log output
Code of Conduct
Email (Optional)
j.wolf95@protonmail.com
Version
1.3.0
Which OS(es) are you using?
What happened?
On Windows, every reference-structure download during phase search fails with
[Errno 13] Permission deniedon a temporary file. The server starts fine andthe web UI works; the failure occurs only when Dara fetches COD entries for the
search, e.g.:
Failed to download 9017498: [Errno 13] Permission denied: 'C:\Users\User1\AppData\Local\Temp\tmpyae69mru'
The same error repeats for other COD IDs, so no reference structures become
available and the search cannot proceed with database-retrieved phases.
To reproduce
pip install dara-xrd(version <x.y.z>)dara servertwo-column
.xy, Cu radiation, precursor formulas spanning Bi–Fe–O)Expected behavior
Reference CIFs download from COD and the search runs, as on Linux/macOS.
Actual behavior
Every download fails with
[Errno 13] Permission deniedon a file in theuser temp directory. Full console output:
<paste full traceback / log excerpt here>
What I ruled out
TMP/TEMPto a user-owned directory(
C:\xrd\tmp) and restarted the server from the same shell — same error atthe new location.
file is created, so this does not look like a network or ACL problem.
Suspected cause
This looks like the well-known Windows limitation with
tempfile.NamedTemporaryFile(delete=True): on Windows the file cannot bereopened by name (e.g. by a download/parse step) while the creating handle is
still open, which raises exactly
[Errno 13] Permission deniedeven thoughpermissions are fine. If the downloader writes to a
NamedTemporaryFileandthen reopens it by path, that would reproduce this on every Windows machine
while working normally on Linux/macOS.
Possible fixes:
delete=Falsewith explicit cleanup,tempfile.mkstemp+os.closebefore reuse, or downloading directly into the Dara cache/serverdirectory instead of the OS temp dir.
Environment
pip install dara-xrd, default MontyDB backend, default settingsAdditional context
Workaround for my use case would also be welcome: a way to supply local CIF
files as the reference set through the web UI / REST
POST /api/submit, whichwould bypass database retrieval entirely for closed chemical systems. If it
already exists, a pointer in the docs would help. Happy to test a patch on
Windows.
Code snippet
Log output
Code of Conduct