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

Build fails at creating vignette #4

Closed
TheoPannetier opened this issue Apr 26, 2020 · 17 comments
Closed

Build fails at creating vignette #4

TheoPannetier opened this issue Apr 26, 2020 · 17 comments

Comments

@TheoPannetier
Copy link
Collaborator

I got this error trying to build on either develop or master on unix.
Do you have the same issue on windows?

─ installing the package to build vignettes E creating vignettes (6.5s) --- re-building ‘demo.Rmd’ using rmarkdown createTcpServer: address already in use Quitting from lines 32-40 (demo.Rmd) Error: processing vignette 'demo.Rmd' failed with diagnostics: Can't get Google credentials. Are you running googledrive in a non-interactive session? Consider: * drive_deauth()to prevent the attempt to get credentials. * Calldrive_auth()` directly with all necessary specifics.

--- failed re-building ‘demo.Rmd’

--- re-building ‘pocket_demo.Rmd’ using rmarkdown
Quitting from lines 24-55 (pocket_demo.Rmd)
Error: processing vignette 'pocket_demo.Rmd' failed with diagnostics:
there is no package called 'sls'
--- failed re-building ‘pocket_demo.Rmd’

SUMMARY: processing the following files failed:
‘demo.Rmd’ ‘pocket_demo.Rmd’

Error: Vignette re-building failed.
Execution halted
Warning message:
Disconnecting from unused ssh session. Please use ssh_disconnect()

Error: System command 'R' failed, exit status: 1, stdout + stderr:
E> * checking for file ‘/Users/theo/Github/jap/DESCRIPTION’ ... OK
E> * preparing ‘jap’:
E> * checking DESCRIPTION meta-information ... OK
E> * installing the package to build vignettes
E> * creating vignettes ... ERROR
E> --- re-building ‘demo.Rmd’ using rmarkdown
E> createTcpServer: address already in use
E> Quitting from lines 32-40 (demo.Rmd)
E> Error: processing vignette 'demo.Rmd' failed with diagnostics:
E> Can't get Google credentials.
E> Are you running googledrive in a non-interactive session? Consider:
E> * drive_deauth() to prevent the attempt to get credentials.
E> * Call drive_auth() directly with all necessary specifics.
E>
E> --- failed re-building ‘demo.Rmd’
E>
E> --- re-building ‘pocket_demo.Rmd’ using rmarkdown
E> Quitting from lines 24-55 (pocket_demo.Rmd)
E> Error: processing vignette 'pocket_demo.Rmd' failed with diagnostics:
E> there is no package called 'sls'
E> --- failed re-building ‘pocket_demo.Rmd’
E>
E> SUMMARY: processing the following files failed:
E> ‘demo.Rmd’ ‘pocket_demo.Rmd’
E>
E> Error: Vignette re-building failed.
E> Execution halted
E> Warning message:
E> Disconnecting from unused ssh session. Please use ssh_disconnect()
E>

