Cannot export user data from local account in Docker instance #1007

Closed
opened 2021-10-17 21:45:26 +00:00 by Sabinno · 5 comments

Version: 0.18.1 (:latest on Docker Hub)
Platform: CentOS 8 latest
API and Frontend run in Docker
Contents of api/v1/info:

{
  "version": "v0.18.1",
  "frontend_url": "https://vikunja.argonaut.network/",
  "motd": "",
  "link_sharing_enabled": true,
  "max_file_size": "20MB",
  "registration_enabled": false,
  "available_migrators": [
    "vikunja-file"
  ],
  "task_attachments_enabled": true,
  "enabled_background_providers": null,
  "totp_enabled": true,
  "legal": {
    "imprint_url": "",
    "privacy_policy_url": ""
  },
  "caldav_enabled": true,
  "auth": {
    "local": {
      "enabled": true
    },
    "openid_connect": {
      "enabled": true,
      "redirect_url": "https://vikunja.argonaut.network/auth/openid/",
      "providers": [
        {
          "name": "Argonaut Network",
          "key": "argonautnetwork",
          "auth_url": "https://keycloak.argonaut.network/auth/realms/argonaut-network/protocol/openid-connect/auth",
          "client_id": "vikunja"
        }
      ]
    }
  },
  "email_reminders_enabled": true,
  "user_deletion_enabled": true
}

When exporting my data from my local account in a docker instance, I get the following lines in console from the API container:

2021-10-17T21:08:37.538200925Z: WEB 	▶ 108.162.237.209  POST 200 /api/v1/user/export/request 110.713438ms - Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:93.0) Gecko/20100101 Firefox/93.0,
2021-10-17T21:08:38.596180103Z: ERROR	▶ events/func1 1fc Error while handling message 3b309bba-3b06-4f57-8bc0-b4763f8e2b60, handler_poisoned=user.export.requested.handle.user.data.export, subscriber_poisoned=gochannel.GoChannel, reason_poisoned=mkdir files/user-export-tmp/: permission denied, topic_poisoned=user.export.requested,  payload={"User":{"id":1,"name":"","username":"Sabinno","created":"2020-09-01T19:59:47-04:00","updated":"2021-07-24T22:36:30-04:00"}},
2021-10-17T21:08:37.544866705Z: ERROR	▶ [EVENTS] 1e6 Error occurred, retrying: mkdir files/user-export-tmp/: permission denied, wait_time=6.03891ms, elapsed_time=6.245625ms, retry_no=1, max_retries=5,
2021-10-17T21:08:37.565179252Z: ERROR	▶ [EVENTS] 1ea Error occurred, retrying: mkdir files/user-export-tmp/: permission denied, retry_no=2, max_retries=5, wait_time=19.451743ms, elapsed_time=26.578107ms,
2021-10-17T21:08:37.785638499Z: ERROR	▶ [EVENTS] 1ee Error occurred, retrying: mkdir files/user-export-tmp/: permission denied, retry_no=3, max_retries=5, wait_time=219.470422ms, elapsed_time=247.036535ms,
2021-10-17T21:08:37.825045646Z: ERROR	▶ [EVENTS] 1f2 Error occurred, retrying: mkdir files/user-export-tmp/: permission denied, retry_no=4, max_retries=5, wait_time=38.696685ms, elapsed_time=286.444554ms,
2021-10-17T21:08:38.596080124Z: ERROR	▶ [EVENTS] 1f6 Error occurred, retrying: mkdir files/user-export-tmp/: permission denied, retry_no=5, max_retries=5, wait_time=770.219358ms, elapsed_time=1.057478382s

This seems like a bug, but if there's something I can do to fix this myself, please let me know.

