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

deploy_site_github() is not finding the ssh key #1206

Closed
lcolladotor opened this issue Jan 17, 2020 · 13 comments
Closed

deploy_site_github() is not finding the ssh key #1206

lcolladotor opened this issue Jan 17, 2020 · 13 comments

Comments

@lcolladotor
Copy link

Hi,

I haven't been able to get pkgdown::deploy_site_github() working at https://github.com/ComunidadBioInfo/regutools as I keep getting the no deploy key found error as shown for example at https://travis-ci.com/ComunidadBioInfo/regutools/builds/144932233. Initially I started by using usethis::use_pkgdown(); usethis::use_pkgdown_travis().

Installing deploy dependencies
Successfully installed dpl-script-1.10.14
1 gem installed
dpl.2
Preparing deploy
dpl.3
Deploying application
Error: No deploy key found, please setup with `travis::use_travis_deploy()`
Execution halted
Script failed with status 1

Initially yesterday, the Travis endpoint was .org https://travis-ci.org/ComunidadBioInfo/regutools but I moved it to .com since travis::use_travis_deploy() by default wouldn't work (travis::use_travis_deploy(endpoint = '.org') did work). In any case, at .com, I deleted the keys in both Travis and GitHub as this worked for another user #970: specifically at https://github.com/ComunidadBioInfo/regutools/settings/keys and https://travis-ci.com/ComunidadBioInfo/regutools/settings. I then ran travis::use_travis_deploy() and it all seems to work (I see the new keys in both Travis and GitHub)

> travis::use_travis_deploy()
ℹ Querying Github deploy keys from repo.Getting environment variables for `ComunidadBioInfo/regutools` on Travis CI.At least one key part is missing (private or public). Deleting old keys and
  adding new deploy keys for Travis CI (`.com`) for repo regutools to Travis CI
  and Github
──────────────────────────────────────────────────────────────────────────────────────────
✓ Added a public deploy key to GitHub for repo `regutools`.Added environment variable for `ComunidadBioInfo/regutools` on Travis CI.
──────────────────────────────────────────────────────────────────────────────────────────
✓ Added the private SSH key as a deploy key to project `regutools` on Travis CI
  as secure environment variable `TRAVIS_DEPLOY_KEY`.Added the public SSH key as a deploy key to project `regutools` on Github.

At pkgdown::deploy_site_github() I see that the error is triggered when !nzchar(ssh_id) is TRUE and the default ssh_id value is ssh_id = Sys.getenv("id_rsa", "") . At https://travis-ci.com/ComunidadBioInfo/regutools/builds/144932233 I do see that TRAVIS_DEPLOY_KEY is set but maybe I need to add some other environment variable on my .travis.yml file https://github.com/ComunidadBioInfo/regutools/blob/c4e30073e3e0aa0d75aa824c5904b4e1eb721360/.travis.yml. I looked at a few other .travis.yml files at github.com/ropenscilabs like circle and travis but they use other tools (tci as in tic::deploy() for https://github.com/ropenscilabs/circle/blob/master/.travis.yml) which feels like a new rabbit hole :P.

Setting environment variables from repository settings
$ export TRAVIS_DEPLOY_KEY=[secure]

If you have other ideas on what else I should try or how I can get more information for debugging this please let me know. Thank you!

Best,
Leo

R session information

> library(travis)

Attaching package:travisThe following object is masked frompackage:usethis:

    browse_travis

> library(pkgdown)

Attaching package:pkgdownThe following object is masked frompackage:devtools:

    build_site

> options(width = 120)
> sessioninfo::session_info()
─ Session info ───────────────────────────────────────────────────────────────────────────────────────────────────────
 setting  value                       
 version  R version 3.6.2 (2019-12-12)
 os       macOS Catalina 10.15.2      
 system   x86_64, darwin15.6.0        
 ui       RStudio                     
 language (EN)                        
 collate  en_US.UTF-8                 
 ctype    en_US.UTF-8                 
 tz       America/New_York            
 date     2020-01-17Packages ───────────────────────────────────────────────────────────────────────────────────────────────────────────
 package                * version    date       lib source                              
 AnnotationDbi            1.48.0     2019-10-29 [1] Bioconductor                        
 AnnotationHub            2.18.0     2019-10-29 [1] Bioconductor                        
 assertthat               0.2.1      2019-03-21 [1] CRAN (R 3.6.0)                      
 backports                1.1.5      2019-10-02 [1] CRAN (R 3.6.0)                      
 bibtex                   0.4.2.2    2020-01-02 [1] CRAN (R 3.6.0)                      
 Biobase                  2.46.0     2019-10-29 [1] Bioconductor                        
 BiocFileCache            1.10.2     2019-11-08 [1] Bioconductor                        
 BiocGenerics             0.32.0     2019-10-29 [1] Bioconductor                        
 BiocManager              1.30.10    2019-11-16 [1] CRAN (R 3.6.1)                      
 BiocVersion              3.10.1     2019-06-06 [1] Bioconductor                        
 bit                      1.1-14     2018-05-29 [1] CRAN (R 3.6.0)                      
 bit64                    0.9-7      2017-05-08 [1] CRAN (R 3.6.0)                      
 blob                     1.2.0      2019-07-09 [1] CRAN (R 3.6.0)                      
 callr                    3.4.0      2019-12-09 [1] CRAN (R 3.6.1)                      
 cli                      2.0.1      2020-01-08 [1] CRAN (R 3.6.0)                      
 colorout               * 1.2-1      2019-05-07 [1] Github (jalvesaq/colorout@7ea9440)  
 crayon                   1.3.4      2017-09-16 [1] CRAN (R 3.6.0)                      
 curl                     4.3        2019-12-02 [1] CRAN (R 3.6.0)                      
 DBI                      1.1.0      2019-12-15 [1] CRAN (R 3.6.0)                      
 dbplyr                   1.4.2      2019-06-17 [1] CRAN (R 3.6.0)                      
 desc                     1.2.0      2018-05-01 [1] CRAN (R 3.6.0)                      
 devtools               * 2.2.1      2019-09-24 [1] CRAN (R 3.6.1)                      
 digest                   0.6.23     2019-11-23 [1] CRAN (R 3.6.0)                      
 dplyr                    0.8.3      2019-07-04 [1] CRAN (R 3.6.0)                      
 ellipsis                 0.3.0      2019-09-20 [1] CRAN (R 3.6.0)                      
 fansi                    0.4.1      2020-01-08 [1] CRAN (R 3.6.0)                      
 fastmap                  1.0.1      2019-10-08 [1] CRAN (R 3.6.0)                      
 fs                       1.3.1      2019-05-06 [1] CRAN (R 3.6.0)                      
 glue                     1.3.1      2019-03-12 [1] CRAN (R 3.6.0)                      
 htmltools                0.4.0      2019-10-04 [1] CRAN (R 3.6.0)                      
 httpuv                   1.5.2      2019-09-11 [1] CRAN (R 3.6.0)                      
 httr                     1.4.1      2019-08-05 [1] CRAN (R 3.6.0)                      
 interactiveDisplayBase   1.24.0     2019-10-29 [1] Bioconductor                        
 IRanges                  2.20.1     2019-11-20 [1] Bioconductor                        
 jsonlite                 1.6        2018-12-07 [1] CRAN (R 3.6.0)                      
 later                    1.0.0      2019-10-04 [1] CRAN (R 3.6.0)                      
 lubridate                1.7.4      2018-04-11 [1] CRAN (R 3.6.0)                      
 magrittr                 1.5        2014-11-22 [1] CRAN (R 3.6.0)                      
 MASS                     7.3-51.5   2019-12-20 [1] CRAN (R 3.6.0)                      
 memoise                  1.1.0      2017-04-21 [1] CRAN (R 3.6.0)                      
 mime                     0.8        2019-12-19 [1] CRAN (R 3.6.0)                      
 packrat                  0.5.0      2018-11-14 [1] CRAN (R 3.6.0)                      
 pillar                   1.4.3      2019-12-20 [1] CRAN (R 3.6.0)                      
 pkgbuild                 1.0.6      2019-10-09 [1] CRAN (R 3.6.0)                      
 pkgconfig                2.0.3      2019-09-22 [1] CRAN (R 3.6.1)                      
 pkgdown                * 1.4.1      2019-09-15 [1] CRAN (R 3.6.0)                      
 pkgload                  1.0.2      2018-10-29 [1] CRAN (R 3.6.0)                      
 plyr                     1.8.5      2019-12-10 [1] CRAN (R 3.6.0)                      
 prettyunits              1.1.0      2020-01-09 [1] CRAN (R 3.6.2)                      
 processx                 3.4.1      2019-07-18 [1] CRAN (R 3.6.0)                      
 promises                 1.1.0      2019-10-04 [1] CRAN (R 3.6.0)                      
 ps                       1.3.0      2018-12-21 [1] CRAN (R 3.6.0)                      
 purrr                    0.3.3      2019-10-18 [1] CRAN (R 3.6.0)                      
 R6                       2.4.1      2019-11-12 [1] CRAN (R 3.6.1)                      
 rappdirs                 0.3.1      2016-03-28 [1] CRAN (R 3.6.0)                      
 Rcpp                     1.0.3      2019-11-08 [1] CRAN (R 3.6.0)                      
 RefManageR               1.2.12     2019-04-03 [1] CRAN (R 3.6.0)                      
 remotes                  2.1.0      2019-06-24 [1] CRAN (R 3.6.0)                      
 rlang                    0.4.2      2019-11-23 [1] CRAN (R 3.6.0)                      
 rprojroot                1.3-2      2018-01-03 [1] CRAN (R 3.6.0)                      
 RSQLite                  2.2.0      2020-01-07 [1] CRAN (R 3.6.0)                      
 rstudioapi               0.10       2019-03-19 [1] CRAN (R 3.6.0)                      
 S4Vectors                0.24.1     2019-12-01 [1] Bioconductor                        
 sessioninfo              1.1.1      2018-11-05 [1] CRAN (R 3.6.0)                      
 shiny                    1.4.0      2019-10-10 [1] CRAN (R 3.6.0)                      
 stringi                  1.4.3      2019-03-12 [1] CRAN (R 3.6.0)                      
 stringr                  1.4.0      2019-02-10 [1] CRAN (R 3.6.0)                      
 testthat               * 2.3.1      2019-12-01 [1] CRAN (R 3.6.0)                      
 tibble                   2.1.3      2019-06-06 [1] CRAN (R 3.6.0)                      
 tidyselect               0.2.5      2018-10-11 [1] CRAN (R 3.6.0)                      
 travis                 * 0.3.0.9002 2020-01-17 [1] Github (ropenscilabs/travis@3f4e59d)
 usethis                * 1.5.1      2019-07-04 [1] CRAN (R 3.6.0)                      
 vctrs                    0.2.1      2019-12-17 [1] CRAN (R 3.6.0)                      
 withr                    2.1.2      2018-03-15 [1] CRAN (R 3.6.0)                      
 xml2                     1.2.2      2019-08-09 [1] CRAN (R 3.6.0)                      
 xtable                   1.8-4      2019-04-21 [1] CRAN (R 3.6.0)                      
 yaml                     2.2.0      2018-07-25 [1] CRAN (R 3.6.0)                      
 zeallot                  0.1.0      2018-01-28 [1] CRAN (R 3.6.0)                      

[1] /Library/Frameworks/R.framework/Versions/3.6/Resources/library
@zachcp
Copy link

zachcp commented Jan 19, 2020

@lcolladotor I've just run into the issue and am stuck in the sample place (sshkeys configured and correctly set but build fail). My workaround is to pass TRAVIS_DEPLOY_KEY directly to the deploy_site_github function in your config file as shown below:

deploy:
  provider: script
  script: Rscript -e 'pkgdown::deploy_site_github(ssh_id = Sys.getenv("TRAVIS_DEPLOY_KEY", ""))'
  skip_cleanup: true

lcolladotor added a commit to ComunidadBioInfo/regutools that referenced this issue Jan 19, 2020
@lcolladotor
Copy link
Author

Thanks @zachcp! Your solution worked ^^.

@s-fleck
Copy link

s-fleck commented Feb 5, 2020

Thanks for the workaround, but should this really count as closing the issue? I have the same issue using github/travis and this seems to be the most common use case and should imho be fixed in pkgdown (maybe by looking for the ssh key in several locations by default?).

At least this solution should be documented in ?pkgdown::deploy_site_github and usethis::use_pkgdown_travis IMHO.

lcolladotor added a commit to lcolladotor/pkgdown that referenced this issue Feb 5, 2020
@lcolladotor
Copy link
Author

I submitted #1217 to expand the current documentation. I opted for this instead of changing the default argument values since (a) the default might work for others and (b) the SSH key name might change in the future (maybe it changed elsewhere and we are the first seeing this issue).

@lcolladotor lcolladotor reopened this Feb 5, 2020
@kevinrue
Copy link

kevinrue commented Feb 6, 2020

I finally found this thread after posting on the Travis community site

Thanks for both the workaround and the PR!

kevinrue added a commit to iSEE/iSEE that referenced this issue Feb 6, 2020
kevinrue added a commit to iSEE/iSEE that referenced this issue Feb 6, 2020
@hadley
Copy link
Member

hadley commented Feb 10, 2020

@jimhester would you mind taking a little time to figure out what's going on here?

@jimhester
Copy link
Member

jimhester commented Feb 10, 2020

It seems ropensci-archive/travis#129 changed the travis package to add the deploy key to the TRAVIS_DEPLOY_KEY environment variable. previously the key was added to the id_rsa environment variable, which is what pkgdown::deploy_site_github() is looking for.

We could I guess change pkgdown to look for both locations I guess...

@lcolladotor
Copy link
Author

Thanks for finding the root of this Jim!

In my PR I recommended updating the docs, but I guess that if you have the pkgdown function search for both options that would work too (until someone changes the default name in ropenscilabs/travis again :P

@pat-s
Copy link
Contributor

pat-s commented Feb 11, 2020

There is already backward comp for the old id_rsa default if it exists.

All users starting fresh right now will not get the id_rsa env var unless they use use_travis_deploy(key_name_private = "id_rsa").

As for a solution, you could either check for both locations or change

stop("No deploy key found, please setup with `travis::use_travis_deploy()`", call. = FALSE)

to suggest

stop("No deploy key found, please setup with travis::use_travis_deploy(key_name_private = "id_rsa"), call. = FALSE)

Also I don't think #1217 is a good workaround for this problem.


Sorry for the trouble. We were not aware that this change might cause issues here.
One of the problems if a package is not (yet) on CRAN.

jack89roberts added a commit to alan-turing-institute/network-comparison that referenced this issue Mar 10, 2020
@hadley
Copy link
Member

hadley commented Mar 10, 2020

We now recommend using the github actions workflow instead; which avoids all this configuration pain.

@hadley hadley closed this as completed Mar 10, 2020
kjhealy added a commit to kjhealy/uscenpops that referenced this issue Mar 15, 2020
chacalle added a commit to ihmeuw-demographics/hierarchyUtils that referenced this issue Mar 19, 2020
@ldecicco-USGS
Copy link

Late to the party, I'm trying to figure out what the new GH-action process is. Is there a good reference for how to use the github action workflow (especially helpful would be a reference for people who are comfortable with the "old fashioned" travis workflow).

@jayhesselberth
Copy link
Collaborator

@ldecicco-USGS I recommend using the usethis helper use_tidy_github_actions(). It should setup everything you need.

@ldecicco-USGS
Copy link

Brilliant! That's all I need! I wish I would have asked much...much...sooner :)

lcolladotor added a commit to lcolladotor/biocthis that referenced this issue May 9, 2020
Created both an introductory and a developer's notes vignette, updated README
and docs with examples, added a second biocViews term, fixed some small
bugs/typos.

Related links (as many as I could remember):

* https://rstd.io/tidytools19
* https://twitter.com/CVWickham
* https://twitter.com/hadleywickham
* https://www.rstudio.com/products/rstudio/download
* https://comunidadbioinfo.github.io/post/building-tidy-tools-cdsb-runconf-2019/#.XrbLMxNKiu4
* http://bioconductor.org/
* https://lcolladotor.github.io/pkgs/
* https://stat.ethz.ch/pipermail/bioc-devel/2020-March/016365.html
* https://www.bioconductor.org/help/docker/
* https://stat.ethz.ch/pipermail/bioc-devel/2020-April/016532.html
* https://github.com/features/actions
* https://stat.ethz.ch/pipermail/bioc-devel/2020-April/016650.html
* r-lib/actions#84
* r-lib/usethis#1108
* r-lib/styler#636
* Bioconductor/BiocCheck#57
* Bioconductor/bioconductor.org#54
* http://bioconductor.org/developers/how-to/coding-style/
* https://style.tidyverse.org/
* https://twitter.com/lorenzwalthert
* https://twitter.com/mt_morgan
* https://docs.travis-ci.com/user/languages/r/
* r-lib/pkgdown#1206
* r-lib/pkgdown#1230
* https://twitter.com/jimhester_
* https://www.jimhester.com/talk/2020-rsc-github-actions/
* https://github.com/Bioconductor/BBS
* https://github.com/Bioconductor/packagebuilder
* https://www.appveyor.com/
* r-hub/rhub#52
* r-hub/rhub#38
* https://www.tidyverse.org/blog/2020/04/usethis-1-6-0/
* https://github.com/r-lib/actions/tree/master/examples
* https://yihui.org/en/2018/03/second-pull-request/
* https://github.com/r-lib/actions/blob/master/examples/check-standard.yaml
* https://help.github.com/en/actions
* https://ropenscilabs.github.io/actions_sandbox/
* https://twitter.com/seandavis12
* https://github.com/seandavi/BiocActions/blob/master/.github/workflows/main.yml
* https://twitter.com/CSoneson
* https://github.com/csoneson/dreval/blob/master/.github/workflows/R-CMD-check.yaml
* https://bioc-community.herokuapp.com/
* https://github.com/leekgroup/derfinderPlot/blob/master/.github/workflows/check-bioc.yml
* https://github.com/LieberInstitute/recount3/blob/master/.github/workflows/check-bioc.yml
* https://github.com/hpages
* r-lib/actions#68
* r-lib/actions#85
* https://twitter.com/opencpu
* https://community.rstudio.com/u/const-ae
* https://community.rstudio.com/t/compiler-support-fo-c-14-features-on-windows/57284/4
* r-lib/xml2#296
* r-lib/xml2#302
* https://github.com/r-lib/usethis/blob/master/.github/workflows/R-CMD-check.yaml
* https://github.com/r-lib/usethis/commits/master/.github/workflows/R-CMD-check.yaml
* https://stat.ethz.ch/pipermail/bioc-devel/2020-April/016703.html
* https://stat.ethz.ch/pipermail/bioc-devel/2020-April/thread.html
* r-lib/remotes#296
* r-lib/actions#86
* r-lib/covr#427
* https://github.com/r-lib/actions/blob/master/examples/pr-commands.yaml
* https://www.digitalocean.com/community/tutorials/how-to-install-git-on-ubuntu-18-04
* r-lib/actions#50
* actions/checkout#238
* https://github.com/rocker-org/rocker-versioned2/blob/master/dockerfiles/Dockerfile_rstudio_4.0.0-ubuntu18.04
* https://twitter.com/niteshturaga
* https://twitter.com/cboettig
* rocker-org/rocker-versioned#208
* https://github.community/t5/GitHub-Actions/bd-p/actions
* https://www.r-consortium.org/blog/2020/03/18/cdsb-diversity-and-outreach-hotspot-in-mexico
* https://github.com/maxheld83
* r-lib/actions#87
* https://github.com/yutannihilation
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

9 participants