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

Publish of rmarkdown documents fails (or document cannot be loaded) #705

Closed
fereshtehRS opened this issue May 23, 2016 · 12 comments
Closed

Comments

@fereshtehRS
Copy link

RStudio IDE 0.99.1189
rmarkdown 0.9.6.9 (from github)

Publish to radixu server or beta server; 2 different behaviours:

1- Static rmarkdown document:
Deployment fails with this error:

2016/05/23 18:29:31.080224611 Error in tools::file_path_as_absolute(output_file) :
2016/05/23 18:29:31.080231689   file '/opt/rstudio-connect/mnt/report/test-rmarkdown-github.html' does not exist
2016/05/23 18:29:31.080241673 Calls: local ... eval -> eval -> do.call -> <Anonymous> -> <Anonymous>
2016/05/23 18:29:31.080305316 In addition: Warning message:
2016/05/23 18:29:31.080456029 In file.rename(pandoc_output_tmp, output) :
2016/05/23 18:29:31.080476812   cannot rename file '/opt/rstudio-connect/mnt/app/pandoc7dcb665f7558.html' to '/opt/rstudio-connect/mnt/report/test-rmarkdown-github.html', reason 'Invalid cross-device link'
2016/05/23 18:29:31.084151982 Execution halted
Document deployment failed with error: exit status 1

2- Shiny Rmarkdown
Deployment is successful, but then loading the document gives this error:

05/23 18:31:46.896Warning in file.rename(pandoc_output_tmp, output) :
05/23 18:31:46.896 cannot rename file '/opt/rstudio-connect/mnt/app/pandoc7ef16193a75e.html' to '/tmp/RtmphOLdFC/file7ef167446add.html', reason 'Invalid cross-device link'
05/23 18:31:46.896Warning in file(con, "r") :
05/23 18:31:46.896 cannot open file '/tmp/RtmphOLdFC/file7ef167446add.html': No such file or directory
05/23 18:31:46.907Warning: Error in file: cannot open the connection
05/23 18:31:46.941Stack trace (innermost first):
@jjallaire
Copy link
Member

This is due to the file.rename introduced in this change: df18647

@kevinushey file.rename doesn't work across volumes and in the case of Connect the output_file is on another volume. Could you revise this to use file.copy when the files aren't in the same exact directory? (it's not enough to check if they are apparently on the same volume as Linux could have volumes mounted anywhere on the filesystem).

@aronatkins

@kevinushey
Copy link
Contributor

Thanks for catching that; I'll make that change.

@kevinushey
Copy link
Contributor

This should hopefully resolve the issue: 0d7143f

We attempt a plain file.rename first; if that fails we fall back to a file.copy. (This does assume that file.rename reports FALSE when the rename fails; which is hopefully the case here)

@kevinushey
Copy link
Contributor

I added a bit more cleanup on master (making sure we remove the temporary file on exit).

@fereshtehRS, can you give current master of rmarkdown a shot and let me know if the issue is resolved?

@aronatkins
Copy link
Contributor

Initial testing from here looks good; I'll let Fereshteh confirm with the original test case.

@fereshtehRS
Copy link
Author

Different error now (for static document):

2016/05/23 20:46:00.286687252 Error in convert(output_file, run_citeproc) :
2016/05/23 20:46:00.286703134   failed to copy rendered pandoc artefact to '/opt/rstudio-connect/mnt/report/testing-5-23.html'
2016/05/23 20:46:00.286715274 Calls: local ... eval -> eval -> eval -> do.call -> <Anonymous> -> convert
2016/05/23 20:46:00.298722461 Execution halted
Document deployment failed with error: exit status 1

@fereshtehRS
Copy link
Author

fereshtehRS commented May 23, 2016

@aronatkins Were you testing this locally or on dogfood?

@fereshtehRS
Copy link
Author

Case 2 (shiny rmarkdown) is working fine now.

@fereshtehRS
Copy link
Author

No more issues with the latest fixes from @kevinushey

@aronatkins
Copy link
Contributor

@kevinushey Any issue with us marking this closed? Was there more work planned? Someone else just hit this and they were unclear about status since the bug was still open.

@kevinushey
Copy link
Contributor

I think this can be closed -- any issues should be resolved as long as users are using the latest version of rmarkdown from GitHub. (sorry for the temporary breakage!)

@github-actions
Copy link

github-actions bot commented Nov 3, 2020

This old thread has been automatically locked. If you think you have found something related to this, please open a new issue by following the issue guide (https://yihui.org/issue/), and link to this old issue if necessary.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Nov 3, 2020
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

4 participants