Skip to content

"Access Denied" error on Windows Server in "quarto render" #13096

@JoergVanAken

Description

@JoergVanAken

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/

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions