pkgdepends icon indicating copy to clipboard operation
pkgdepends copied to clipboard

"internal error in pkgdepends"

Open RobLBaker opened this issue 8 months ago • 1 comments

Hello,

upon trying to use pak::pkg_install I got this error message, which state to report the error here:

pak::pkg_install("nationalparkservice/NPSdataverse")
#> ℹ Loading metadata database
#> ✔ Loading metadata database ... done
#> 
#> 
#> → Will install 4 packages.
#> → Will download 4 packages with unknown size.
#> + DPchecker      1.0.0 [bld][cmp][dl] (GitHub: 395992f)
#> + EMLeditor      0.1.6 [bld][cmp][dl] (GitHub: 9a59ee3)
#> + NPSdataverse   0.1.0 [bld][cmp][dl] (GitHub: 4ef90b5)
#> + NPSutils       1.0.0 [bld][cmp][dl] (GitHub: 4fb0bb3)
#> ℹ Getting 4 pkgs with unknown sizes
#> ✔ Cached copy of NPSdataverse 0.1.0 (source) is the latest build
#> ✔ Cached copy of DPchecker 1.0.0 (source) is the latest build
#> ✔ Cached copy of EMLeditor 0.1.6 (source) is the latest build
#> ✔ Cached copy of NPSutils 1.0.0 (source) is the latest build
#> Error: ! error in pak subprocess
#> Caused by error in `select_next_task(state)`:
#> ! Cannot select new package installation task.
#> ℹ 4 packages still waiting to install: NPSdataverse, DPchecker, EMLeditor, and
#>   NPSutils.
#> ℹ This is an internal error in pkgdepends, please report an issue at
#>   <https://github.com/r-lib/pkgdepends/issues>.

RobLBaker avatar Mar 11 '25 19:03 RobLBaker

I think this is a circular dependency between DPchecker and EMLeditor.

The error message should be better, though.

gaborcsardi avatar Mar 11 '25 19:03 gaborcsardi

I ran into a similar issue with circular dependencies. Is this supposed to fail because of the circle @gaborcsardi? Or is it a bug?

I created dummy packages to test and report, then I found this issue. Here are the links to the dummy packages:

pak::pkg_install("mrcaseb/issuepkgA")
#> 
#> → Will install 2 packages.
#> → All 2 packages (0 B) are cached.
#> + issuepkgA   0.0.0.9000 👷🏼‍♂️🔧 (GitHub: 97552bf)
#> + issuepkgB   0.0.0.9000 👷🏼‍♀️🔧 (GitHub: 621cfe3)
#> ℹ No downloads are needed, 2 pkgs are cached
#> Error: ! error in pak subprocess
#> Caused by error in `select_next_task(state)`:
#> ! Cannot select new package installation task.
#> ℹ 2 packages still waiting to install: issuepkgA and issuepkgB.
#> ℹ This is an internal error in pkgdepends, please report an issue at
#>   <https://github.com/r-lib/pkgdepends/issues>.

Created on 2025-08-18 with reprex v2.1.1

mrcaseb avatar Aug 18 '25 14:08 mrcaseb

Yes, ideally it would be a better error message, but it is possible to install packages with circular dependencies in R, so this is not going to work, possibly ever.

gaborcsardi avatar Aug 18 '25 18:08 gaborcsardi

Got the same error. Good to know it's circular dependency. I will check for that, but would be nice for that to be noted in the error.

katrinabrock avatar Sep 01 '25 11:09 katrinabrock

Same here, with jmbr. I'll watch out for circular dependencies.

https://github.com/poissonconsulting/jmbr/actions/runs/19088545687/job/54534041811#step:7:8887

ℹ Packaging pkgdown 2.1.3.9000
  ✔ Packaged pkgdown 2.1.3.9000 (5.5s)
  ℹ Building pkgdown 2.1.3.9000
  ✔ Built pkgdown 2.1.3.9000 (4.4s)
  ✔ Installed pkgdown 2.1.3.9000 (github::r-lib/pkgdown@79d540b) (1s)
  ✔ Installed sessioninfo 1.2.3  (21ms)
  ✔ Installed rcmdcheck 1.4.0  (1s)
  ✔ Installed decor 1.0.2  (1s)
  Error: 
  ! error in pak subprocess
  Caused by error in `select_next_task(state)`:
  ! Cannot select new package installation task.
  ℹ 1 package still waiting to install: quarto.
  ℹ This is an internal error in pkgdepends, please report an issue at
    <[https://github.com/r-lib/pkgdepends/issues](https://github.com/r-lib/pkgdepends/issues?q=sort%3Aupdated-desc+is%3Aissue+is%3Aopen)>.
  ---
  Backtrace:
  1. pak::lockfile_install(".github/pkg.lock")
  2. pak:::remote(function(...) { …
  3. err$throw(res$error)
  ---
  Subprocess backtrace:
  1. base::withCallingHandlers(cli_message = function(msg) { …
  2. get("lockfile_install_internal", asNamespace("pak"))(...)
  3. plan$install()
  4. pkgdepends::install_package_plan(plan, lib = private$library, num_workers = nw, …
  5. base::withCallingHandlers({ …
  6. pkgdepends:::select_next_task(state)
  7. base::throw(pkg_error("Cannot select new package installation task.", …
  8. | base::signalCondition(cond)
  9. global (function (e) …
  Execution halted
  Error: Process completed with exit code 1.

krlmlr avatar Nov 05 '25 16:11 krlmlr