r-lib/actions

Encountering `callr_remote_error: subscript out of bounds` when loading remote package from GitHub

ms609 opened this issue · 9 comments

ms609 commented

Describe the bug
I'm encountering subscript out of bounds in a number of contexts.

I'm using the same GHA workflow in two packages: one works fine; the other doesn't.

To Reproduce

When I include Remotes: ms609/TreeTools in the DESCRIPTION file, I see
** <simpleError in candidate$extra[[1]][["remotesha"]]: subscript out of bounds>**
https://github.com/ms609/TreeDist/runs/5625463370?check_suite_focus=true

Removing the Remotes field cleared this error up (log), but introduced another: the Suggested package "TreeDistData" is not available on CRAN so could not be loaded.

Adding extra-packages: ms609/TreeDistData to the workflow .yml file gives again:
<simpleError in candidate$extra[[1]][["remotesha"]]: subscript out of bounds>
https://github.com/ms609/TreeDist/runs/5626075561?check_suite_focus=true

If I avoid loading the GitHub packages with extra-packages: TreeDistData=?ignore-before-r=99.0.0 then I see
<simpleError in done[[i]]: subscript out of bounds>
https://github.com/ms609/TreeDist/runs/5626339625?check_suite_focus=true

Expected behaviour
Packages linked should be installed from GitHub as specified, without error, and the run should continue

This is a bug in pak. Will fix soon, I'll let you know here.

A workaround is to remove Remotes temporarily and install TreeTools manually after the rest is installed:

       - name: Install TreeTools
         run: pak::pkg_install("ms609/TreeTools")
         shell: Rscript {0}
ms609 commented

Thanks, I'd been able to simply remove the Remotes: field (as the necessary version of TreeTools is now on CRAN).

However, I still encounter the simpleError in done[[i]]: error message, even if I install "pak" and "ms609/TreeDistData" manually before the setup-r-dependencies@v2 step (log).

(Possibly this error is unrelated to the remote package, installed via an entry in the Additional_repositories DESCRIPTION field? But I can't see why else it would fail with this package but not others.)

Can you try my suggestion above? I.e. putting that step after the setup-r-dependencies@v2 step? Does that not work?

We do not support the Additional_repositories field currently, so it is ignored completely.

ms609 commented

Putting it after setup-r-dependencies@v2 is no good, as the error occurs within the setup-r-dependencies@v2 step, so the run fails before it can reach subsequent blocks.

Even if you remove Remotes? (You might need to remove TreeDistData as well, or put that in Remotes instead of ms609/TreeTools.)

ms609 commented

After removing the Remotes: field, and removing ms609/TreeDistData from the package's Suggests field, and later installing it manually, the workflow completes successfully.

Not sure whether I've followed the thread – will the latter part of this work-around also be redundant once the update to pak alluded to above is available?

I've encountered the same error. I tried the suggested workaround, but it did not work. Here's a snippet from my workflow:

      - uses: r-lib/actions/setup-r-dependencies@v2
        with:
          extra-packages: any::pkgdown, glmmADMB=?ignore, local::.  
          needs: website
      
      - name: install glmmADMB
        run: install.packages("glmmADMB", repos=c("http://glmmadmb.r-forge.r-project.org/repos", getOption("repos")), type="source")
        shell: Rscript {0}

The workflow step "install glmmADMB" is not reached because the previous step "/setup-r-dependencies@v2" is not able to complete due to encountering the error. Here is the relevant log file.

The original problem does not seem to exist any more, at least having

Remotes:
  ms609/TreeTools,
  ms609/TreeDistData

work well. for me now:
https://github.com/gaborcsardi/TreeDist/actions/runs/8064913085

Please reopen or open a new issue if you still have this problem. Thanks!

This issue has been automatically locked. If you believe you have found a related problem, please file a new issue and include a link to this issue