epiverse-trace / epichains

[Under active development] Methods for simulating and analysing the sizes and lengths of infectious disease transmission chains from branching process models
https://epiverse-trace.github.io/epichains/
Other
5 stars 2 forks source link

pak caused installation error message #262

Closed avallecam closed 2 months ago

avallecam commented 2 months ago

trying to re-install epichains to test some updates and got error with {pak}, solved with {devtools}, and generated output with gh::gh_rate_limits()

I also report the usethis::git_sitrep() and .Last.error output

Here I paste the outputs:

> pak::pak("epiverse-trace/epichains")
#> Error:                                                                
#> ! error in pak subprocess
#> Caused by error: 
#> ! Could not solve package dependencies:
#> * epiverse-trace/epichains: ! pkgdepends resolution error for epiverse-trace/epichains.
#> Caused by error: 
#> ! Bad GitHub credentials, make sure that your GitHub token is valid.
#> Caused by error in `stop(http_error(resp))`:
#> ! Unauthorized (HTTP 401).
#> Type .Last.error to see the more details.

> devtools::install_github("epiverse-trace/epichains")
#> Downloading GitHub repo epiverse-trace/epichains@HEAD
#> These packages have more recent versions available.
#> It is recommended to update all of them.
#> Which would you like to update?
#> 
#> 1: All                              
#> 2: CRAN packages only               
#> 3: None                             
#> 4: backports (1.4.1 -> 1.5.0) [CRAN]
#> 
#> Enter one or more numbers, or an empty line to skip updates: 2
#> backports (1.4.1 -> 1.5.0) [CRAN]
#> Installing 1 packages: backports
#> Installing package into 'C:/Users/AndreeValleCampos/Documents/0projects/epicatador/renv/library/R-4.3/x86_64-w64-mingw32'
#> (as 'lib' is unspecified)
#> trying URL 'https://packagemanager.posit.co/cran/latest/bin/windows/contrib/4.3/backports_1.5.0.zip'
#> Content type 'binary/octet-stream' length 122005 bytes (119 KB)
#> downloaded 119 KB
#> 
#> package 'backports' successfully unpacked and MD5 sums checked
#> 
#> The downloaded binary packages are in
#>  C:\Users\AndreeValleCampos\AppData\Local\Temp\Rtmp84bXTU\downloaded_packages
#> Registered S3 methods overwritten by 'callr':
#>   method                    from
#>   format.callr_status_error     
#>   print.callr_status_error      
#> ── R CMD build ──────────────────────────────────────────────────────────────────────
#> ✔  checking for file 'C:\Users\AndreeValleCampos\AppData\Local\Temp\Rtmp84bXTU\remotes28d82391169\epiverse-trace-epichains-4375575/DESCRIPTION' (414ms)
#> ─  preparing 'epichains': (1.2s)
#> ✔  checking DESCRIPTION meta-information ...
#> ─  checking for LF line-endings in source and make files and shell scripts (380ms)
#> ─  checking for empty or unneeded directories
#> ─  building 'epichains_0.1.0.tar.gz'
#> 
#> Installing package into 'C:/Users/AndreeValleCampos/Documents/0projects/epicatador/renv/library/R-4.3/x86_64-w64-mingw32'
#> (as 'lib' is unspecified)
#> - One or more packages recorded in the lockfile are not installed.
#> - Use `renv::status()` for more details.
#> * installing *source* package 'epichains' ...
#> ** using staged installation
#> ** R
#> ** data
#> *** moving datasets to lazyload DB
#> ** inst
#> ** byte-compile and prepare package for lazy loading
#> ** help
#> *** installing help indices
#> *** copying figures
#> ** building package indices
#> ** installing vignettes
#> ** testing if installed package can be loaded from temporary location
#> ** testing if installed package can be loaded from final location
#> ** testing if installed package keeps a record of temporary installation path
#> * DONE (epichains)
#> Warning messages:
#> 1: In untar2(tarfile, files, list, exdir, restore_times) :
#>   skipping pax global extended headers
#> 2: In untar2(tarfile, files, list, exdir, restore_times) :
#>   skipping pax global extended headers

> gh::gh_rate_limits()
#>                           type limit used remaining               reset mins_left
#> 1                         core  5000    4      4996 2024-05-30 20:34:37      58.1
#> 2                       search    30    0        30 2024-05-30 19:37:33       1.0
#> 3                      graphql  5000    0      5000 2024-05-30 20:36:33      60.0
#> 4         integration_manifest  5000    0      5000 2024-05-30 20:36:33      60.0
#> 5                source_import   100    0       100 2024-05-30 19:37:33       1.0
#> 6         code_scanning_upload  1000    0      1000 2024-05-30 20:36:33      60.0
#> 7  actions_runner_registration 10000    0     10000 2024-05-30 20:36:33      60.0
#> 8                         scim 15000    0     15000 2024-05-30 20:36:33      60.0
#> 9         dependency_snapshots   100    0       100 2024-05-30 19:37:33       1.0
#> 10                   audit_log  1750    0      1750 2024-05-30 20:36:33      60.0
#> 11                 code_search    10    0        10 2024-05-30 19:37:33       1.0

> usethis::git_sitrep()
#> ── Git global (user) 
#> • Name: 'Andree Valle Campos'
#> • Email: 'avallecam@gmail.com'
#> • Global (user-level) gitignore file: 'C:/Users/AndreeValleCampos/.gitignore'
#> • Vaccinated: TRUE
#> • Default Git protocol: 'https'
#> • Default initial branch name: 'master', 'main'
#> 
#> ── GitHub user 
#> • Default GitHub host: 'https://github.com'
#> • Personal access token for 'https://github.com': '<discovered>'
#> • GitHub user: 'avallecam'
#> • Token scopes: 'gist, repo, user, workflow'
#> • Email(s): 'avallecam@gmail.com (primary)', '11100074@unmsm.edu.pe', 'andree.valle-campos@lshtm.ac.uk'
#> 
#> ── Active usethis project: 'C:/Users/AndreeValleCampos/Documents/0projects/epicatador' ──
#> 
#> ── Git local (project) 
#> • Name: 'Andree Valle Campos'
#> • Email: 'avallecam@gmail.com'
#> • Default branch: 'main'
#> • Current local branch -> remote tracking branch:
#>   'main' -> 'origin/main'
#> 
#> ── GitHub project 
#> • Type = 'ours'
#> • Host = 'https://github.com'
#> • Config supports a pull request = TRUE
#> • origin = 'avallecam/epicatador' (can push)
#> • upstream = <not configured>
#> • Desc = 'origin' is both the source and primary repo.
#> 
#>   Read more about the GitHub remote configurations that usethis supports at:
#>   'https://happygitwithr.com/common-remote-setups.html'

> .Last.error
#> <callr_error/rlib_error_3_0/rlib_error/error>
#> Error: 
#> ! error in pak subprocess
#> Caused by error: 
#> ! Could not solve package dependencies:
#> * epiverse-trace/epichains: ! pkgdepends resolution error for epiverse-trace/epichains.
#> Caused by error: 
#> ! Bad GitHub credentials, make sure that your GitHub token is valid.
#> Caused by error in `stop(http_error(resp))`:
#> ! Unauthorized (HTTP 401).
#> ---
#> Backtrace:
#> 1. pak::pak("epiverse-trace/epichains")
#> 2. pak::pkg_install(pkg, ...)
#> 3. pak:::remote(function(...) get("pkg_install_make_plan", asNamespace("pak"))(...), …
#> 4. err$throw(res$error)
#> ---
#> Subprocess backtrace:
#> 1. base::withCallingHandlers(cli_message = function(msg) { …
#> 2. get("pkg_install_make_plan", asNamespace("pak"))(...)
#> 3. prop$stop_for_solution_error()
#> 4. private$plan$stop_for_solve_error()
#> 5. pkgdepends:::pkgplan_stop_for_solve_error(self, private)
#> 6. base::throw(new_error("Could not solve package dependencies:\n", msg, …
#> 7. | base::signalCondition(cond)
#> 8. global (function (e) …

One day after this issue, pak worked fine.

> pak::pak("epiverse-trace/epichains")
#> ✔ Loading metadata database ... done                                 
#>                                                                            
#> ℹ No downloads are needed
#> ✔ 1 pkg + 2 deps: kept 3 [8.1s]
jamesmbaazam commented 2 months ago

