quarto-dev / quarto-dev/quarto-cli

Deno panic when directory access not permitted

Open
#1,379 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

bug
Dominant language
JavaScript
Stars
6k
Forks
458
Avg merge
1d 9h
Merged PRs (30d)
41

Description

Bug description
  1. Create a new Quarto project using the RStudio IDE. Let's call it ~/Desktop/qp.

    This project needs to be within a directory that RStudio can access, but is not allowed to the Terminal.app. On my laptop, the ~/Desktop directory fits this criteria. The Security&Privacy / Privacy / Files and Folders preferences can be adjusted so RStudio can create a project beneath the Desktop without allowing Terminal access.

  2. Start the Terminal.app. Change directory into the ~/Desktop/qp directory. If the system asks for desktop access, do not allow it.

    cd ~/Desktop/qp
    

    Interestingly, the cd command succeeds even though things like ls fail.

  3. Attempt any Quarto operation within this restricted directory:

    quarto render index.qmd
    

The resulting output:

============================================================
Deno has panicked. This is a bug in Deno. Please report this
at https://github.com/denoland/deno/issues/new.
If you can reliably reproduce this panic, include the
reproduction steps and re-run with the RUST_BACKTRACE=1 env
var set and include the backtrace in your report.

Platform: macos x86_64
Version: 1.22.0
Args: ["/Users/aron/dev/rstudio/quarto-cli/package/dist/bin/tools/deno", "run", "--unstable", "--cached-only", "--allow-read", "--allow-write", "--allow-run", "--allow-env", "--allow-net", "--allow-ffi", "--importmap=/Users/aron/dev/rstudio/quarto-cli/src/dev_import_map.json", "/Users/aron/dev/rstudio/quarto-cli/src/quarto.ts", "render", "index.qmd"]

thread 'main' panicked at 'called `Result::unwrap()` on an `Err` value: Os { code: 1, kind: PermissionDenied, message: "Operation not permitted" }', core/module_specifier.rs:141:28
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace
quarto check Output

The quarto check command did not succeed within the restricted directory. It erred with the same output as above.

When run from a different directory:


[✓] Checking Quarto installation......OK
      Version: 99.9.9
      Path: /Users/aron/dev/rstudio/quarto-cli/package/dist/bin

[✓] Checking basic markdown render....OK

[✓] Checking Python 3 installation....OK
      Version: 3.8.9
      Path: /Applications/Xcode.app/Contents/Developer/usr/bin/python3
      Jupyter: (None)

      Jupyter is not available in this Python installation.
      Install with python3 -m pip install jupyter

[✓] Checking R installation...........OK
      Version: 3.6.3
      Path: /Library/Frameworks/R.framework/Resources
      LibPaths:
        - /Users/aron/Library/R/3.6/library
        - /Library/Frameworks/R.framework/Versions/3.6/Resources/library
      rmarkdown: 2.11.16

[✓] Checking Knitr engine render......OK

This issue was confirmed while using commit 852a0231c043417a0f848faed90af1116a2c8fb4. It occurs in earlier versions, as well.

Tested on macOS Monterey - 12.4

Quarto website project was created using RStudio 2022.07.0 Build 548

quarto tools check Output

The quarto tools check command did not succeed within the restricted directory. It erred with the same output as above.

When run from a different directory:

[✓] Inspecting tools

Tool         Status            Installed     Latest  
chromium     Not installed     ---           869685  
tinytex      Not installed     ---           v2022.07
Checklist
  • formatted your issue so it is easier for us to read?
  • included a minimal, fully reproducible example in a single .qmd file? Please provide the whole file rather than the snippet you believe is causing the issue.
  • documented the quarto version you're running, by pasting the output from running quarto check in the "Quarto Check Output" text area?
  • documented the version of the quarto tools you're running, by providing the output from running quarto tools check in the "Quarto Tools Check Output" text area?
  • documented the RStudio IDE version you're running (if applicable), by providing the value displayed in the "About RStudio" main menu dialog?
  • documented which operating system you're running? If on Linux, please provide the specific distribution as well.
  • upgraded to the latest version, including your versions of R, the RStudio IDE, and relevant R packages?

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Reproduce the failure by running quarto render index.qmd, quarto check, or quarto tools check from a macOS directory that Terminal cannot access, and rerun with RUST_BACKTRACE=1 as requested. Start with the reported Deno panic at core/module_specifier.rs:141:28; done means restricted-directory operations report a usable permission error instead of panicking.

Written by the indexing model from the issue text.

Assessment

Tech stack
deno, javascript
Domain
cli, operating-systems
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.