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

Crashing when updating list of addins #124

Closed
daattali opened this issue Mar 31, 2021 · 22 comments
Closed

Crashing when updating list of addins #124

daattali opened this issue Mar 31, 2021 · 22 comments

Comments

@daattali
Copy link
Owner

Reported by @jeam-github in #123

Looks like I have a similar problem. I've installed and am trying to use the addinslist addin within RStudio but encounter an error on selecting addinslist from the Addins menu in RStudio:
Loading required package: shiny

Listening on http://127.0.0.1:6507
pandoc: ~/Library/Application Support/addinsrepo/addins.md: openBinaryFile: does not exist (No such file or directory)
Warning: Error in : pandoc document conversion failed with error 1
  57: stop
  56: rmarkdown::pandoc_convert
  55: update_addins_file
  54: update_addins_list
  53: update_addins_list_values
  52: refresh_list
  51:
  49: server
Error : pandoc document conversion failed with error 1

This suggests to me that the markup file being produced cannot be found by pandoc. I can see what I think is the generated markup file in question at:
/Users/jim/Library/Application Support/addinsrepo/addins.md  

If my assumption above is correct, how do I go about fixing this so that pandoc finds the file to display?
@daattali
Copy link
Owner Author

@jeam-github the file path is created by the {rappdirs} package directly as you can see here.

Can you try running rappdirs::user_data_dir("addinsrepo", "daattali") on your machine and see what it returns, if it's "~" or "/Users/jim"? Similarly, try just running rappdirs::user_data_dir("test"). It'll be very strange if for most people on Mac it returns the expanded version but for you it's not.

@jeam-github
Copy link

jeam-github commented Mar 31, 2021 via email

@daattali
Copy link
Owner Author

What version of mac do you have? I'm surprised at this inconsistency, reported it to {rappdirs} r-lib/rappdirs#37

Does it seem like pandoc is failing to read the file because of "~"? If you manually run rmarkdown::pandoc_convert("/Users/jim/Library/Application Support/addinsrepo/addins.md", to = "html") does that work? But running rmarkdown::pandoc_convert("~/Library/Application Support/addinsrepo/addins.md", to = "html") fails? Can you confirm the output of path.expand("~")?

@jeam-github
Copy link

jeam-github commented Mar 31, 2021 via email

@daattali
Copy link
Owner Author

Interesting. This seems like a bug in rmarkdown::pandoc_convert. Can you please help me with the following so that I can open an accurate bug report on {rmarkdown}:

  • Confirm that path.expand("~") == "/Users/jim"
  • Create a file at "~/test.md" that contains the text # test
  • Confirm that rmarkdown::pandoc_convert("/Users/jim/test.md", to = "html") works
  • Confirm that rmarkdown::pandoc_convert("~/test.md", to = "html") results in an error (please copy the error)

Thanks!

@jeam-github
Copy link

jeam-github commented Mar 31, 2021 via email

@daattali
Copy link
Owner Author

Can you see whether the addins.md file that the original error complained about exists? If so, try runing the pandoc_convert function on that file, both using the expanded path and using the ~ path. This will help narrow down where the problem is.

@jeam-github
Copy link

jeam-github commented Mar 31, 2021 via email

@daattali
Copy link
Owner Author

daattali commented Apr 1, 2021

OK, I cannot reproduce this behaviour so you'll need to do some troubleshooting on your own and submit a bug report to {rmarkdown}.

You've verified that (a) the file /Users/jim/Library/Application Support/addinsrepo/addins.md exists, (b) pandoc_convert on that file works, (c) pandoc_convert on the same file but with ~ doesn't work. That alone can be used to open an issue in their repo.

But it would be more useful if you can track it down some more. For example, we've already tried backtracking a few steps and we saw that the problem does not happen when you create a file at /Users/jim/test.md. So you should try creating another file /Users/jim/Library/Application Support/addinsrepo/test.md and see if that also fails with . If so, then try creating a file under /Users/jim/Library/Application Support/test.md and under /Users/jim/Library/test.md to see if one of those break. Maybe the issue is when there is tilde () expansion combined with a folder name that contains a space in it for example? It's very difficult for me to try to debug this without access to your machine but this is the sort of steps I would take.

Please link to this issue in the rmarkdown issue you open so that we'll know when it's addressed!

@jeam-github
Copy link

jeam-github commented Apr 1, 2021 via email

@jeam-github
Copy link

jeam-github commented Apr 1, 2021 via email

@daattali
Copy link
Owner Author

daattali commented Apr 1, 2021

Reported to rstudio/rmarkdown#2089

@daattali
Copy link
Owner Author

daattali commented Apr 1, 2021

@jeam-github I applied a fix. Since I wasn't able to reproduce the issue, I cannot test if it works or not. Can you please re install this package from github (remotes::install_github("daattali/addinslist")) and verify that it works now

@jeam-github
Copy link

jeam-github commented Apr 1, 2021 via email

@daattali
Copy link
Owner Author

daattali commented Apr 1, 2021

The issue that we discovered, the one that I reported to rmarkdown.

@jeam-github
Copy link

jeam-github commented Apr 1, 2021 via email

@sbalci
Copy link
Contributor

sbalci commented Apr 30, 2021

Hi,

I am also experiencing same error on MacOS Catalina.

> addinslist:::addinslistAddin()

Listening on http://127.0.0.1:5873
pandoc: ~/Library/Application Support/addinsrepo/addins.md: openBinaryFile: does not exist (No such file or directory)
Warning: Error in : pandoc document conversion failed with error 1
  57: stop
  56: rmarkdown::pandoc_convert
  55: update_addins_file
  54: update_addins_list
  53: update_addins_list_values
  52: refresh_list
  51: <Anonymous>
  49: server
Error : pandoc document conversion failed with error 1

@daattali
Copy link
Owner Author

did you install the latest version of addinslist from github?

@sbalci
Copy link
Contributor

sbalci commented Apr 30, 2021

Hi, after restarting RStudio it worked. Thank you.

@bgwilli3
Copy link

Had the same issye as sbalc. Installing the lastest version of addinlist from github also worked. Thanks!!

@espinielli
Copy link
Contributor

Same problem here using the version on CRAN.
After installing the latest version on github the problem disappears.

@daattali
Copy link
Owner Author

I'll update the package on CRAN today so that this fix will be around for everyone

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

5 participants