trying to re-install epichains to test some updates and got error with {pak}, solved with {devtools}, and generated output with gh::gh_rate_limits()

I also report the usethis::git_sitrep() and .Last.error output

Here I paste the outputs:

> pak::pak("epiverse-trace/epichains")
#> Error:                                                                
#> ! error in pak subprocess
#> Caused by error: 
#> ! Could not solve package dependencies:
#> * epiverse-trace/epichains: ! pkgdepends resolution error for epiverse-trace/epichains.
#> Caused by error: 
#> ! Bad GitHub credentials, make sure that your GitHub token is valid.
#> Caused by error in `stop(http_error(resp))`:
#> ! Unauthorized (HTTP 401).
#> Type .Last.error to see the more details.

> devtools::install_github("epiverse-trace/epichains")
#> Downloading GitHub repo epiverse-trace/epichains@HEAD
#> These packages have more recent versions available.
#> It is recommended to update all of them.
#> Which would you like to update?
#> 
#> 1: All                              
#> 2: CRAN packages only               
#> 3: None                             
#> 4: backports (1.4.1 -> 1.5.0) [CRAN]
#> 
#> Enter one or more numbers, or an empty line to skip updates: 2
#> backports (1.4.1 -> 1.5.0) [CRAN]
#> Installing 1 packages: backports
#> Installing package into 'C:/Users/AndreeValleCampos/Documents/0projects/epicatador/renv/library/R-4.3/x86_64-w64-mingw32'
#> (as 'lib' is unspecified)
#> trying URL 'https://packagemanager.posit.co/cran/latest/bin/windows/contrib/4.3/backports_1.5.0.zip'
#> Content type 'binary/octet-stream' length 122005 bytes (119 KB)
#> downloaded 119 KB
#> 
#> package 'backports' successfully unpacked and MD5 sums checked
#> 
#> The downloaded binary packages are in
#>    C:\Users\AndreeValleCampos\AppData\Local\Temp\Rtmp84bXTU\downloaded_packages
#> Registered S3 methods overwritten by 'callr':
#>   method                    from
#>   format.callr_status_error     
#>   print.callr_status_error      
#> ── R CMD build ──────────────────────────────────────────────────────────────────────
#> ✔  checking for file 'C:\Users\AndreeValleCampos\AppData\Local\Temp\Rtmp84bXTU\remotes28d82391169\epiverse-trace-epichains-4375575/DESCRIPTION' (414ms)
#> ─  preparing 'epichains': (1.2s)
#> ✔  checking DESCRIPTION meta-information ...
#> ─  checking for LF line-endings in source and make files and shell scripts (380ms)
#> ─  checking for empty or unneeded directories
#> ─  building 'epichains_0.1.0.tar.gz'
#> 
#> Installing package into 'C:/Users/AndreeValleCampos/Documents/0projects/epicatador/renv/library/R-4.3/x86_64-w64-mingw32'
#> (as 'lib' is unspecified)
#> - One or more packages recorded in the lockfile are not installed.
#> - Use `renv::status()` for more details.
#> * installing *source* package 'epichains' ...
#> ** using staged installation
#> ** R
#> ** data
#> *** moving datasets to lazyload DB
#> ** inst
#> ** byte-compile and prepare package for lazy loading
#> ** help
#> *** installing help indices
#> *** copying figures
#> ** building package indices
#> ** installing vignettes
#> ** testing if installed package can be loaded from temporary location
#> ** testing if installed package can be loaded from final location
#> ** testing if installed package keeps a record of temporary installation path
#> * DONE (epichains)
#> Warning messages:
#> 1: In untar2(tarfile, files, list, exdir, restore_times) :
#>   skipping pax global extended headers
#> 2: In untar2(tarfile, files, list, exdir, restore_times) :
#>   skipping pax global extended headers

> gh::gh_rate_limits()
#>                           type limit used remaining               reset mins_left
#> 1                         core  5000    4      4996 2024-05-30 20:34:37      58.1
#> 2                       search    30    0        30 2024-05-30 19:37:33       1.0
#> 3                      graphql  5000    0      5000 2024-05-30 20:36:33      60.0
#> 4         integration_manifest  5000    0      5000 2024-05-30 20:36:33      60.0
#> 5                source_import   100    0       100 2024-05-30 19:37:33       1.0
#> 6         code_scanning_upload  1000    0      1000 2024-05-30 20:36:33      60.0
#> 7  actions_runner_registration 10000    0     10000 2024-05-30 20:36:33      60.0
#> 8                         scim 15000    0     15000 2024-05-30 20:36:33      60.0
#> 9         dependency_snapshots   100    0       100 2024-05-30 19:37:33       1.0
#> 10                   audit_log  1750    0      1750 2024-05-30 20:36:33      60.0
#> 11                 code_search    10    0        10 2024-05-30 19:37:33       1.0

> usethis::git_sitrep()
#> ── Git global (user) 
#> • Name: 'Andree Valle Campos'
#> • Email: 'avallecam@gmail.com'
#> • Global (user-level) gitignore file: 'C:/Users/AndreeValleCampos/.gitignore'
#> • Vaccinated: TRUE
#> • Default Git protocol: 'https'
#> • Default initial branch name: 'master', 'main'
#> 
#> ── GitHub user 
#> • Default GitHub host: 'https://github.com'
#> • Personal access token for 'https://github.com': '<discovered>'
#> • GitHub user: 'avallecam'
#> • Token scopes: 'gist, repo, user, workflow'
#> • Email(s): 'avallecam@gmail.com (primary)', '11100074@unmsm.edu.pe', 'andree.valle-campos@lshtm.ac.uk'
#> 
#> ── Active usethis project: 'C:/Users/AndreeValleCampos/Documents/0projects/epicatador' ──
#> 
#> ── Git local (project) 
#> • Name: 'Andree Valle Campos'
#> • Email: 'avallecam@gmail.com'
#> • Default branch: 'main'
#> • Current local branch -> remote tracking branch:
#>   'main' -> 'origin/main'
#> 
#> ── GitHub project 
#> • Type = 'ours'
#> • Host = 'https://github.com'
#> • Config supports a pull request = TRUE
#> • origin = 'avallecam/epicatador' (can push)
#> • upstream = <not configured>
#> • Desc = 'origin' is both the source and primary repo.
#> 
#>   Read more about the GitHub remote configurations that usethis supports at:
#>   'https://happygitwithr.com/common-remote-setups.html'

> .Last.error
#> <callr_error/rlib_error_3_0/rlib_error/error>
#> Error: 
#> ! error in pak subprocess
#> Caused by error: 
#> ! Could not solve package dependencies:
#> * epiverse-trace/epichains: ! pkgdepends resolution error for epiverse-trace/epichains.
#> Caused by error: 
#> ! Bad GitHub credentials, make sure that your GitHub token is valid.
#> Caused by error in `stop(http_error(resp))`:
#> ! Unauthorized (HTTP 401).
#> ---
#> Backtrace:
#> 1. pak::pak("epiverse-trace/epichains")
#> 2. pak::pkg_install(pkg, ...)
#> 3. pak:::remote(function(...) get("pkg_install_make_plan", asNamespace("pak"))(...), …
#> 4. err$throw(res$error)
#> ---
#> Subprocess backtrace:
#> 1. base::withCallingHandlers(cli_message = function(msg) { …
#> 2. get("pkg_install_make_plan", asNamespace("pak"))(...)
#> 3. prop$stop_for_solution_error()
#> 4. private$plan$stop_for_solve_error()
#> 5. pkgdepends:::pkgplan_stop_for_solve_error(self, private)
#> 6. base::throw(new_error("Could not solve package dependencies:\n", msg, …
#> 7. | base::signalCondition(cond)
#> 8. global (function (e) …

One day after this issue, pak worked fine.

> pak::pak("epiverse-trace/epichains")
#> ✔ Loading metadata database ... done                                 
#>                                                                            
#> ℹ No downloads are needed
#> ✔ 1 pkg + 2 deps: kept 3 [8.1s]

Thanks for reporting this, @avallecam. I think based on the messages from pak, it only "worked" because it actually didn't proceed to install the package since it was already installed.

For now, I will provide an order of installation starting with devtools and then pak.