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

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

Open
ms609 opened this issue Mar 21, 2022 · 7 comments
Labels
bug an unexpected problem or unintended behavior

Comments

@ms609
Copy link
Contributor

@ms609 ms609 commented Mar 21, 2022

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

@ms609 ms609 added the bug an unexpected problem or unintended behavior label Mar 21, 2022
@gaborcsardi
Copy link
Contributor

@gaborcsardi gaborcsardi commented Mar 21, 2022

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
Copy link
Contributor Author

@ms609 ms609 commented Mar 21, 2022

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.)

@gaborcsardi
Copy link
Contributor

@gaborcsardi gaborcsardi commented Mar 21, 2022

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
Copy link
Contributor Author

@ms609 ms609 commented Mar 21, 2022

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.

@gaborcsardi
Copy link
Contributor

@gaborcsardi gaborcsardi commented Mar 21, 2022

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

ms609 pushed a commit to ms609/TreeDist that referenced this issue Mar 21, 2022
@ms609
Copy link
Contributor Author

@ms609 ms609 commented Mar 21, 2022

After removing the Remotes: field, and removing ms609/TreeDistData from the package's Suggests field, and later install 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?

@jpiaskowski
Copy link

@jpiaskowski jpiaskowski commented Jun 3, 2022

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug an unexpected problem or unintended behavior
Projects
None yet
Development

No branches or pull requests

3 participants