Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Show full path of _quarto.yml when error happens #6625

Closed
arthur-shaw opened this issue Aug 26, 2023 · 9 comments
Closed

Show full path of _quarto.yml when error happens #6625

arthur-shaw opened this issue Aug 26, 2023 · 9 comments
Assignees
Labels
bug Something isn't working
Milestone

Comments

@arthur-shaw
Copy link

Bug description

After receiving Windows 10 updates on a corporate device, Quarto stopped rendering documents. Hoping that this could be resolved by updating Quarto, IT installed the latest RStudio and Quarto.

When trying to render a simple HTML file, I get the following error message while Quarto continues to try to render (without success)

PS C:\Users\wb393438\Downloads> quarto preview c:/Users/wb393438/Downloads/quarto_issue/quarto_issue.qmd --no-browser --no-watch-inputs
ERROR: Project _quarto.yml validation failed.

(line 23, columns 10--12) Field "toc" has value yes, which must instead be `true` or `false`

x The value yes is a string.
i The error happened in location format:html:toc.
i Quarto uses YAML 1.2, which interprets booleans strictly.
i Try using true instead.


(line 23, columns 10--12) Field "toc" has value yes, which must instead be `true` or `false`

x The value yes is a string.
i The error happened in location format:html:toc.
i Quarto uses YAML 1.2, which interprets booleans strictly.
i Try using true instead.


(line 7, columns 13--16) Field "search" has value yes, which must instead be `true` or `false`

x The value yes is a string.
i The error happened in location website:navbar:search.
i Quarto uses YAML 1.2, which interprets booleans strictly.
i Try using true instead.


(line 5, columns 20--23) Field "page-navigation" has value yes, which must instead be `true` or `false`

x The value yes is a string.
i The error happened in location website:page-navigation.
i Quarto uses YAML 1.2, which interprets booleans strictly.
i Try using true instead.


Error: Project _quarto.yml validation failed.

(line 23, columns 10--12) Field "toc" has value yes, which must instead be `true` or `false`

x The value yes is a string.
i The error happened in location format:html:toc.
i Quarto uses YAML 1.2, which interprets booleans strictly.
i Try using true instead.


(line 23, columns 10--12) Field "toc" has value yes, which must instead be `true` or `false`

x The value yes is a string.
i The error happened in location format:html:toc.
i Quarto uses YAML 1.2, which interprets booleans strictly.
i Try using true instead.


(line 7, columns 13--16) Field "search" has value yes, which must instead be `true` or `false`

x The value yes is a string.
i The error happened in location website:navbar:search.
i Quarto uses YAML 1.2, which interprets booleans strictly.
i Try using true instead.


(line 5, columns 20--23) Field "page-navigation" has value yes, which must instead be `true` or `false`

