Git Product home page Git Product logo

Comments (13)

tammoterhark avatar tammoterhark commented on May 30, 2024

Sorry: this was the original code...

print(doc, target = "output/demo-Werkgelukmeter.docx")

from officer.

davidgohel avatar davidgohel commented on May 30, 2024

Could you confirm you can write any other file?

from officer.

tammoterhark avatar tammoterhark commented on May 30, 2024

I can confirm that I can output other files (.png from GGPlot) to that same directory called 'output' (right under the directory that holds the script).

from officer.

davidgohel avatar davidgohel commented on May 30, 2024

Can you try cat("", file = "output/demo-Werkgelukmeter.txt")

from officer.

tammoterhark avatar tammoterhark commented on May 30, 2024

Yes, I did. It creates demo-Werkgelukmeter.txt in output. File length = 0.

from officer.

davidgohel avatar davidgohel commented on May 30, 2024

and can you try that:

pack_folder("output", "test.zip")

from officer.

davidgohel avatar davidgohel commented on May 30, 2024

I got that in zip package source:

https://github.com/gaborcsardi/zip/blob/master/src/rzip.c#L21

I don't think it's about officer but with your settings.

from officer.

tammoterhark avatar tammoterhark commented on May 30, 2024

I gues that you are right, because:

[Tue May 30 16:43:25.839819 2017] [:error] [pid 11318] [client 213.127.237.217:57762] rApache Notice!
Loading required package: officer
Loading required package: magrittr
Loading required package: xlsx
Loading required package: rJava
Loading required package: xlsxjars
Loading required package: limer
Loading required package: ggplot2
Loading required package: mailR
Loading required package: flextable
Saving 178 x 178 mm image
Error in value[3L] :
Could not write '/home/tammo/domains/pcx2tammo.toolsforresearch.com/public_html/project/gw/test.zip' [Can't create zip file entry]
Traceback:
9: stop("Could not write ", shQuote(target), " [", e$message, "]")
8: value[3L]
7: tryCatchOne(expr, names, parentenv, handlers[[1L]])
6: tryCatchList(expr, classes, parentenv, handlers)
5: tryCatch(zip(zipfile = target, files = list.files(all.files = TRUE,
recursive = TRUE)), error = function(e) {
stop("Could not write ", shQuote(target), " [", e$message,
"]")
}, finally = {
setwd(curr_wd)
})
4: pack_folder("output", "test.zip")
3: eval(expr, envir, enclos)
2: eval(exprs[i], envir)
1: sys.source(file = "/home/tammo/domains/pcx2tammo.toolsforresearch.com/private_html/project/gw/wgofficer.R",
envir = .rAenv)

from officer.

tammoterhark avatar tammoterhark commented on May 30, 2024

Thank you very much for helping me trouble shoot this! I will go on..

from officer.

Jan-E avatar Jan-E commented on May 30, 2024

Hi David,

I don't think it's about officer but with your settings.

Tammo's business-partner here. I had a hard time troubleshooting this one. I first made sure everything was running with the same user:group. That took some juggling with mod_ruid2.so (under Directadmin).

But even then we were running into the same error. It worked in RStudio, it worked in plain R, but it failed in (R)Apache. A PHP-script running on the same spot with the same user:group did not fail.

In the end I removed the call to the zip package and replaced it with a crude system call to /usr/bin/zip. The change is here: toolsforresearch@3e2c49e

For the moment this is working in our case. Tammo switched back from ReporteRs (which had no problems with creating a zip- or docx-file) to toolsforresearch/officer

from officer.

Jan-E avatar Jan-E commented on May 30, 2024

Tammo did an upgrade by using
devtools::install_github("davidgohel/officer")
and stumbled into the same error.

So I had to fix it once again:
devtools::install_github("toolsforresearch/officer")

Please review #36

from officer.

davidgohel avatar davidgohel commented on May 30, 2024

Seriously?

OK, glad we can use that tone! It sometimes difficult to answer politely.

I could not reproduce the problem. I used opencpu that is using rapache and no issue occured. That's why I did not comment, your issue is not reproducible for now.

I had to fix it again

From my point of view, I have to take free time again to try to solve your specific issue that is not reproducible. Also, why spending time on officer while your issue is with function zip which is not in officer package. You could instead fix the zip package?

Please review and merge this PR or find a more suitable solution.

The PR you submited is only working on your system and will break many other systems - what do you propose to solve the issue you are introducing for Window/linux/mac users that don't have program zip in their path? Of I see "merge or find a more suitable solution"... smart, very smart!

Please, if you want to submit a PR, be sure:

  • it will not break anything
  • it does not reverse something that has already be changed (I guess you did not ask yourself the question why the zip package was used instead of zip function of R)
  • do not be gross and do not give order to people that work for you for free

To reproduce the issue, I will have to create a new Linux machine, learn about rapache and test officer in it. As I can only work on that during free time and as there is no contract between us, you will have to wait.

from officer.

github-actions avatar github-actions commented on May 30, 2024

This old thread has been automatically locked. If you think you have found something related to this, please open a new issue and link to this old issue if necessary.

from officer.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.