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

report error traceback when something fails? #191

Closed
kevinushey opened this issue Apr 22, 2019 · 5 comments
Closed

report error traceback when something fails? #191

kevinushey opened this issue Apr 22, 2019 · 5 comments

Comments

@kevinushey
Copy link

Not sure if there's a better way to surface these sorts of errors so they can be better diagnosed. Looks like one line of output was lost in this case.

Screen Shot 2019-04-22 at 2 57 03 PM

@kevinushey
Copy link
Author

Similar, reduced case:

> pak::pkg_install("rmarkdown@1.12")
ℹ Checking for package metadata updates
✔ All 10 metadata files are current.                                                                                                                  
✔ Using session cached package metadata                                                                                                               
✔ Using cached package metadata                                                                                                                       
Error in !version_satisfies(candidate$version, resolution$remote[[1]]$atleast,  : 
  invalid argument type

@hadley
Copy link
Member

hadley commented May 29, 2019

Can we surface the original traceback into the parent process? If not in base R, with rlang?

@jimhester
Copy link
Member

We now have the full traceback, though I am not sure how much it helps for this case...

Rscript -e 'pak::pkg_install("rmarkdown@1.12")'
✔ Loading session disk cached package metadata ... done

Error: <callr_remote_error: invalid argument type>
 in process 65246
-->
<simpleError in !version_satisfies(candidate$version, resolution$remote[[1]]$atleast,     version): invalid argument type>

 Stack trace:

 12. (function (...)  ...
 13. base:::withCallingHandlers(cli_message = function(msg) { ...
 14. get("pkg_install_make_plan", asNamespace("pak"))(...)
 15. prop$solve()
    R/package.R:215:3
 16. private$plan$solve(policy = private$policy)
    R/pkg-installation.R:255:7
 17. pkgdepends:::pkgplan_solve(self, private, match.arg(policy))
    R/pkg-plan.R:32:13
 18. private$create_lp_problem(pkgs, policy)
    R/solve.R:114:3
 19. pkgdepends:::pkgplan__create_lp_problem(self, private, pkgs,  ...
    R/pkg-plan.R:81:25
 20. pkgdepends:::pkgplan_i_create_lp_problem(pkgs, policy)
    R/solve.R:160:3
 21. pkgdepends:::pkgplan_i_lp_satisfy_direct(lp)
    R/solve.R:193:3
 22. base:::lapply(seq_len(lp$num_candidates)[lp$pkgs$direct], satisfy)
    R/solve.R:308:3
 23. pkgdepends:::FUN(X[[i]], ...)
 24. base:::isTRUE(satisfies_remote(res, res2))
    R/solve.R:302:7
 25. pkgdepends:::satisfies_remote(res, res2)
    R/solve.R:302:7
 26. pkgdepends:::sat(resolution, candidate, config, ...)
    R/satisfies.R:8:3
 27. base:::.handleSimpleError(function (e)  ...
    R/type-standard.R:60:3
 28. h(simpleError(msg, call))

 x invalid argument type

Execution halted
``

@gaborcsardi
Copy link
Member

We just need a better error message for the rmarkdown@1.12 ref, which is not yet supported. This belongs to pkgdepends, which parses refs now.

@gaborcsardi gaborcsardi reopened this Aug 18, 2020
@gaborcsardi gaborcsardi transferred this issue from r-lib/pak Aug 18, 2020
@gaborcsardi
Copy link
Member

❯ pak::pkg_install("rmarkdown@1.12")
Error: Cannot install packages:
* rmarkdown@1.12: Versioned CRAN packages are not implemented yet
Type .Last.error.trace to see where the error occurred
❯ Rscript -e 'pak::pkg_install("rmarkdown@1.12")'

Error: <callr_remote_error: Cannot install packages:
* rmarkdown@1.12: Versioned CRAN packages are not implemented yet>
 in process 86334
-->
<simpleError: Cannot install packages:
* rmarkdown@1.12: Versioned CRAN packages are not implemented yet>

 Stack trace:

 12. (function (...)  ...
 13. base:::withCallingHandlers(cli_message = function(msg) { ...
 14. get("pkg_install_make_plan", asNamespace("pak"))(...)
 15. prop$stop_for_solution_error()
 16. private$plan$stop_for_solve_error()
 17. pkgdepends:::pkgplan_stop_for_solve_error(self, private)
 18. base:::stop("Cannot install packages:\n", msg, call. = FALSE)
 19. base:::.handleSimpleError(function (e)  ...
 20. h(simpleError(msg, call))
 21. base:::stop(e)
 22. (function (e)  ...

 x Cannot install packages:
* rmarkdown@1.12: Versioned CRAN packages are not implemented yet

Execution halted

The non-interactive one is still messed up, and the traceback is useless, but at least the error is printed, and we'll improve the traceback in the future.

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

4 participants