x The value yes is a string.
i The error happened in location website:page-navigation.
i Quarto uses YAML 1.2, which interprets booleans strictly.
i Try using true instead.

    at readAndValidateYamlFromFile (file:///C:/Program%20Files/RStudio/resources/app/bin/quarto/bin/quarto.js:42120:15)
    at async file:///C:/Program%20Files/RStudio/resources/app/bin/quarto/bin/quarto.js:82871:26
    at async projectContext (file:///C:/Program%20Files/RStudio/resources/app/bin/quarto/bin/quarto.js:82723:26)
    at async Command.fn (file:///C:/Program%20Files/RStudio/resources/app/bin/quarto/bin/quarto.js:103695:25)
    at async Command.execute (file:///C:/Program%20Files/RStudio/resources/app/bin/quarto/bin/quarto.js:8437:13)
    at async quarto (file:///C:/Program%20Files/RStudio/resources/app/bin/quarto/bin/quarto.js:127539:5)
    at async file:///C:/Program%20Files/RStudio/resources/app/bin/quarto/bin/quarto.js:127557:9

Since nothing changed on my system apart from the Windows 10 updates (and whatever else IT packaged with it), I suspect that there's been a change in policy that prevents Quarto from doing it's work. While I know that this is a broad question, what might prevent Quarto from working? Put another way, what system permissions are necessary on Windows for Quarto to run correctly?

Steps to reproduce

---
format: html
---

Hello, World

Expected behavior

This should render an HTML file.

Actual behavior

This error appears in the terminal:

PS C:\Users\wb393438\Downloads> quarto preview c:/Users/wb393438/Downloads/quarto_issue/quarto_issue.qmd --no-browser --no-watch-inputs
ERROR: Project _quarto.yml validation failed.

(line 23, columns 10--12) Field "toc" has value yes, which must instead be `true` or `false`

x The value yes is a string.
i The error happened in location format:html:toc.
i Quarto uses YAML 1.2, which interprets booleans strictly.
i Try using true instead.


(line 23, columns 10--12) Field "toc" has value yes, which must instead be `true` or `false`

x The value yes is a string.
i The error happened in location format:html:toc.
i Quarto uses YAML 1.2, which interprets booleans strictly.
i Try using true instead.


(line 7, columns 13--16) Field "search" has value yes, which must instead be `true` or `false`

x The value yes is a string.
i The error happened in location website:navbar:search.
i Quarto uses YAML 1.2, which interprets booleans strictly.
i Try using true instead.


(line 5, columns 20--23) Field "page-navigation" has value yes, which must instead be `true` or `false`

x The value yes is a string.
i The error happened in location website:page-navigation.
i Quarto uses YAML 1.2, which interprets booleans strictly.
i Try using true instead.


Error: Project _quarto.yml validation failed.

(line 23, columns 10--12) Field "toc" has value yes, which must instead be `true` or `false`

x The value yes is a string.
i The error happened in location format:html:toc.
i Quarto uses YAML 1.2, which interprets booleans strictly.
i Try using true instead.


(line 23, columns 10--12) Field "toc" has value yes, which must instead be `true` or `false`

x The value yes is a string.
i The error happened in location format:html:toc.
i Quarto uses YAML 1.2, which interprets booleans strictly.
i Try using true instead.


(line 7, columns 13--16) Field "search" has value yes, which must instead be `true` or `false`

x The value yes is a string.
i The error happened in location website:navbar:search.
i Quarto uses YAML 1.2, which interprets booleans strictly.
i Try using true instead.


(line 5, columns 20--23) Field "page-navigation" has value yes, which must instead be `true` or `false`

x The value yes is a string.
i The error happened in location website:page-navigation.
i Quarto uses YAML 1.2, which interprets booleans strictly.
i Try using true instead.

    at readAndValidateYamlFromFile (file:///C:/Program%20Files/RStudio/resources/app/bin/quarto/bin/quarto.js:42120:15)
    at async file:///C:/Program%20Files/RStudio/resources/app/bin/quarto/bin/quarto.js:82871:26
    at async projectContext (file:///C:/Program%20Files/RStudio/resources/app/bin/quarto/bin/quarto.js:82723:26)
    at async Command.fn (file:///C:/Program%20Files/RStudio/resources/app/bin/quarto/bin/quarto.js:103695:25)
    at async Command.execute (file:///C:/Program%20Files/RStudio/resources/app/bin/quarto/bin/quarto.js:8437:13)
    at async quarto (file:///C:/Program%20Files/RStudio/resources/app/bin/quarto/bin/quarto.js:127539:5)
    at async file:///C:/Program%20Files/RStudio/resources/app/bin/quarto/bin/quarto.js:127557:9
PS C:\Users\wb393438\Downloads> 

Your environment

  • IDE: VSCode
Version: 1.81.1 (user setup)
Commit: 6c3e3dba23e8fadc360aed75ce363ba185c49794
Date: 2023-08-09T22:22:42.175Z
Electron: 22.3.18
ElectronBuildId: 22689846
Chromium: 108.0.5359.215
Node.js: 16.17.1
V8: 10.8.168.25-electron.0
OS: Windows_NT x64 10.0.19044
  • Quarto
PS C:\Users\wb393438\Downloads> quarto --version
1.3.353
  • OS:
OS Name	Microsoft Windows 10 Enterprise
Version	10.0.19044 Build 19044

Quarto check output

[>] Checking versions of quarto binary dependencies...
      Pandoc version 3.1.1: OK
Sending fatal alert BadCertificate
      Dart Sass version 1.55.0: OK
[>] Checking versions of quarto dependencies......OK
[>] Checking Quarto installation......OK
      Version: 1.3.353
      Path: C:\Program Files\RStudio\resources\app\bin\quarto\bin
      CodePage: 1252

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

[>] Checking Python 3 installation....OK
      Version: 3.11.2
      Path: C:/Users/wb393438/AppData/Local/Programs/Python/Python311/python.exe
      Jupyter: (None)

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

[>] Checking R installation...........OK
      Version: 4.2.2
      Path: C:/PROGRA~1/R/R-42~1.2
      LibPaths:
        - C:/Program Files/R/R-4.2.2/library
      knitr: 1.43
      rmarkdown: 2.23

[>] Checking Knitr engine render......OK
@arthur-shaw arthur-shaw added the bug Something isn't working label Aug 26, 2023
@arthur-shaw arthur-shaw changed the title Quarto stops rendering after Windows 10 updates Quarto stopped rendering after Windows 10 updates Aug 26, 2023
@arthur-shaw
Copy link
Author

As noted above, Quarto stopped rendering documents after Windows 10 updates were applied to my cmputer. In an effort to troubleshoot the issue, IT installed the latest version of Quarto. For the prior version of Quarto, different error messages appeared in the console.

PS C:\Users\wb393438\PICES\data_quality_support\data_quality_proposal> $ENV:QUARTO_PRINT_STACK="true"
PS C:\Users\wb393438\PICES\data_quality_support\data_quality_proposal> quarto preview c:/Users/wb393438/PICES/data_quality_support/data_quality_proposal/data_quality_proposal.qmd --no-browser --no-watch-inputs
ERROR: NotFound: The system cannot find the path specified. (os error 3)

NotFound: The system cannot find the path specified. (os error 3)
    at Object.readTextFileSync (deno:runtime/js/40_read_file.js:42:16)
    at sassLayerFile (file:///C:/Program%20Files/RStudio/resources/app/bin/quarto/bin/quarto.js:62822:30)
    at themeLayer (file:///C:/Program%20Files/RStudio/resources/app/bin/quarto/bin/quarto.js:73616:12)
    at file:///C:/Program%20Files/RStudio/resources/app/bin/quarto/bin/quarto.js:73529:20
    at Array.map (<anonymous>)
    at revealTheme (file:///C:/Program%20Files/RStudio/resources/app/bin/quarto/bin/quarto.js:73518:8)
    at Object.formatExtras (file:///C:/Program%20Files/RStudio/resources/app/bin/quarto/bin/quarto.js:73667:33)
    at runPandoc (file:///C:/Program%20Files/RStudio/resources/app/bin/quarto/bin/quarto.js:69052:81)
    at async renderPandoc (file:///C:/Program%20Files/RStudio/resources/app/bin/quarto/bin/quarto.js:69648:26)
    at async Object.onRender (file:///C:/Program%20Files/RStudio/resources/app/bin/quarto/bin/quarto.js:79331:32)
PS C:\Users\wb393438\PICES\data_quality_support\data_quality_proposal>

Note: unlike other issues that cite this error message (e.g., #2711 , #2380, #2316), the Quarto file is not on a remote/shared/synched drive. This is running on my C drive. Also, R, RStudio, and Quarto are all located on C.

Here are some details about that prior version of Quarto where different errors appeared.

PS C:\Users\wb393438\PICES\data_quality_support\data_quality_proposal> quarto --version
1.2.269
```

```
PS C:\Users\wb393438\PICES\data_quality_support\data_quality_proposal> quarto check

[>] Checking Quarto installation......OK
      Version: 1.2.269
      Path: C:\Program Files\RStudio\resources\app\bin\quarto\bin
      CodePage: 1252

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

[>] Checking Python 3 installation....OK
      Version: 3.9.7 (Conda)
      Path: C:/wbg/Anaconda3/python.exe
      Jupyter: 4.8.1
      Kernels: python3

[>] Checking Jupyter engine render....OK

[>] Checking R installation...........OK    
      Version: 4.2.2
      Path: C:/PROGRA~1/R/R-42~1.2
      LibPaths:
        - C:/Program Files/R/R-4.2.2/library
      rmarkdown: 2.23

[>] Checking Knitr engine render......OK
```

@mcanouil
Copy link
Collaborator

Please do share the content of the repository and the Quarto document.
Also what version were you using before?

It seems you have issues in your document such as toc: yes instead of toc: true as stated in the messages.
Also ensure you don't have a _quarto.yml somewhere in the parent path of the document you are rendering.

@arthur-shaw
Copy link
Author

Please do share the content of the repository and the Quarto document.
...
It seems you have issues in your document such as toc: yes instead of toc: true as stated in the messages.
Also ensure you don't have a _quarto.yml somewhere in the parent path of the document you are rendering.

The document producing the error on my system is the same as under Steps to reproduce heading of the initial message:

---
format: html
---

Hello, World

This file is in a folder with no other files present.

The error messages, hence, do not seem to be related to content that's detected.

Also what version were you using before?

The issue was first encountered on Quarto 1.2.269, albeit with same behavior (i.e., Quarto fails to render) but a different error message.

@mcanouil mcanouil added windows triaged-to Issues that were not self-assigned, signals that an issue was assigned to someone. labels Aug 27, 2023
@cderv
Copy link
Collaborator

cderv commented Aug 28, 2023

quarto preview c:/Users/wb393438/Downloads/quarto_issue/quarto_issue.qmd --no-browser --no-watch-inputs
ERROR: Project _quarto.yml validation failed.

This seems to be a message in _quarto.yml validation as @mcanouil shared already.

This Project _quarto.yml validation failed only happens when a _quarto.yml (or _quarto.yaml) is found and that reading it fail because of some specs. Like you are encountering. I don't see for now how this error message can be triggered without a _quarto.yml found somewhere in the path of your file (including parents folder ! )

Sorry to ask again, but please can you check again that you don't have any _quarto.yml file somewhere in the directories of c:/Users/wb393438/Downloads/quarto_issue/quarto_issue.qmd, especially in C:\Users\wb393438\Downloads from where you are running quarto preview ? Check any parent folder of quarto_issue.qmd.

To really be sure there is no _quarto.yml left over somewhere you are not expecting, run a file search on your computer for _quarto.yml.

Also, try the following

  • Run quarto create project in a new location. This will create a fresh project
  • Try to render a qmd from that project directory.
  • Does Quarto works in this situation ? It should - the fact that you create a new project, will make Quarto use the _quarto.yml from this project.

I personally use Windows and Quarto is working fine, so I am trying to isolate what make it fails in your environment.

Thanks for your help.

@cderv cderv added needs-repro Issues that are blocked until reporter provides an adequate reproduction and removed triaged-to Issues that were not self-assigned, signals that an issue was assigned to someone. labels Aug 28, 2023
@cscheid
Copy link
Collaborator

cscheid commented Aug 28, 2023

Project _quarto.yml validation failed

When this happens, quarto really should also write the full qualified path of _quarto.yml...

@arthur-shaw
Copy link
Author

@cderv , as you expected, there was indeed a _quarto.yml file floating around in the parent directory.

r$> fs::dir_ls(path = "C:/Users//wb393438//Downloads/", regexp = "\\_quarto.yml", recurse = TRUE)
C:/Users/wb393438/Downloads/ecodown-main/inst/readme_files/_quarto.yml
C:/Users/wb393438/Downloads/ecodown-main/tests/testthat/assets/callthat_files/_quarto.yml
C:/Users/wb393438/Downloads/ecodown-main/tests/testthat/assets/quarto_files/_quarto.yml  
C:/Users/wb393438/Downloads/ecodown-main/tests/testthat/assets/testsite/_quarto.yml      
C:/Users/wb393438/Downloads/quarto_site_test/_quarto.yml
C:/Users/wb393438/Downloads/quarto_test_site2/_quarto.yml
C:/Users/wb393438/Downloads/spark.rstudio.com-main/_quarto.yml
C:/Users/wb393438/Downloads/_quarto.yml

After deleting that file (i.e., C:/Users/wb393438/Downloads/_quarto.yml) and following the steps you outlined, the project renders as expected.

PS C:\Users\wb393438> cd .\Downloads\quarto_issue\
PS C:\Users\wb393438\Downloads\quarto_issue> dir           
PS C:\Users\wb393438\Downloads\quarto_issue> quarto create project
 ? TypeSending fatal alert BadCertificate
 ? Type » default
 ? Directory » 
 ? Directory » quarto_issue
Creating project at C:\Users\wb393438\Downloads\quarto_issue\quarto_issue:
  - Created _quarto.yml
  - Created Quarto_issue.qmd
PS C:\Users\wb393438\Downloads\quarto_issue> 

image

I didn't realize that Quarto searches parent folders for _quarto.yml. I'll try to be less messy in future.

For the data_quality_proposal project that sent me down this path, I now have it working without issue. However, as best I can tell, the error arises because of the qmd file's contents, and has an uninformative (low-level) error message. After replicating the issue on a Linux machine, I realized that the issue wasn't my Windows environment. After some sleuthing, I discovered that the qmd file was referring to a few CSS classes that weren't defined in any of the project's scss files.

To make this a little more concrete, here's a snippet of the qmd file.

---
format: 
    revealjs: 
        theme: [default, assets/core.scss, assets/data_quality_proposal.scss]
        height: 900
        width: 1600
        self-contained: true
execute: 
  eval: false
  echo: true
---

# Proposed data quality system {background-color=var(--suso)}


## Components {.suso}

::: {.box .box-1}
Completeness report
:::

For reference, here's the error message:

PS C:\Users\wb393438\PICES\data_quality_support\data_quality_proposal> $ENV:QUARTO_PRINT_STACK="true"
PS C:\Users\wb393438\PICES\data_quality_support\data_quality_proposal> quarto preview c:/Users/wb393438/PICES/data_quality_support/data_quality_proposal/data_quality_proposal.qmd --no-browser --no-watch-inputs
ERROR: NotFound: The system cannot find the path specified. (os error 3)

NotFound: The system cannot find the path specified. (os error 3)
    at Object.readTextFileSync (deno:runtime/js/40_read_file.js:42:16)
    at sassLayerFile (file:///C:/Program%20Files/RStudio/resources/app/bin/quarto/bin/quarto.js:62822:30)
    at themeLayer (file:///C:/Program%20Files/RStudio/resources/app/bin/quarto/bin/quarto.js:73616:12)
    at file:///C:/Program%20Files/RStudio/resources/app/bin/quarto/bin/quarto.js:73529:20
    at Array.map (<anonymous>)
    at revealTheme (file:///C:/Program%20Files/RStudio/resources/app/bin/quarto/bin/quarto.js:73518:8)
    at Object.formatExtras (file:///C:/Program%20Files/RStudio/resources/app/bin/quarto/bin/quarto.js:73667:33)
    at runPandoc (file:///C:/Program%20Files/RStudio/resources/app/bin/quarto/bin/quarto.js:69052:81)
    at async renderPandoc (file:///C:/Program%20Files/RStudio/resources/app/bin/quarto/bin/quarto.js:69648:26)
    at async Object.onRender (file:///C:/Program%20Files/RStudio/resources/app/bin/quarto/bin/quarto.js:79331:32)
PS C:\Users\wb393438\PICES\data_quality_support\data_quality_proposal>

The problem: The box-1 class wasn't in either scss file.

If this isn't a known issue and if I can replicate it, I'll post a separate issue.

Thanks for the all the help! Sorry that this was a false positive.

@cderv
Copy link
Collaborator

cderv commented Aug 28, 2023

After deleting that file (i.e., C:/Users/wb393438/Downloads/_quarto.yml) and following the steps you outlined, the project renders as expected.

Good to know ! Glad it is not something else.

For reference, here's the error message:

This seems related to SASS compilation. Document mentions theme: [default, assets/core.scss, assets/data_quality_proposal.scss] so be sure that those scss file exists.

Again not a good error message IMO... 😞 sorry

If you can reproduce with latest version in clean project, then please open a new issue. Thanks !

When this happens, quarto really should also write the full qualified path of _quarto.yml...

@cscheid for sure ! I agree with you. We should report absolute path.

@cderv cderv removed the needs-repro Issues that are blocked until reporter provides an adequate reproduction label Aug 28, 2023
@cderv cderv changed the title Quarto stopped rendering after Windows 10 updates Error with absolute path to config file to avoid surprising error with validation when _quarto.yml is not expected. Aug 28, 2023
@cderv
Copy link
Collaborator

cderv commented Aug 28, 2023

I didn't realize that Quarto searches parent folders for _quarto.yml. I'll try to be less messy in future.

Not sure it searches in parent folder, but your config file is in C:/Users/wb393438/Downloads/_quarto.yml and you ran your command from this folder

PS C:\Users\wb393438\Downloads> quarto preview c:/Users/wb393438/Downloads/quarto_issue/quarto_issue.qmd --no-browser --no-watch-inputs

So technically, you C:/Users/wb393438/Downloads/ folder is a quarto project.

@cscheid cscheid added this to the v1.5 milestone Nov 30, 2023
@cscheid cscheid modified the milestones: v1.5, v1.6 Jun 25, 2024
@cscheid cscheid changed the title Error with absolute path to config file to avoid surprising error with validation when _quarto.yml is not expected. Show full path of _quarto.yml when error happens Jun 25, 2024
@cscheid cscheid removed the windows label Jun 25, 2024
@cscheid
Copy link
Collaborator

cscheid commented Jun 25, 2024

Actually, I'm going to close this one and open a new issue just so that we have a cleaner comment thread.

@cscheid cscheid closed this as not planned Won't fix, can't repro, duplicate, stale Jun 25, 2024
@cscheid cscheid assigned cscheid and unassigned cderv Oct 29, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

4 participants