Docker Community Forums

Share and learn in the Docker community.

Docker noob asking for help: EACCES: permission denied, mkdir '/home/wiki'

After updating my WikiJS docker container I suddenly get presented with this error on the logs of the container:

EACCES: permission denied, mkdir ‘/home/wiki’
This happens with pretty much anything related to the wiki application i’m using.

I’m pretty sure the solution is to chmod 777 a certain directory but for the love of god I have no idea where this is. The user ID in my container = 1000 but it doesn’t seem to have the correct permissions anymore after I updated the wikijs imaage
.
All github pages and posts seem to point at the same thing but I can’t figure out where this directory is. Can’t find it in the container or on the attached volume. I have no clue where this is located
Been stuck for a good 6 hours so all help is much appreciated!

Ubuntu 20.04 LTS
WikiJS
Using Docker Compose

in case it helps, here’s my docker compose file

version: "3"
services:

  db:
    image: postgres:11-alpine
    environment:
      POSTGRES_DB: wiki
      POSTGRES_PASSWORD: nodetails
      POSTGRES_USER: nodetails
      driver: "none"
    restart: unless-stopped
    volumes:
      - db-data:/var/lib/postgresql/data

  wiki:
    image: requarks/wiki:2
    depends_on:
      - db
    environment:
      DB_TYPE: postgres
      DB_HOST: db
      DB_PORT: 5432
      DB_USER: nodetails
      DB_PASS: nodetails
      DB_NAME: wiki
    restart: unless-stopped
    ports:
      - "3000:3000"

volumes:
  db-data:
  
networks:
    web:
      external: true
    wiki-js_default:
      external: false

It seems very clear that it want to create the /home/wiki folder in the container without having permission to do it in /home. Since the user in the container is UID 1000, it will not have permission to create new home fodlers. You could solve this error by creating it but the question is why it wants to do that. Will it try to do it every time you recreate the container? Probably yes.

I would check the settings in the database. If the old version used that home but the new version did not change that setting during the upgrade, it will continue to try creating that folder.

If you can’t find the cause, you can try to mount a host fodler to /home/wiki with UID 1000 as the owner

sudo chown 1000:1000 ./home

and see what happens.

Also read the upgrade instructions in the documentation:

If your old version was 1.0 it could be important:

DO NOT upgrade from 1.0.x using these instructions! Use the Migrate from Wiki.js v1.x instructions instead. These instructions are for 2.x installations.

1 Like

You made me realise it was trying to create the wiki folder, where I was LOOKING for the folder. I should learn to take a break from problems when I’ve been trying for to long. Truth be told, no idea how I didn’t notice this but thank you for solving my problem. all is fine now!