ropensci / tic

Tasks Integrating Continuously: CI-Agnostic Workflow Definitions
https://docs.ropensci.org/tic
154 stars 18 forks source link

Pipeline fails with <simpleError: Cannot install packages: .... values must be length 1, but FUN(X[[1]]) result is length 0> #329

Closed kapsner closed 2 years ago

kapsner commented 2 years ago

For some reason, I lately experience some issues with running github actions with the tic-workflow.

The pipelines for some of my packages (DQAstats, DQAgui, miRacumDQA) fail all with the same issue that occurs when running tic::install: <simpleError: Cannot install packages: .... values must be length 1, but FUN(X[[1]]) result is length 0>

I tried to run tic::install() locally, which results in the very same error, however, I was unable to break down the issue to its origin:

tic::install()
#> [32mℹ[39m Using existing tic stage configuration, use [90m`force = TRUE`[39m to reload
#> ℹ [36mRunning stage 'install': [90mstep_install_deps(dependencies=TRUE)[36m[39m
#> 
#> [34m<callr_error/rlib_error_3_0/rlib_error/error>[39m
#> [1m[33mError[39m[22m: 
#> [33m![39m error in callr subprocess
#> [1mCaused by error[22m: 
#> [33m![39m Cannot install packages:
#> * [1mdeps::/home/user/development/Rpackages/dqa/dqastats[22m: values must be length 1,
#>  but FUN(X[[1]]) result is length 0
#> ---
#> Subprocess backtrace:
#> [90m 1. [39mbase::withCallingHandlers(cli_message = function(msg) { …
#> [90m 2. [39m[1mget[22m[38;2;255;121;198m([38;2;241;250;140m"local_install_dev_deps_make_plan"[39m, [1masNamespace[22m[33m([39m[38;2;241;250;140m"pak"[39m[33m)[39m[38;2;255;121;198m)([39m...[38;2;255;121;198m)[39m
#> [90m 3. [39mprop[38;2;189;147;249m$[39m[1mstop_for_solution_error[22m[38;2;255;121;198m()[39m
#> [90m 4. [39mprivate[38;2;189;147;249m$[39mplan[38;2;189;147;249m$[39m[1mstop_for_solve_error[22m[38;2;255;121;198m()[39m
#> [90m 5. [39mpkgdepends:::[1mpkgplan_stop_for_solve_error[22m[38;2;255;121;198m([39mself, private[38;2;255;121;198m)[39m
#> [90m 6. [39mbase::[1mstop[22m[38;2;255;121;198m([38;2;241;250;140m"Cannot install packages:\n"[39m, msg, call. = [38;2;189;147;249mFALSE[38;2;255;121;198m)[39m
#> [90m 7. | base::.handleSimpleError(function (e) …[39m
#> [90m 8. [39mglobal [1mh[22m[38;2;255;121;198m([39m[1msimpleError[22m[33m([39mmsg, call[33m)[39m[38;2;255;121;198m)[39m
#> [90m 9. [39mbase::[1mstop[22m[38;2;255;121;198m([39me[38;2;255;121;198m)[39m
#> [90m10. [39mglobal (function (e) …
#> <simpleError: Cannot install packages:
#> * [1mdeps::/home/user/development/Rpackages/dqa/dqastats[22m: values must be length 1,
#>  but FUN(X[[1]]) result is length 0>
#> NULL
#> [1m[33mError[39m[22m: 
#> [33m![39m error in callr subprocess
#> [1mCaused by error[22m: 
#> [33m![39m Cannot install packages:
#> * [1mdeps::/home/user/development/Rpackages/dqa/dqastats[22m: values must be length 1,
#>  but FUN(X[[1]]) result is length 0
#> [90mType .Last.error to see the more details.[39m
#> Error: A step failed in stage "install": install.

Any help to resolve this would be highly appreciated! Thanks in advance.

kapsner commented 2 years ago

Ok, the error occurs here: https://github.com/ropensci/tic/blob/main/R/steps-install.R#L20 when running pak::local_install_dev_deps but I do not understand why...

pat-s commented 2 years ago

It might be most likely caused by https://github.com/miracum/dqa-dqastats/blob/025d3b942ccd8e1cb5ce1c407e915cfe06825a4e/DESCRIPTION#L41-L42 which {pak} fails to resolve.

Can you reproduce it locally when running pak::local_install_dev_deps() from the project root? (make sure to remove this dependency beforehand)

kapsner commented 2 years ago

Hi @pat-s , thanks for your quick answer.

You are right - when replacing the remotes url with the github-version, pak::local_install_dev_deps() runs successfully and the tic-workflow works again! (https://github.com/miracum/dqa-dqastats/runs/8203757707?check_suite_focus=true)

So it seems as if the issue is rather related to pak / its dependency pkgdepends as this package does not seem to support all valid formatings of the remotes-section of the description file... (https://cran.r-project.org/web/packages/devtools/vignettes/dependencies.html#other-sources)

pat-s commented 2 years ago

Glad this helped! Jep it might be worth reporting this to pal directly and linking this issue 🙂