system call to external applications like LibreOffice fails to write files when called by server

,

I previously (setting A) had shiny server (Shiny Server v1.5.20.1002, Node.js v16.18.1) installed on Ubuntu 22.04.4 LTS and LibreOffice 24.2.5.2 d6e8b0f3fc6e8af2b00cf4969fd0d2fa45b9a62e (snap version) and newly (setting B) work on Ubuntu 24.04 LTS (GNU/Linux 6.8.0-38-generic x86_64) with LibreOffice 24.2.5.2 420(Build:2) and Shiny Server v1.5.22.1017, Node.js v18.18.2.
For working with Excel-Sheets generated by another program, I have to convert the files in order to have the formulaes evaluated. For this I use the converter in LibreOffice like this:

system(paste0('libreoffice --headless --convert-to csv:"Text - txt - csv (StarCalc)":44,34,ANSI,1,,0,false,true,false,false,false,', grep("Auswertung", getSheetNames("./data/raw/Auswertung.xlsx")), " --outdir ./data/clean ./data/raw/Auswertung.xlsx"), intern = T)

In setting A this works perfectly, also by calling the app from outside R via the web based interface (i.e. shiyn server running).

Within setting B this does not work. First of all I managed to add the library path

LD_LIBRARY_PATH = "/usr/lib/libreoffice/program:$LD_LIBRARY_PATH"

to the file /usr/lib/R/etc/ldpaths as suggested here in order to get a simple call as system("libreoffice --version", intern = T) from R to be evaluated correctly as user shiny.

Still I have the problem that above conversion does not work, since the thile is not written to the shiny home directory, whereas all other stuff works fine within /home/shiny. And also working on the server itself as user shiny seems to manage the above call perfectly. Only while running in server mode things seem to be somethow different...

Are there any suggestions, where to let LibreOffice save the file instead as a workaround or do I miss something else?

Update: let libreoffice write to a temporary directory works - so it obviously has insufficient permissions for writing in shiny's home directory in the state of being called in server mode. I checked permissions with chmod, which seem to be the same in settings A & B: drwxrwxr-x 5 shiny shiny

This topic was automatically closed 90 days after the last reply. New replies are no longer allowed.

If you have a query related to it or one of the replies, start a new topic and refer back with a link.