-
-
Notifications
You must be signed in to change notification settings - Fork 13.9k
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
gotenberg fails because LibreOffice tries to write temp file to / #349123
Comments
I used this config to hook paperless up to tika and gotenberg: services.paperless = {
enable = true;
consumptionDir = "/my-paperless-inbox";
consumptionDirIsPublic = true;
settings = {
PAPERLESS_CONSUMER_RECURSIVE = true;
PAPERLESS_OCR_LANGUAGE = "deu+eng";
PAPERLESS_TIKA_ENABLED = "1";
PAPERLESS_TIKA_GOTENBERG_ENDPOINT = "http://localhost:${toString config.services.gotenberg.port}";
PAPERLESS_TIKA_ENDPOINT = "http://${config.services.tika.listenAddress}:${toString config.services.tika.port}";
};
}; |
I suspect that
|
Can you try running with the following configuration added? systemd.services.gotenberg.serviceConfig = {
WorkingDirectory = "/run/gotenberg";
RuntimeDirectory = "gotenberg";
}; |
@pyrox0 Hm, it still doesn't work. Your change is effective:
but the error is now:
So your I think this is the code: if (aSecurity.getHomeDir(strURLDirectory))
osl::File::getSystemPathFromFileURL(strURLDirectory, strDirectory);
for (int i = strDirectory.isEmpty() ? 1 : 0; i < 2; ++i)
{
if (strDirectory.isEmpty())
strDirectory = "/tmp";
strDirectory += "/.execoooXXXXXX";
OString aTmpName = OUStringToOString(strDirectory, osl_getThreadTextEncoding());
std::unique_ptr<char[]> tmpfname(new char[aTmpName.getLength()+1]);
strncpy(tmpfname.get(), aTmpName.getStr(), aTmpName.getLength()+1);
// coverity[secure_temp] - https://communities.coverity.com/thread/3179
if ((block.fd = mkstemp(tmpfname.get())) == -1)
fprintf(stderr, "mkstemp(\"%s\") failed: %s\n", tmpfname.get(), strerror(errno)); So apparently Then |
hmmm, maybe libreoffice needs a set home directory as well?(thinking about that based on the code above) try adding the following to the Environment = {
HOME = "/run/gotenberg";
}; |
That code seems to eventually check the Adding it with
Next failure:
Syscall 92 is Interestingly, in strace it shows it as
where the return value is the system call number Adding systemd.services.gotenberg.serviceConfig.SystemCallFilter = lib.mkAfter ["@chown"]; seems to fix that. But we continue with more errors -- see follow-up post. Not sure
|
@pyrox0 BTW the best would of course be if we could add this whole integration to the NixOS VM test, and assert there that it correctly processes a simple |
Agreed, though I'm not sure the best way to do so. We'd need to create test files or something, and they would need to be added to nixpkgs(unless there's a libreoffice test data derivation made that fetches from a git repo or something similar), and I'm hesitant to do so. |
Next error I'm facing:
In this case in the strace the Checking now if increasing |
@pyrox0 That should be no problem at all. We just add an XLS file containing |
Does removing |
I'm aware of what we could do, my issue is with the constantly bloating size of the nixpkgs tarball. Anything that we add, no matter if it's used or not, is downloaded by every consumer of nixpkgs. Therefore putting testing data inside nixpkgs is not something I see as a good thing. |
I agree on the general idea of keeping downloads small, but the size is negligible versus the positive impact of automatic testing. A gzip'd empty The time saved across users from automatic testing has a huge impact in turn. That said, we can also |
Yes, adding the Of course this type of lockdown can also have some benefits, but it's unfortunately always a tradeoff as opposed to a straight win of more "informed" approaches (e.g. an app |
@pyrox0 I got it to work now with My full config that works: services.paperless = {
enable = true;
consumptionDir = "/heimserver/paperless-inbox";
consumptionDirIsPublic = true;
settings = {
PAPERLESS_CONSUMER_RECURSIVE = true;
PAPERLESS_OCR_LANGUAGE = "deu+eng";
PAPERLESS_TIKA_ENABLED = "1";
PAPERLESS_TIKA_GOTENBERG_ENDPOINT = "http://localhost:${toString config.services.gotenberg.port}";
PAPERLESS_TIKA_ENDPOINT = "http://${config.services.tika.listenAddress}:${toString config.services.tika.port}";
};
};
services.tika = {
enable = true;
package = unstable.tika; # TODO: Remove with NixOS >= 24.11
};
services.gotenberg = {
enable = true;
package = unstable.gotenberg; # TODO: Remove with NixOS >= 24.11
timeout = 300;
};
systemd.services.gotenberg.environment = {
HOME = "/run/gotenberg";
};
systemd.services.gotenberg.serviceConfig = {
SystemCallFilter = lib.mkAfter ["@chown"]; # TODO remove when fixed
WorkingDirectory = "/run/gotenberg";
RuntimeDirectory = "gotenberg";
}; |
Another thing that's currently bad with the server:
That sleep seems to apply only to the We should try to make it so that it stops without timeout if the queue is empty. Edit: Filed as gotenberg/gotenberg#1022 |
I'm not sure how we would check the queue is empty, I think that would require a custom program or script of some sort. You could alternatively set |
@pyrox0 I suspect that |
I also filed this feature request: |
For
paperless-ngx
, I'm trying to integrate it with the newly addedtika
andgotenberg
services to index office documents (Word, Excel, etc).However, upon my
.xls
gotenborg
invokessoffice
which crashes with SIGABRT (C++ exception, likely).Some logs:
Unfortunately it discards all stderr to
/dev/null
, as I discovered withstrace
:It tries to write a temp file to
//.execooo1nQd8n
.Probably somewhere some temp dir didn't get set correctly, so it tries to write to
/
.CC @pyrox0 from #326372
The text was updated successfully, but these errors were encountered: