Open phongphuhanam opened 5 months ago
@phongphuhanam I am not part of a dev team, but it seems that is the git
that ask you for a password, not quarto
, so maybe you have something misconfigured in your zsh
here you can read more how to work with private repos
https://stackoverflow.com/questions/7773181/git-keeps-prompting-me-for-a-password
One of possible reason is that you pointing to the repo via https not ssh or just try to properly configure your credentials (git asking you for abc
account so it seems that you have something misconfigured)
if you try invoke only quarto via command line quarto render index.qmd --to html
or quarto preview index.qmd --to html
you shouldn't have this problem
@danieltomasz, Thank you for the suggestion. I tried the preview
option but the results are similar:
git remote -v && quarto preview index.qmd --to html 1 ↵
origin https://github.com/phongphuhanam/my-dummpy-private-repo (fetch)
origin https://github.com/phongphuhanam/my-dummpy-private-repo (push)
Username for 'https://github.com':
So for now, my quick fix is to change the origin
remote to some other name, and the render
or preview
is OK.
Maybe need to install again with root user
You should not need to use root permission.
The one asking the credentials is Git because there is a Git operation (likely a check of some guide) that needs access to the remote which is private.
I am not 100% certain (and cannot check right now) but I don't think quarto render/preview
uses Git at all.
If it works in VSCode it is because you are logged in using a GitHub account with access to the repository. "Everything" inside VSCode has access to the account credentials so the request for credentials happens but it is satisfied in this context/environment. While outside of VSCode, credentials do not exist.
@phongphuhanam did you share all the information on your example ?
My following answers will be wild guesses based the hint you shared.
The test_project is default from Quarto
I understand you ran quarto create project
and selected the default type, is that so ? What is in your _quarto.yml
as project type ?
manuscript: article: index.qmd notebooks: [] mecaFile: index-meca.zip
I am seeing this in your log, which is usually used for a Quarto Manuscript project
So it seems the project you are using and produce this problem is a Manuscript project which produce a Meca Bundle.
It happens, Quarto is using git
when available to list all the files that should be included in the Meca Bundle
https://github.com/quarto-dev/quarto-cli/blob/d5edb79404188308630370617c8d7a3f14d2de33/src/project/types/manuscript/manuscript-meca.ts#L151-L175
The command used is git ls-files
. You could check in terminal that this commands is asking you for credentials in your specific case (because of how you git repo is configured).
You can try set meca-bundle: false
in the format: manuscript
configuration. This should opt-out the bundle creation, and probably not show the error you see.
It would be really appreciated if you could provide a github repo that reproduce this problem so that we can confirm this is indeed related to Manuscript, and we could think of ways to nicely fails when git
is not correctly configured.
At least, we will document that git
is used when available to list the file.
Hope it helps understand
@cderv Here is my source file for the test_project
_quarto.yaml
project:
type: manuscript
manuscript:
article: index.qmd
format:
html:
comments:
hypothesis: true
docx: default
jats: default
# (other formats)
# pdf: default
execute:
freeze: true
index.qmd
---
title: ./test_project
authors:
- name: Norah Jones
affiliation: The University
roles: writing
corresponding: true
bibliography: references.bib
---
## Section
This is a simple placeholder for the manuscript's main document [@knuth84].
references.bib
@article{knuth84,
author = {Knuth, Donald E.},
title = {Literate Programming},
year = {1984},
issue_date = {May 1984},
publisher = {Oxford University Press, Inc.},
address = {USA},
volume = {27},
number = {2},
issn = {0010-4620},
url = {https://doi.org/10.1093/comjnl/27.2.97},
doi = {10.1093/comjnl/27.2.97},
journal = {Comput. J.},
month = may,
pages = {97–111},
numpages = {15}
}
I believed that is the default file generate by quarto create
command.
One more thing is I used Quarto inside Debian docker container, so that's why git credentials are not available.
@phongphuhanam look at Christophe's comment, in particular the part about "meca".
Here is my source file for the test_project
So this is indeed a manuscript project as your _quarto.yml shows
project:
type: manuscript
I believed that is the default file generate by quarto create command.
The Quarto CLI command should offer you choices when you run quarto create
.
❯ quarto create
? Create
❯ project
extension
then
? Create » project
? Type
❯ default
website
blog
manuscript
book
confluence
So manuscript should not be the default type
One more thing is I used Quarto inside Debian docker container, so that's why git credentials are not available.
This is a setup problem - if you have git
and a remote configured to an external repo, then when using git to reach some information there, it will requires credentials.
We'll try to reproduce to understand why Manuscript would require access to your git remote and if we can prevent this.
Though you could remove the remote if you don't need it in your Debian docker container. If you have it setup, probably credentiais were working at some point.
@cderv Oh, I forgot to mention the choice after the quarto create
command.
Until the issue is fixed, here is my quick solution.
@danieltomasz, Thank you for the suggestion. I tried the
preview
option but the results are similar:git remote -v && quarto preview index.qmd --to html 1 ↵ origin https://github.com/phongphuhanam/my-dummpy-private-repo (fetch) origin https://github.com/phongphuhanam/my-dummpy-private-repo (push) Username for 'https://github.com':
So for now, my quick fix is to change the
origin
remote to some other name, and therender
orpreview
is OK.
Hi, I run in the same problem
Sounds like a nice feature the manuscript .
As indicated above, after changing the git origin to a dummy public repository on github it does work
$ git remote -v && quarto preview index.qmd --to html
output from the console:
```
origin git@github.com:
Using the render button in Rstudio gives the following output in the console:
```
==> quarto preview index.qmd --to html --no-watch-inputs --no-browse
processing file: index.qmd
output file: index.knit.md
Rendering HTML preview [index.qmd]
ERROR: There is an error while retrieving information from remote 'origin'.
Git error: git@github.com: Permission denied (publickey).
fatal: Could not read from remote repository.
Please make sure you have the correct access rights
and the repository exists.
.
Git status code: 128.
Stack trace:
Git error: git@github.com: Permission denied (publickey).
fatal: Could not read from remote repository.
Please make sure you have the correct access rights
and the repository exists.
.
Git status code: 128.
at gitHubContext (file:///C:/Users/
$ quarto check
```
Quarto 1.5.57
[>] Checking versions of quarto binary dependencies...
Pandoc version 3.2.0: OK
Dart Sass version 1.70.0: OK
Deno version 1.41.0: OK
Typst version 0.11.0: OK
[>] Checking versions of quarto dependencies......OK
[>] Checking Quarto installation......OK
Version: 1.5.57
Path: C:\Users\
@Fpadt
Could you properly format your post using code blocks for code and terminal outputs? Thanks.
Your post is almost ineligible.
If your code contains code blocks, you need to enclose it using more backticks, i.e., usually four ````
.
Use /details
for long entry.
See https://quarto.org/bug-reports.html#formatting-make-githubs-markdown-work-for-us.
I ran into the same issue.
Create a clean quarto manuscript project:
quarto create project manuscript . "helloworld"
Initialize git, add private remote origin, commit & push
git init
git remote add origin <my_private_origin>
git branch -M main
git add --all
git commit -m "initial commit"
git push -uf origin main
Revoke access to private remote repository
Try to render the quarto project and watch it fail
quarto render
ERROR: There is an error while retrieving information from remote 'origin'.
Git error: git@
Now, I understand that this error is caused by git and is in fact expected if access to the private repo is revoked. However, I actually do not at all intend to invoke git when doing quarto render
. Also, following the reply of @cderv, I tried setting meca-bundle: false
, like so:
manuscript:
article: index.qmd
meca-bundle: false
````yaml project: type: manuscript manuscript: article: index.qmd meca-bundle: false format: html: comments: hypothesis: true docx: default jats: default # (other formats) # pdf: default execute: freeze: true ````
But the error persists.
meca-bundle
option in the wrong place?Did I maybe add the meca-bundle option in the wrong place?
I think this is the right place, but as we document in https://quarto.org/docs/manuscripts/components.html#meca-bundle using format: jats
opt-in for the bundle anyway.
Is there a way to force quarto to render the manuscript project using just the local files in the local project directory, without invoking git?
This is what this issue is about. I need to understand what exactly is happening here related to how git is used.
To build the bundle, git ls-files
command is used, and I don't know if it can avoid a remote call.
The minimul we can do is catched the git error here, and fallback to the non git mode maybe.
@mcanouil You are right, apologies!
I was in a hurry for a business trip and wanted to post this hoping for a solution on my return ;)
In the end, I just replicate the RStudio instructions, didn't change any code and just tried the preview feature and the RENDER button
the strange thing is that it does work in VSCode but the same not in RStudio
Tried to make it more readable, added quarto check. Hope it helps
Searching for a workaround to use a private repository on GitHub whilst being able to render my manuscript I ran into the following:
Render Project
button in Rstudio throws an error regarding the Git permissionThe command I used is:
quarto preview --render all --no-watch-inputs --no-browse
it generates the manuscript which can be opened in a browser.
It seems the Render Project
button does more behind the scenes, resulting in the error.
The repository I am using is PUBLIC and still throws an error using the Render Project
button.
It is a clone of the original template from RStudio and can be found here: manuscript-template-rstudio.
Note that the _quarto.yml
only has two formats and no meca-bundle
.
❌ the Render Project button in Rstudio throws an error regarding the Git permission ✔ the same command entered via he terminal does work.
That is interesting information. It would indicate this is RStudio IDE integration issue somehow if both quarto version are identical.
Render Project
will do a quarto preview
so be sure to try preview on the terminal.
The repository I am using is PUBLIC and still throws an error using the Render Project button. It is a clone of the original template from RStudio and can be found here: manuscript-template-rstudio.
Note that the _quarto.yml only has two formats and no meca-bundle.
we'll look into this.
Hi,
I do have this issue too on a project.
I thought it was something I did to the git history but it so I also replicated on another (regular) notebook and the compilation failed too. I can't use CLI (windows machine)
It was working fine a couple weeks ago then stopped (I might have updated packages, I'm not sure)
A temporary workaround can be to use website
rather than manuscript
in _quarto.yml
project:
# type: manuscript
type: website
Another workaround is to use HTTPS credentials rather SSH but it is not possible everywhere and it is very cumbersome.
Quarto version: 1.6.33 Rstudio version: 2024.09.0 & 2024.09.1 OS: Windows 10
EDIT : Add environment info and re-runned the compilation : type: website
is ok, type: manuscript
is KO
R version 4.3.1 (2023-06-16 ucrt)
Platform: x86_64-w64-mingw32/x64 (64-bit)
Running under: Windows 10 x64 (build 19045)
Locale:
LC_COLLATE=French_France.utf8 LC_CTYPE=French_France.utf8
LC_MONETARY=French_France.utf8 LC_NUMERIC=C
LC_TIME=French_France.utf8
Package version:
backports_1.4.1 base64enc_0.1-3 base64url_1.4
bslib_0.5.1 cachem_1.0.8 callr_3.7.3
class_7.3-22 classInt_0.4-10 cli_3.6.1
codetools_0.2-19 colorspace_2.1-0 compiler_4.3.1
cpp11_0.4.7 data.table_1.15.4 DataExplorer_0.8.3
DBI_1.2.2 digest_0.6.33 dplyr_1.1.4
e1071_1.7-14 ellipsis_0.3.2 evaluate_0.23
fansi_1.0.4 farver_2.1.1 fastmap_1.1.1
fontawesome_0.5.2 fs_1.6.3 generics_0.1.3
ggplot2_3.4.3 glue_1.6.2 graphics_4.3.1
grDevices_4.3.1 grid_4.3.1 gridExtra_2.3
gtable_0.3.3 here_1.0.1 highr_0.11
htmltools_0.5.7 htmlwidgets_1.6.4 igraph_2.0.3
isoband_0.2.7 jquerylib_0.1.4 jsonlite_1.8.7
KernSmooth_2.23-22 knitr_1.47 labeling_0.4.2
lattice_0.21.8 lifecycle_1.0.3 magrittr_2.0.3
maplegend_0.1.0 mapsf_0.10.1 MASS_7.3.60
Matrix_1.5.4.1 memoise_2.0.1 methods_4.3.1
mgcv_1.8.42 mime_0.12 munsell_0.5.0
networkD3_0.4 nlme_3.1.162 parallel_4.3.1
pillar_1.9.0 pkgconfig_2.0.3 plyr_1.8.9
png_0.1-8 processx_3.8.2 proxy_0.4-27
ps_1.7.5 purrr_1.0.2 R6_2.5.1
rappdirs_0.3.3 RColorBrewer_1.1.3 Rcpp_1.0.11
repr_1.1.7 reshape2_1.4.4 rlang_1.1.1
rmarkdown_2.27 rprojroot_2.0.3 rstudioapi_0.16.0
s2_1.1.6 sass_0.4.7 scales_1.2.1
secretbase_1.0.0 sf_1.0-15 skimr_2.1.5
splines_4.3.1 stats_4.3.1 stringi_1.7.12
stringr_1.5.0 targets_1.7.1 tibble_3.2.1
tidyr_1.3.0 tidyselect_1.2.0 tinytex_0.48
tools_4.3.1 units_0.8-5 utf8_1.2.3
utils_4.3.1 vctrs_0.6.5 viridisLite_0.4.2
withr_2.5.0 wk_0.9.1 xfun_0.45
yaml_2.3.7
Thanks for sharing feedback
I can't use CLI (windows machine)
Can you give more detail on that.
@cderv it was not running this morning I swear, probably because CMD called an R version which did'nt have the right packages and I was not able to determine which one.
But I had another issue (completely unrelated - a conflict between xfun::is_false() and base::is_false() ) so I ended updating R to 4.4.2 and reinstalling all the env, I retried and CLI works just fine now 🥳
EDIT: it works through Rstudio to now Current environment .
R version 4.4.2 (2024-10-31 ucrt)
Platform: x86_64-w64-mingw32/x64
Running under: Windows 10 x64 (build 19045)
Locale:
LC_COLLATE=French_France.utf8 LC_CTYPE=French_France.utf8
LC_MONETARY=French_France.utf8 LC_NUMERIC=C
LC_TIME=French_France.utf8
Package version:
backports_1.5.0 base64enc_0.1-3 base64url_1.4
bslib_0.8.0 cachem_1.1.0 callr_3.7.6
class_7.3-22 classInt_0.4-10 cli_3.6.3
codetools_0.2-20 colorspace_2.1-1 compiler_4.4.2
cpp11_0.5.0 data.table_1.16.2 DataExplorer_0.8.3
DBI_1.2.3 digest_0.6.37 dplyr_1.1.4
e1071_1.7-16 evaluate_1.0.1 fansi_1.0.6
farver_2.1.2 fastmap_1.2.0 fontawesome_0.5.3
fs_1.6.5 generics_0.1.3 ggplot2_3.5.1
glue_1.8.0 graphics_4.4.2 grDevices_4.4.2
grid_4.4.2 gridExtra_2.3 gtable_0.3.6
here_1.0.1 highr_0.11 htmltools_0.5.8.1
htmlwidgets_1.6.4 igraph_2.1.1 isoband_0.2.7
jquerylib_0.1.4 jsonlite_1.8.9 KernSmooth_2.23-24
knitr_1.49 labeling_0.4.3 lattice_0.22.6
lifecycle_1.0.4 magrittr_2.0.3 maplegend_0.2.0
mapsf_0.12.0 MASS_7.3.61 Matrix_1.7.1
memoise_2.0.1 methods_4.4.2 mgcv_1.9.1
mime_0.12 munsell_0.5.1 networkD3_0.4
nlme_3.1.166 parallel_4.4.2 pillar_1.9.0
pkgconfig_2.0.3 plyr_1.8.9 processx_3.8.4
proxy_0.4-27 ps_1.8.1 purrr_1.0.2
R6_2.5.1 rappdirs_0.3.3 RColorBrewer_1.1.3
Rcpp_1.0.13-1 renv_1.0.11 repr_1.1.7
reshape2_1.4.4 rlang_1.1.4 rmarkdown_2.29
rprojroot_2.0.4 s2_1.1.7 sass_0.4.9
scales_1.3.0 secretbase_1.0.3 sf_1.0-19
skimr_2.1.5 splines_4.4.2 stats_4.4.2
stringi_1.8.4 stringr_1.5.1 targets_1.9.0
tibble_3.2.1 tidyr_1.3.1 tidyselect_1.2.1
tinytex_0.54 tools_4.4.2 units_0.8-5
utf8_1.2.4 utils_4.4.2 vctrs_0.6.5
viridisLite_0.4.2 withr_3.0.2 wk_0.9.4
xfun_0.49 yaml_2.3.10
Did more tests this morning using the manuscript-tutorial repo,
Did several things
git clone git@github.com:nicolas-roelandt/manuscript-tutorial.git
cd manuscript-tutorial
renv::restore()
quarto render
> cd manuscript-tutorial
manuscript-tutorial>quarto render
[1/2] notebooks\explore-earthquakes.qmd
processing file: explore-earthquakes.qmd
1/7
2/7 [unnamed-chunk-1]
3/7
4/7 [unnamed-chunk-2]
5/7
6/7 [fig-spatial-plot]
7/7
output file: explore-earthquakes.knit.md
ERROR: There is an error while retrieving information from remote 'origin'.
Git error: Host key verification failed.
fatal: Could not read from remote repository.
Please make sure you have the correct access rights
and the repository exists.
.
Git status code: 128.
Stack trace:
Git error: Host key verification failed.
fatal: Could not read from remote repository.
Please make sure you have the correct access rights
and the repository exists.
.
Git status code: 128.
at gitHubContext (file:///C:/Users/roelandt/AppData/Local/Programs/Quarto/bin/quarto.js:80515:31)
at eventLoopTick (ext:core/01_core.js:175:7)
at async Object.filterParams (file:///C:/Users/roelandt/AppData/Local/Programs/Quarto/bin/quarto.js:102623:39)
at async projectFilterParams (file:///C:/Users/roelandt/AppData/Local/Programs/Quarto/bin/quarto.js:51123:45)
at async filterParamsJson (file:///C:/Users/roelandt/AppData/Local/Programs/Quarto/bin/quarto.js:50886:12)
at async runPandoc (file:///C:/Users/roelandt/AppData/Local/Programs/Quarto/bin/quarto.js:76833:24)
at async renderPandoc (file:///C:/Users/roelandt/AppData/Local/Programs/Quarto/bin/quarto.js:78003:26)
at async pandocRenderNb (file:///C:/Users/roelandt/AppData/Local/Programs/Quarto/bin/quarto.js:102334:33)
at async Object.onRender (file:///C:/Users/roelandt/AppData/Local/Programs/Quarto/bin/quarto.js:102426:36)
at async renderFileInternal (file:///C:/Users/roelandt/AppData/Local/Programs/Quarto/bin/quarto.js:85523:17)
manuscript-tutorial>quarto --version
1.6.33
Run quarto-dev/quarto-actions/publish@v2
Run git config --global user.email "quarto-github-actions-publish@example.com"
From https://github.com/nicolas-roelandt/manuscript-tutorial
* branch gh-pages -> FETCH_HEAD
* [new branch] gh-pages -> origin/gh-pages
Rendering for publish:
[1/2] notebooks/explore-earthquakes.qmd
# Bootstrapping renv 1.0.11 --------------------------------------------------
- Downloading renv ... OK
- Installing renv ... OK
- One or more packages recorded in the lockfile are not installed.
- Use `renv::status()` for more details.
Error in loadNamespace(x) : there is no package called ‘rmarkdown’
Calls: loadNamespace -> withRestarts -> withOneRestart -> doWithOneRestart
Execution halted
R installation:
Version: 4.4.2
Path: /usr/lib/R
LibPaths:
- /home/runner/work/manuscript-tutorial/manuscript-tutorial/renv/library/linux-ubuntu-jammy/R-4.4/x86_64-pc-linux-gnu
- /home/runner/.cache/R/renv/sandbox/linux-ubuntu-jammy/R-4.4/x86_64-pc-linux-gnu/9a444a72
knitr: (None)
rmarkdown: (None)
The knitr package is not available in this R installation.
Install with install.packages("knitr")
The rmarkdown package is not available in this R installation.
Install with install.packages("rmarkdown")
Thanks a lot. I'll take into account this new information when I'll look into this.
Bug description
Hello, thank you for a great work. Today I try to render the Quarto document from terminal zsh(without Vscode). Quarto then ask for GitHub login user name and password every time before it render.
origin
, or change theorigin
name to something else, or change the remote url oforigin
to public repository, quarto is able to render document without asking the question.However, if I render with Vscode quarto plugin, there are no issue.
Steps to reproduce
Create 'test_project'
The test_project is default from Quarto
Render documents:
Expected behavior
Quarto should not ask Github login user id and pw:
Actual behavior
Add dummy private repository:
Render again:
Your environment
Quarto check output