Version: 0.18.1 (:latest on Docker Hub) Platform: CentOS 8 latest API and Frontend run in Docker Contents of `api/v1/info`: ``` { "version": "v0.18.1", "frontend_url": "https://vikunja.argonaut.network/", "motd": "", "link_sharing_enabled": true, "max_file_size": "20MB", "registration_enabled": false, "available_migrators": [ "vikunja-file" ], "task_attachments_enabled": true, "enabled_background_providers": null, "totp_enabled": true, "legal": { "imprint_url": "", "privacy_policy_url": "" }, "caldav_enabled": true, "auth": { "local": { "enabled": true }, "openid_connect": { "enabled": true, "redirect_url": "https://vikunja.argonaut.network/auth/openid/", "providers": [ { "name": "Argonaut Network", "key": "argonautnetwork", "auth_url": "https://keycloak.argonaut.network/auth/realms/argonaut-network/protocol/openid-connect/auth", "client_id": "vikunja" } ] } }, "email_reminders_enabled": true, "user_deletion_enabled": true } ``` When exporting my data from my local account in a docker instance, I get the following lines in console from the API container: ``` 2021-10-17T21:08:37.538200925Z: WEB ▶ 108.162.237.209 POST 200 /api/v1/user/export/request 110.713438ms - Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:93.0) Gecko/20100101 Firefox/93.0, 2021-10-17T21:08:38.596180103Z: ERROR ▶ events/func1 1fc Error while handling message 3b309bba-3b06-4f57-8bc0-b4763f8e2b60, handler_poisoned=user.export.requested.handle.user.data.export, subscriber_poisoned=gochannel.GoChannel, reason_poisoned=mkdir files/user-export-tmp/: permission denied, topic_poisoned=user.export.requested, payload={"User":{"id":1,"name":"","username":"Sabinno","created":"2020-09-01T19:59:47-04:00","updated":"2021-07-24T22:36:30-04:00"}}, 2021-10-17T21:08:37.544866705Z: ERROR ▶ [EVENTS] 1e6 Error occurred, retrying: mkdir files/user-export-tmp/: permission denied, wait_time=6.03891ms, elapsed_time=6.245625ms, retry_no=1, max_retries=5, 2021-10-17T21:08:37.565179252Z: ERROR ▶ [EVENTS] 1ea Error occurred, retrying: mkdir files/user-export-tmp/: permission denied, retry_no=2, max_retries=5, wait_time=19.451743ms, elapsed_time=26.578107ms, 2021-10-17T21:08:37.785638499Z: ERROR ▶ [EVENTS] 1ee Error occurred, retrying: mkdir files/user-export-tmp/: permission denied, retry_no=3, max_retries=5, wait_time=219.470422ms, elapsed_time=247.036535ms, 2021-10-17T21:08:37.825045646Z: ERROR ▶ [EVENTS] 1f2 Error occurred, retrying: mkdir files/user-export-tmp/: permission denied, retry_no=4, max_retries=5, wait_time=38.696685ms, elapsed_time=286.444554ms, 2021-10-17T21:08:38.596080124Z: ERROR ▶ [EVENTS] 1f6 Error occurred, retrying: mkdir files/user-export-tmp/: permission denied, retry_no=5, max_retries=5, wait_time=770.219358ms, elapsed_time=1.057478382s ``` This seems like a bug, but if there's something I can do to fix this myself, please let me know.
Owner

Does the user running vikunja have access to the files folder?

Does the user running vikunja have access to the files folder?
Sabinno reopened this issue 2021-10-17 21:50:14 +00:00
Author

Oops. Clicked the wrong button. I hate phoneposting. I'll check and get back with you.

Oops. Clicked the wrong button. I hate phoneposting. I'll check and get back with you.
Author

I removed the files directory and allowed Vikunja to recreate it by itself again to be sure, so it definitely should have access to it.

Here's the volumes section of my docker-compose.yml:

    volumes: 
      # Files dir
      - /var/lib/vikunja/files:/app/vikunja/files
      # config.yml dir
      - /etc/vikunja:/etc/vikunja:ro

Does anything seem obviously incorrect?

I removed the `files` directory and allowed Vikunja to recreate it by itself again to be sure, so it definitely *should* have access to it. Here's the `volumes` section of my `docker-compose.yml`: ``` volumes: # Files dir - /var/lib/vikunja/files:/app/vikunja/files # config.yml dir - /etc/vikunja:/etc/vikunja:ro ``` Does anything seem obviously incorrect?
Author

I did some more digging and discovered that the internal vikunja user in the container cannot create dirs in files. I have no clue why that is by default; still feels like a bug. That said, I fixed the issue myself by logging in to the container as root, chowning files to the vikunja user, then doing the export again.

I did some more digging and discovered that the internal `vikunja` user in the container cannot create dirs in `files`. I have no clue why that is by default; still feels like a bug. That said, I fixed the issue myself by logging in to the container as root, `chown`ing `files` to the `vikunja` user, then doing the export again.
Owner

Maybe that was an issue with the user running Vikunja not having the rights to create file in that directory. By default that's 1000:1000 but you can change that. If you don't specify it when starting a comtainer, I think docker will create all mounts as the root user which then will lead to permission errors if you don't correct it afterwards.

Closing as resolved, feel free to reopen if you have any other issues.

Maybe that was an issue with the user running Vikunja not having the rights to create file in that directory. By default that's 1000:1000 but you can [change that](https://vikunja.io/docs/install-backend/#setting-user-and-group-id-of-the-user-running-vikunja). If you don't specify it when starting a comtainer, I think docker will create all mounts as the root user which then will lead to permission errors if you don't correct it afterwards. Closing as resolved, feel free to reopen if you have any other issues.
Sign in to join this conversation.
No Milestone
No Assignees
2 Participants
Notifications
Due Date
The due date is invalid or out of range. Please use the format 'yyyy-mm-dd'.

No due date set.

Dependencies

No dependencies set.

Reference: vikunja/vikunja#1007
No description provided.