Unable to add attachments (no errors)

Hi,

First time using this app (so glad to have found it) and using it via Docker. I used both the docker method with nginx proxying to the API according to your docs, and also without (but using my external nginx as proxy) and both ways I am unable to include attachments, but there are no errors.

It doesn’t give an error, so my question is what can I do troubleshoot this to know what I might have done wrong? I don’t see errors in the logs when trying to attach something, just that it doesn’t attache.

Surely it’s something on my end, perhaps permissions or something else? I’m not sure how else to troubleshot this to find where the problem is.

Thanks!

What exactly did you try? Can you share a screen recording? There should be an error somewhere.

I tried again, but on another host as I am somewhere else at the moment but this time I spotted the error in the logs:

004, client: 192.168.0.100, server: , request: “PUT /api/v1/tasks/1/attachments HTTP/1.1”, host: “debby:8099”, referrer: “http://debby:8099/tasks/1
vikunja-api-1 | 2023-02-23T15:43:38.866588407Z: ERROR :arrow_forward: v1/UploadTaskAttachment 17b open files/1: permission denied

In this case, do I need to change the local permissions or remap the UID/GID?

The user running the Vikunja API needs to be able to write in the files folder (or volume, if you’re running with docker). With docker, there are options to change that user’s uid / gid at runtime: Install Backend | Vikunja

Awesome, I wasn’t aware of that until now, thank you!

https://vikunja.io/docs/install-backend/#setting-user-and-group-id-of-the-user-running-vikunja
Looks like this is 404 not found now.

I’m personally dealing with this issue as well, and using docker.

What is needed for attachments to work?

I’ve set up the following settings, but this doesn’t appear to work:
PUID: 99
PGID: 100
UMASK: 0000

Also, I’m running Vikujna on Unraid through Docker if that makes any difference.

EDIT: I figured this out:

Vikunja runs as user 1000 and no group by default. You can use Docker’s --user flag to change that.

You must ensure Vikunja is able to write into the files directory. To do this, create the folder and chown it before starting the stack:

mkdir $PWD/files
chown 1000 $PWD/files

You’ll need to do this before running any of the examples on this page.

Vikunja will not try to acquire ownership of the files folder, as that would mean it had to run as root.