daattali/addinslist

Crashing when updating list of addins

Closed this issue · 22 comments

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?

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

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("~")?

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!

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.

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

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

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

did you install the latest version of addinslist from github?

Hi, after restarting RStudio it worked. Thank you.

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

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

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