Running the below code will sometimes fail and return the attached error message.
webshot2::webshot(url = "~/a_web_page.html", file = "~/an_image.png")
Error in launch_chrome(path, args) :
Failed to start chrome. Error: [1208/102720.412050:ERROR:filesystem_posix.cc(63)] mkdir /tmp/Crashpad/new: Permission denied (13)
[1208/102720.412409:ERROR:socket.cc(120)] recvmsg: Connection reset by peer (104)
Update:
This error can also pop up when rendering an rmarkdown file which includes HTML widgets (e.g. plotly plots) to word output.
The reason is that the underlying
chromote
R package tries to launch chrome vialaunch_chrome()
, which then again attempts to write into the file system at/tmp/Crashpad/new
.If you navigate to the
/tmp/Crashpad/new
directory you will likely see that another user owns this directory. This also means that this problem is probably specific to RStudio Server environments synchonously used by several users. It also explains why the problem does not occur right away. The first person running the code should not run into this Issue. However, everyone thereafter will.One solution for the Problem is to deactivate the crash reporter before you take the screenshot. Of course this means no crash reports.
If you need the crash reports for some reason you can also ask the server admin to appropriately adjust the file system permissions.