Stack trace:

  1. devtools::check(, check_dir = dirname(getwd()))
  2. withr::with_envvar(pkgbuild::compiler_flags(FALSE), action = "prefix", ...
  3. base:::force(code)
  4. pkgbuild::build(pkg$path, tempdir(), args = build_args, quiet = quiet, ...
  5. withr::with_temp_libpaths(rcmd_build_tools(options$cmd, c(options$path, ...
  6. base:::force(code)
  7. pkgbuild:::rcmd_build_tools(options$cmd, c(options$path, options$args), ...
  8. pkgbuild:::with_build_tools(callr::rcmd_safe(..., env = env, ...
  9. callr::rcmd_safe(..., env = env, spinner = FALSE, show = FALSE, ...
  10. callr:::run_r(options)
  11. base:::with(options, with_envvar(env, do.call(processx::run, ...
  12. base:::with.default(options, with_envvar(env, do.call(processx::run, ...
  13. base:::eval(substitute(expr), data, enclos = parent.frame())
  14. base:::eval(substitute(expr), data, enclos = parent.frame())
  15. callr:::with_envvar(env, do.call(processx::run, c(list(bin, args = real_cmd ...
  16. base:::force(code)
  17. base:::do.call(processx::run, c(list(bin, args = real_cmdargs, ...
  18. (function (command = NULL, args = character(), error_on_status = TRUE, ...
  19. throw(new_process_error(res, call = sys.call(), echo = echo, ...

x System command 'R' failed, exit status: 1, stdout + stderr:
E> * checking for file ‘/Users/theo/Github/jap/DESCRIPTION’ ... OK
E> * preparing ‘jap’:
E> * checking DESCRIPTION meta-information ... OK
E> * installing the package to build vignettes
E> * creating vignettes ... ERROR
E> --- re-building ‘demo.Rmd’ using rmarkdown
E> createTcpServer: address already in use
E> Quitting from lines 32-40 (demo.Rmd)
E> Error: processing vignette 'demo.Rmd' failed with diagnostics:
E> Can't get Google credentials.
E> Are you running googledrive in a non-interactive session? Consider:
E> * drive_deauth() to prevent the attempt to get credentials.
E> * Call drive_auth() directly with all necessary specifics.
E>
E> --- failed re-building ‘demo.Rmd’
E>
E> --- re-building ‘pocket_demo.Rmd’ using rmarkdown
E> Quitting from lines 24-55 (pocket_demo.Rmd)
E> Error: processing vignette 'pocket_demo.Rmd' failed with diagnostics:
E> there is no package called 'sls'
E> --- failed re-building ‘pocket_demo.Rmd’
E>
E> SUMMARY: processing the following files failed:
E> ‘demo.Rmd’ ‘pocket_demo.Rmd’
E>
E> Error: Vignette re-building failed.
E> Execution halted
E> Warning message:
E> Disconnecting from unused ssh session. Please use ssh_disconnect()
E>

Execution halted

Exited with status 1.
`

@TheoPannetier
Copy link
Collaborator Author

Ok the issue is with handling authorisations or credentials through package googledrive

> googledrive::drive_ls()
createTcpServer: address already in use
Error: Can't get Google credentials.
Are you running googledrive in a non-interactive session? Consider:
  * `drive_deauth()` to prevent the attempt to get credentials.
  * Call `drive_auth()` directly with all necessary specifics.

@Giappo
Copy link
Owner

Giappo commented Apr 26, 2020

Exactly. I am not getting this error because the first time I run something involving googledrive it was in an interactive session, where a chrome sheet opens and you can give the authorisation. Once you have done it everything should be working fine.
Maybe it could be a good idea to write an inizialization function to run in an interactive session as soon as one uses the package for the first time. When run they will be able to get authorised with their drive account and with the cluster...

@Giappo
Copy link
Owner

Giappo commented Apr 26, 2020

@TheoPannetier does it work after you get the authorisation from an interactive session?

@TheoPannetier
Copy link
Collaborator Author

No, I'm not sure what is going wrong there.
I'm actually running from an interactive session, but calling any of the googledrive functions returns the error and doesn't trigger any interaction

@TheoPannetier
Copy link
Collaborator Author

TheoPannetier commented Apr 26, 2020

I love irony

> googledrive::drive_auth()
createTcpServer: address already in use
Error: Can't get Google credentials.
Are you running googledrive in a non-interactive session? Consider:
  * `drive_deauth()` to prevent the attempt to get credentials.
  * Call `drive_auth()` directly with all necessary specifics.

@TheoPannetier
Copy link
Collaborator Author

Fixed: to trigger the interactive commands I just needed to supply non-default values to the arguments of googledrive::drive_auth()

googledrive::drive_auth(
  email = "[email protected]",
  cache = TRUE,
  use_oob = TRUE
)

That sent me to the authorization request page of Google Drive and gave me the required password after confirmation.

@TheoPannetier
Copy link
Collaborator Author

I think it's worth including some doc for users explaining shortly how to set googledrive up, what output they can expect, how it roughly works, etc.

@Neves-P
Copy link
Collaborator

Neves-P commented Apr 26, 2020

If I might chime in: do we really need the vignettes to build properly in R check? I suspect this is happening because the environment in R check is more restrictive handling temporary files and connections than interactive sessions. For the record, the vignette doesn't build in R check for me locally but it does build in an interactive session, and there it fails because of the SSH connection fails somehow in check.

If we really want the vignettes to build properly then this is a problem, but if they're to work as an example core repository perhaps this isn't so much of an issue. An alternative would be making a folder with this code and taking it from the vignettes. I think I recall there are also demos, but they're not recommended if I remember well.

In any case, good to hear it's working properly, @TheoPannetier. googledrive is temperamental, for me it doesn't work because I have too many files stored there for instance, but there doesn't seem to be an easy workaround for that.

@TheoPannetier
Copy link
Collaborator Author

You're definitely welcome to chime in 👍

I don't see how one would expect the vignette to build when installed by a new user, for whom the drive authorizations are not set up. I think it would be a lot simpler to turn eval=FALSE in the vignette, and just describe what the code blocks do.

Is the googledrive feature entirely optional for the package? If yes, this is not so much of an issue, users can just turn it off?

@Giappo
Copy link
Owner

Giappo commented Apr 26, 2020

@TheoPannetier I think you are right. That vignette has never been meant to build as an html file. It's just a guided scripts that people can run step by step to understand how functions work.

Giappo added a commit that referenced this issue Apr 26, 2020
@TheoPannetier TheoPannetier reopened this Apr 27, 2020
@TheoPannetier
Copy link
Collaborator Author

Vignette creation still fails because of Google API shenanigans

E> Error: processing vignette 'demo.Rmd' failed with diagnostics:
E> !anyDuplicated(nodes$id) is not TRUE

This is apparently a common error, see tidyverse/googledrive#279
I will try with the dev version of googledrive.

@TheoPannetier
Copy link
Collaborator Author

@Giappo you could just turn off code blocks eval, then build the html and the code displayed in code blocks could still serve as guided scripts even if they're not actually run 😉
That way users could access the vignette through vignette(), without having to clone the repo

TheoPannetier pushed a commit that referenced this issue Apr 27, 2020
@TheoPannetier
Copy link
Collaborator Author

Ok, great news, it works!
Jenny Bryan has included a fix to that error on master.
I will add a note to the vignette that googledrive should be installed from GitHub, not CRAN.

@Neves-P
Copy link
Collaborator

Neves-P commented Apr 27, 2020

I made it so that googledrive always installs from github now 👍 Could you check if this solved the issue on a fresh install?

@TheoPannetier
Copy link
Collaborator Author

Brilliant, thanks!
I don't know how to make a "fresh" install, if I just call devtools::install(".") I don't think it re-installs the dependencies right?

@Neves-P
Copy link
Collaborator

Neves-P commented Apr 27, 2020

if I just call devtools::install(".") I don't think it re-installs the dependencies right?

Hmm, indeed it seems like it doesn't, leaving the other option wiping the library folder and starting over (which I think is too much hassle for the gain).

I propose we wait until one of the other lab members uses the package to see what they run into, if there are no problems, we're good to go, otherwise it might be worth looking into.

Great job simplifying the first user setup and vignette, guys!

@TheoPannetier
Copy link
Collaborator Author

Let's assume the issue solved, until proven wrong.

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

3 participants