Impossible to upload file of more than 1 MB

What app is this about, and its version: Homebox, 0.22.3~ynh1
What YunoHost version are you running: 12.1.39
What type of hardware are you using: VPS bought online

Describe your issue

I there,

I just performed a fresh install of Homebox and I am experimenting with item creation and attachment.

I am encountering a weired error. When I try to upload an attachment to an item which is more than 1MB, I get the following error in the web UI:

Failed to upload attachment

Looking at the logs with journalctl -u homebox -f, I don’t see anything during a failed upload, but I see something if an upload is successful, eg.:

Feb 03 15:09:55 samuel-colin.nohost.me homebox[574]: 3:09PM INF github.com/sysadminsmedia/homebox/backend/internal/web/mid/logger.go:41 > request finished method=PUT path=/api/v1/items/dfe6924a-71aa-478b-ba41-32377322c36e rid=samuel-colin.nohost.me/pr5FfVzo0u-000176 status=200

I inferred that the error happens around the 1MB threshold by trial and error with several PDFs and the results were consistent across several files.

What I tried to do, without success:

  • Adding an environment variable HBOX_WEB_MAX_UPLOAD_SIZE=10 in /var/www/homebox/.env as described in the documentation: https://homebox.software/en/configure/, followed by systemctl restart homebox.service (and even a full server restart)
  • Tried the same with the old env var name HBOX_WEB_MAX_FILE_UPLOAD=10 (see the project issue: https://github.com/sysadminsmedia/homebox/pull/1147)
  • Flattening the PDF: this changed nothing, but increasing compression worked

Any idea how I could debug this further?

Share relevant logs or error messages

No error in yunohost logs

Hello @sssammm

Could you try adding client_max_body_size 20M; to /etc/nginx/conf.d/<your-home-box-domain-tld.d>homebox.conf (or something like that) before the closing bracket and then restart nginx (sudo systemctl restart nginx) ?

2 Likes

Thanks @otm33! It worked like a charm.

What I can’t explain, though, is why it wasn’t already present in the config file. Seems to me that this is indeed pre-configured that way in the app repo:

https://github.com/YunoHost-Apps/homebox_ynh/blob/master/conf/nginx.conf

I opened an issue on the repo to signal this:

https://github.com/YunoHost-Apps/homebox_ynh/issues/9

1 Like

Because I made a pull request yesterday

And it has been merged this morning

1 Like