Skip to content
This repository has been archived by the owner on Jul 17, 2023. It is now read-only.

Call to confl_create_post_from_Rmd (not interactive) returns browser error #104

Open
benrodriguezitx opened this issue Apr 13, 2020 · 7 comments

Comments

@benrodriguezitx
Copy link

benrodriguezitx commented Apr 13, 2020

When I call confl_create_post_from_Rmd(interactive=F) from a terminal R session, I receive the following error.

Error in browseURL(result_url) : 
  'browser' must be a non-empty character string

The function works when I call it from the command line in R studio, opening a browser with the created page. But this is a behavior I do not need or want in "Batch Use". I want to create large numbers of pages without R attempting to open a browser to them.
I troubleshooted in two ways.
First, I tried setting the environmental variable R_BROWSER=FALSE in my .Rprofile (to suppress showing URLs altogether).
Second, I commented out #readLines(paste0(output_file, "_result_url"), warn = FALSE) in the function and had it return a number. This produced another error message.
I think the issue is the render function in rmarkdown.

Can I use this function or your package to create / publish pages without R trying to open the page in a browser?

@yutannihilation
Copy link
Contributor

yutannihilation commented Apr 13, 2020

had it return a number. This produced another error message.
I think the issue is the render function in rmarkdown.

Hmm, curious. Are you sure you can use bare rmarkdown::render() on your terminal session?

@benrodriguezitx
Copy link
Author

@yutannihilation , no I am not sure. I don't have prior experience authoring in rmarkdown.
I only tried calling render() directly in RStudio when I was testing confl's functionality for confluence_document with YAML front matter. My notes say "but it wants an output URL or starts up shiny app in order to publish. This behavior is not mentioned on the conflr wiki page."

@benrodriguezitx
Copy link
Author

@yutannihilation , yes it can. I just called render from console to create an html document of the test.Rmd file I had posted successfully to Confluence.

@yutannihilation
Copy link
Contributor

Thanks for confirming, then something seems wrong in our custom format...

https://github.com/line/conflr/blob/master/R/document.R

Does it succeed to call conflr::confl_get_current_user() on terminal?

@benrodriguezitx
Copy link
Author

Yes, I can call confl_get_current_user() on terminal. It returns a list of ~ 15 elements, including an acct id and my email.

@benrodriguezitx
Copy link
Author

@yutannihilation , I just determined that despite returning the browserURL error, the confl_create_post_from_Rmd() call from R console session did successfully create its test confluence page. I had not refreshed my confluence browser enough to notice. I was in the mindset that if the function returned an error, it automatically failed.

@yutannihilation
Copy link
Contributor

I still have no idea what happens on your terminal, but the information is really helpful. Thanks!

Yes, I can call confl_get_current_user() on terminal

Then, it seems there's no problem about the authentication. Hmm...

did successfully create its test confluence page.

Do you mean that the page is published successfully and what fails is just launching the web browser? Or, do you see a blank page?

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants