pak icon indicating copy to clipboard operation
pak copied to clipboard

Error while creating lockfile not thrown properly

Open gaborcsardi opened this issue 2 years ago • 7 comments

Run r-lib/actions/setup-r-dependencies@v2
Run ## Installing pak
Installing pak
Dependency resolution
  ℹ Creating lockfile '.github/pkg.lock'
  
  ✔ Updated metadata database: 2.88 MB in 7 files.
  
  ℹ Creating lockfile '.github/pkg.lock'
  ℹ Updating metadata database
  
  Error: Error: <rlib_error in throw(cond, parent = e): You can only throw conditions>

one of the log with call stack https://github.com/rstudio/rmarkdown/runs/4815089673?check_suite_focus=true

gaborcsardi avatar Jan 14 '22 10:01 gaborcsardi

Similar crash at https://github.com/hsbadr/HiClimR/runs/4831022375 (error: R session crashed with exit code -9):

  ℹ Creating lockfile '.github/pkg.lock'
  
  ✔ Updated metadata database: 2.87 MB in 7 files.
  
  ℹ Creating lockfile '.github/pkg.lock'
  ℹ Updating metadata database
  <error: R session crashed with exit code -9>
  NULL
  NULL
  
  Error: Error: <error: R session crashed with exit code -9>
  $calls
  $calls[[1]]
  pak::lockfile_create(c("deps::.", "any::sessioninfo", extra_deps), 
      lockfile = ".github/pkg.lock", dependencies = c(needs, ("all")))
  
  $calls[[2]]
  remote(function(...) {
      get("lockfile_create_internal", asNamespace("pak"))(...)
  }, list(pkg = pkg, lockfile = lockfile, lib = lib, upgrade = upgrade, 
      dependencies = dependencies))
  
  $calls[[3]]
  err$throw(res$error)
  
  
  $parents
  [1] 0 1 2
  
  $envs
  $envs[[1]]
  [1] "0x55ccba4c3188"
  
  $envs[[2]]
  [1] "0x55ccba4db590"
  
  $envs[[3]]
  [1] "0x55ccba7cbde0"
  
  
  $topenvs
  $topenvs[[1]]
  [1] "namespace:pak"
  
  $topenvs[[2]]
  [1] "namespace:pak"
  
  $topenvs[[3]]
  [1] "0x55ccba8cf980"
  
  
  $indices
  [1] 1 2 3
  
  $nframes
  [1] 3
  
  $messages
  $messages[[1]]
  [1] "R session crashed with exit code -9"
  
  
  $ignore
  NULL
  
  $classes
  [1] "error"     "condition"
  
  $pids
  [1] 14824 14824 14824
  
  attr(,"class")
  [1] "rlib_trace"
  Execution halted
  Error: Process completed with exit code 1.

hsbadr avatar Jan 16 '22 07:01 hsbadr

I pushed some changed to v2 that seem to fix this: https://github.com/r-lib/actions/issues/483#issuecomment-1013918319

gaborcsardi avatar Jan 16 '22 17:01 gaborcsardi

I pushed some changed to v2 that seem to fix this: r-lib/actions#483 (comment)

Thanks! Will test it.

hsbadr avatar Jan 16 '22 19:01 hsbadr

pkgcache now forces HTTP 1.1 as well, so when that is on CRAN it will solve this issue.

Except for the pre-bundled pak binaries of course. For those (and until pkgcache is on CRAN) the workaround is to force HTTP 1.1 with the env var:

PKGCACHE_HTTP_VERSION=2

(Yes, it HTTP 1.1 corresponds to the value 2.)

gaborcsardi avatar Jan 17 '22 11:01 gaborcsardi

Hi, I am having what I believe it is the same problem here: https://github.com/NINAnor/oneimpact/actions/runs/4790505912/jobs/8519719745

But I am pretty new to continuous integration and using pak in this context, so I am not sure how to set it up even with these hints above... anyone could help? The file that creates that is this one.

bniebuhr avatar Apr 24 '23 20:04 bniebuhr

@bniebuhr Can you try using the suggested syntax? I.e. any::pkgdown and also local::. if you need to install the local package. See https://github.com/r-lib/actions/blob/788d7d59f05b5ac5b9cf4630428a2502514e98fb/examples/pkgdown.yaml#L35

gaborcsardi avatar Apr 24 '23 20:04 gaborcsardi

It worked, thanks!

bniebuhr avatar Apr 25 '23 03:04 bniebuhr