quarto-dev / quarto-dev/quarto-cli
"Access Denied" error on Windows Server in "quarto render"
Nobody has claimed this yet.
- Dominant language
- JavaScript
- Stars
- 6k
- Forks
- 458
- Avg merge
- 1d 9h
- Merged PRs (30d)
- 41
Description
I have:
- searched the issue tracker for similar issues
- installed the latest version of Quarto CLI
- formatted my issue following the Bug Reports guide
Bug description
I try to run quarto.exe render on a Windows server. Depending on the user rights this leads to an os error 5 "Access denied".
Steps to reproduce
The content of document does not matter. The problem is caused by this python function in quarto's jupyter.py:
def run_server_subprocess(options, status):
# python executable
python_exe = sys.executable
# detached process flags for windows
flags = 0
if sys.platform == 'win32':
python_exe = re.sub('python\\.exe$', 'pythonw.exe', python_exe)
flags |= 0x00000008 # DETACHED_PROCESS
flags |= 0x00000200 # CREATE_NEW_PROCESS_GROUP
flags |= 0x08000000 # CREATE_NO_WINDOW
flags |= 0x01000000 # CREATE_BREAKAWAY_FROM_JOB
# forward options via env vars
os.environ["QUARTO_JUPYTER_OPTIONS"] = json.dumps(options)
# create subprocess
subprocess.Popen([python_exe] + sys.argv + ["serve"],
stdin = subprocess.DEVNULL,
stdout = subprocess.DEVNULL,
stderr = subprocess.DEVNULL,
creationflags = flags,
close_fds = True,
start_new_session = True
)
The flags of subprocess.Popen commands are a problem if the user has no admin rights.
Actual behavior
Crashes with "Access denied".
Expected behavior
Does not crash :-)
I changed the python code so that is does not use any flags and everything works as expected.
Your environment
Microsoft Windows Version 10.0.20348.3932
Quarto Version 1.7.32
Quarto check output
quarto check
Quarto 1.7.32
[>] Checking environment information...
Quarto cache location: xx\AppData\Local\quarto
[>] Checking versions of quarto binary dependencies...
Pandoc version 3.6.3: OK
Dart Sass version 1.85.1: OK
Deno version 1.46.3: OK
Typst version 0.13.0: OK
[>] Checking versions of quarto dependencies......OK
[>] Checking Quarto installation......OK
Version: 1.7.32
Path: xx\quarto\bin
CodePage: 1252
[>] Checking tools....................OK
TinyTeX: (not installed)
Chromium: (not installed)
[>] Checking LaTeX....................OK
Tex: (not detected)
[>] Checking Chrome Headless....................OK
Using: Chrome found on system
Path: C:\Program Files\Google\Chrome\Application\chrome.exe
Source: Windows Registry
[>] Checking basic markdown render....OK
[>] Checking Python 3 installation....OK
Version: 3.12.10 (Conda)
Path: xx/python.exe
Jupyter: 5.7.2
Kernels: python3
[>] Checking Jupyter engine render....OK
[>] Checking R installation...........(None)
Unable to locate an installed version of R.
Install R from https://cloud.r-project.org/
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start in quarto's jupyter.py at run_server_subprocess and reproduce quarto.exe render on Windows Server with a non-admin account. Compare the current subprocess.Popen creation flags with the reporter's flag-free workaround. Done means rendering no longer fails with OS error 5 for users without administrator rights.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- python
- Domain
- operating-systems
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 42/100