quarto-dev / quarto-cli

Open-source scientific and technical publishing system built on Pandoc.
https://quarto.org
Other
3.82k stars 311 forks source link

Quarto Preview: Access Denied #5104

Closed arthurgailes closed 2 months ago

arthurgailes commented 1 year ago

Bug description

Hello,

I receive the following error during quarto preview of a website build: ERROR: PermissionDenied: Access is denied. (os error 5), stat 'NETWORK\PATH\quarto_site_error\_site'

To trigger the error, all of the following have had to be true.

Happens in either RStudio or VScode. Rendering works fine; only affects the preview. Using Windows.

Full reproduction here: https://github.com/arthurgailes/repro_quarto_preview_error

quarto.yml:

project:
  type: website

Quarto check: Version: 1.2.269 Path: C:\Program Files\Quarto\bin CodePage: 1252

Thank you for your help.

Checklist

arthurgailes commented 1 year ago

Related: I believe this prevents flextable rendering into Word docs, see #4896

cderv commented 1 year ago

Can you try activating the traceback please ? https://quarto.org/bug-reports.html#dont-hold-back-tell-us-anything-you-think-might-make-a-difference

This will help understand where does this happens. I can't reproduce the error but if this depends on the network drive, I can't really have the same setup.

having more information on this would help

arthurgailes commented 1 year ago

Error log:

Browse at http://localhost:5030/test/test.html
ERROR: PermissionDenied: Access is denied. (os error 5), stat 'W:\arthur\misc\one_off\2023\quarto_site_error\_site'

PermissionDenied: Access is denied. (os error 5), stat 'W:\arthur\misc\one_off\2023\quarto_site_error\_site'
    at Object.lstatSync (deno:runtime/js/30_fs.js:223:21)
    at ensureDirSync (file:///C:/Program%20Files/Quarto/bin/quarto.js:6562:31)
    at renderProject (file:///C:/Program%20Files/Quarto/bin/quarto.js:78835:9)
GET: /test/test.html
ERROR: 500 (Internal Error): Access is denied. (os error 5), stat 'W:/arthur/misc/one_off/2023/quarto_site_error/_site/favicon.ico'
github-actions[bot] commented 1 year ago

Thank you for using Quarto and reporting an issue!

Unfortunately, this issue is now considered stale because it has been opened since 14 days without providing a "working" reproducible example to help us investigate. If you are still facing the issue, please review the "Bug Reports" guide on how to provide a fully reproducible example as a self-contained Quarto document or a link to a Git repository. Without a reproducible example, it is unlikely that the issue will be addressed and thus will be closed.

You can share a Quarto document using the following syntax, i.e., using more backticks than you have in your document (usually four ````).

````qmd
---
title: "Reproducible Quarto Document"
format: html
---

This is a reproducible Quarto document using `format: html`.
It is written in Markdown and contains embedded R code.
When you run the code, it will produce a plot.

```{r}
plot(cars)

The end.

Remove stale / needs-repro labels or this will be closed in 14 days.

MethodenKompetenzZentrum-TUC commented 10 months ago

I get the same error code, when I try to setup a new quarto blog via Rstudio

R-4.3.2 RStudio-2023.09.1-494 Quarto 1.3.450 Windows10 Enterprise Version 10.0.10240 Build 10240 I freshly installed R, RStudio and Quarto and changed nothing in the configurations. When I try to setup a simple quarto blog in Rstudio (new Project -> quarto blog) and then press the render button, I get the error:

ERROR: PermissionDenied: Zugriff verweigert (os error 5), stat 'D:\Arbeit\ooo\index_files

I run Rstudio as administrator and checked the security settings of the directory (tried other folders, partitions and even an other PC)

Searched the internet but I found no solutions. Hopefully somebody has an idea

Thanks in advance

mcanouil commented 10 months ago

Could you try to follow previous request:

MethodenKompetenzZentrum-TUC commented 10 months ago

Could you try to follow previous request:

Ok, I used the 1.4 pre-release, same error:

$ quarto render index.qmd ERROR: PermissionDenied: Zugriff verweigert (os error 5), stat 'D:\Arbeit\ooo\index_files'

PermissionDenied: Zugriff verweigert (os error 5), stat 'D:\Arbeit\ooo\index_files' at Object.statSync (deno:runtime/js/30_fs.js:322:9) at createWalkEntrySync (file:///C:/Program%20Files/Quarto/bin/quarto.js:2754:23) at walkSync (file:///C:/Program%20Files/Quarto/bin/quarto.js:2793:15) at walkSync.next () at walkSync (file:///C:/Program%20Files/Quarto/bin/quarto.js:2814:20) at walkSync.next () at advanceMatch (file:///C:/Program%20Files/Quarto/bin/quarto.js:2901:20) at advanceMatch.next () at expandGlobSync (file:///C:/Program%20Files/Quarto/bin/quarto.js:2916:24) at expandGlobSync.next ()

cderv commented 10 months ago

@MethodenKompetenzZentrum-TUC do you have writing access to D:\Arbeit\ooo ?

MethodenKompetenzZentrum-TUC commented 10 months ago

Yes, I have. When start a new project, then a new directory is created (in this case 'ooo') including the default files like index.qmd etc. I checked the security options for this directory and my profil aswell as the admin profil have all rights for it

mcanouil commented 10 months ago

Is your "D" drive local? (i.e., not a cloud/network drive, nor synced with anything)

cderv commented 10 months ago

Yes, I have. When start a new project, then a new directory is created (in this case 'ooo') including the default files like index.qmd etc. I checked the security options for this directory and my profil aswell as the admin profil have all rights for it

Then it seems it could come from a conflict access problem. On windows, access can be denied if another process is locking the file. Could be a Network drive sync tools or maybe a malware virus scanner, or other process.

Hard to reproduce and debug ... 🤔

MethodenKompetenzZentrum-TUC commented 10 months ago

Yes D: is local. I also tried C:, same error. I don't use a third party anti virus software on this machine and I have no network drives. I also tried it on an other PC, but got the same result.

MethodenKompetenzZentrum-TUC commented 10 months ago

Hard to reproduce and debug

I know, thank you anyway for your help.

I tried to kill all background processes in Windows that are not needed, but still no change

BTW, this problem only occurs for quarto websites, blogs and books. Quarto projects render successful

cderv commented 10 months ago

@cscheid @dragonstyle any ideas what could cause this behavior ?

dragonstyle commented 10 months ago

I don't have a great one that you haven't already covered - e.g. inspecting the folder that is causing the error for unusual permissions or configurations or being suspicious of things like file synchronization utilities... Sorry :(

cscheid commented 10 months ago

The only one I can think of is that Quarto might have been installed in a directory without write permissions, and that somehow we're inheriting those permissions when copying the files. We had a bug like that in the past, but we fixed it. So it's also possible that @MethodenKompetenzZentrum-TUC needs to install a new version of Quarto.

MethodenKompetenzZentrum-TUC commented 10 months ago

I already have the newest QuartoVersion (pre release) installed.

My workaround for now is that I have freshly installed Win10 on another older Laptop I had lying around. And then just installed R, Rstudio and Quarto and nothing else for now and here it works without a problem. It's strange cause I used the same Windows Version and default directories as before. Permissions for the directories look the same aswell. I will now monitor closely every new software I install or settings I change, if I find something that causes this error then I will post it here.

thank you anyway for your time and help

mcanouil commented 10 months ago

@MethodenKompetenzZentrum-TUC Did you try to fully remove and clean any previous Quarto installation, restart, then install the latest Quarto version?

cderv commented 9 months ago

@arthurgailes @MethodenKompetenzZentrum-TUC Do you still have issues ?

We don't have much to investigate and any further details helping use reproduce would help ! Thanks

serrulate commented 9 months ago

This is also an issue for me i am trying to create Quarto documents on a machine i do not have admin rights to. i do have full access to the Appdata/Local/Programs/Quarto/Bin folder i have tried re-installing rstudio and also tried creating a quarto document in VS Code but receive the same Error executing 'reg': Access is denied. (os error 5). i am able to knit markdown documents with out issue. i just have never been able to render quarto documents.

cderv commented 8 months ago

@serrulate thanks a lot for your report.

Can you give us more detail on your environment, version used, sharing the exact error you get, also activating trace (https://quarto.org/docs/troubleshooting/) ?

We need as much detail as possible. As noted in previous comment, we can't repro yet, and don't have enough details to allow us to investigate and understand.

Thank you

serrulate commented 8 months ago

here is my output when i ran the quarto check, the errors in the quarto.js files displayed below are also what appears when i try to render a sample quarto document.

Test.User@PHX-111 MINGW64 ~/Desktop/Brain2/R/quatro1/test2 $ quarto check Quarto 1.4.539 [>] Checking versions of quarto binary dependencies... Pandoc version 3.1.11: OK Dart Sass version 1.69.5: OK Deno version 1.37.2: OK [>] Checking versions of quarto dependencies......OK [>] Checking Quarto installation......OK Version: 1.4.539 Path: C:\Users\Test.User\AppData\Local\Programs\Quarto\bin CodePage: unknown

error: Uncaught (in promise) Error: Error executing 'reg': Access is denied. (os error 5) throw new Error(Error executing '${options.cmd[0]}': ${e.message}); ^ at execProcess (file:///C:/Users/Test.User/AppData/Local/Programs/Quarto/bin/quarto.js:5295:15) at registryReadString (file:///C:/Users/Test.User/AppData/Local/Programs/Quarto/bin/quarto.js:26513:27) at registryReadString (file:///C:/Users/Test.User/AppData/Local/Programs/Quarto/bin/quarto.js:26498:31) at cacheCodePage (file:///C:/Users/Test.User/AppData/Local/Programs/Quarto/bin/quarto.js:39487:29) at readCodePage (file:///C:/Users/Test.User/AppData/Local/Programs/Quarto/bin/quarto.js:39520:13) at checkInstall (file:///C:/Users/Test.User/AppData/Local/Programs/Quarto/bin/quarto.js:98441:30) at check (file:///C:/Users/Test.User/AppData/Local/Programs/Quarto/bin/quarto.js:98384:19) at eventLoopTick (ext:core/01_core.js:183:11) at async Command.fn (file:///C:/Users/Test.User/AppData/Local/Programs/Quarto/bin/quarto.js:98667:5) at async Command.execute (file:///C:/Users/Test.User/AppData/Local/Programs/Quarto/bin/quarto.js:8102:13)

serrulate commented 8 months ago

Yes, perhaps i am not in the correct forum for finding a solution to this issue, as its not a quarto bug. I'm grasping for straws as i have been unable to use quarto on a computer where i do not have admin rights to and forsee this lack of admin rights continuing for the foreseeable future. i can use markdown fine and i have full access to the AppData folders indicated in the file paths.

cderv commented 8 months ago

I have moved your feedback to another issue to discuss. We at least need to make the error message better. Let's continue there

huangde commented 4 months ago

with quarto version 1.4.554, I get the same permission deny error when running "quarto render" to a web project. It happens on both the network and local drive. my latter debugging shows if I used the live server plug in in vscode to preview the generated html pages once, it locks the _site folder, even when it is closed. Closing the whole vscode help solve this problem.

I guess it is somehow related to this issue.

github-actions[bot] commented 2 months ago

Thank you for using Quarto and reporting an issue!

Unfortunately, this issue is now considered stale because it has been opened since 14 days without providing a "working" reproducible example to help us investigate. If you are still facing the issue, please review the "Bug Reports" guide on how to provide a fully reproducible example as a self-contained Quarto document or a link to a Git repository. Without a reproducible example, it is unlikely that the issue will be addressed.

You can share a Quarto document using the following syntax, i.e., using more backticks than you have in your document (usually four ````).

````qmd
---
title: "Reproducible Quarto Document"
format: html
---

This is a reproducible Quarto document using `format: html`.
It is written in Markdown and contains embedded R code.
When you run the code, it will produce a plot.

```{r}
plot(cars)

The end.

cscheid commented 2 months ago

We need a reprex in order to be able to go on. We don't have one, so I'm closing. Please feel free to reopen should you have a reproducible example. Thanks!

arthurgailes commented 2 months ago

How would one produce a reprex of something dependent on network drives like this?

cderv commented 2 months ago

@arthurgailes @MethodenKompetenzZentrum-TUC Do you still have issues ?

We don't have much to investigate and any further details helping use reproduce would help ! Thanks

@arthurgailes the last message we shared was this one above from December 2023 (https://github.com/quarto-dev/quarto-cli/issues/5104#issuecomment-1858065074) asking for more information, and if issue still happened. It has no answer since.

Our issue board triaging process include closing old issues with no more activities, especially those we miss some information to act on it on our own. This is what the https://github.com/quarto-dev/quarto-cli/labels/needs-repro label is about.

Providing a fully minimal and running reprex is not the only thing that can be provided to help. This is best case scenario to have one, but indeed not all can have one. What is sure is that those type of issues are hard to investigate for us and to fix if we have not enough information. So as much as we can get is necessary so that we can try reproduce the issue; Without being able to reproduce on our side, this is very hard to do something about it.

So usually there is two cases :

I hope this helps understand our process and the reason behind the closing. We are more than happy to reopen if this is still an issue that reproduce on your side with latest Quarto version. And if that is the case, we need more information about the environment, and how this can be triggered (project example, environment information, ...)

Thanks !