Volume mapping issue with Zeppelin

Hi,

I am running the following to start a zeppelin container:
docker run -dit --name zep -v /notebook:/opt/zeppelin/notebook -p 8080:8080 apache/zeppelin:0.9.0

However I get the error:

  1. java.io.IOException: Creating directories for /opt/zeppelin/notebook/.git failed
  2. java.lang.IllegalStateException: Unable to perform operation: create on org.apache.zeppelin.notebook.repo.NotebookRepoSync

I only get this error with volume mapping. Has anyone experienced this issue?

Thanks.

The zeppelin user with the id ā€œ1000ā€ needs permission to write the mounted folder. Make sure it can.

I couldnā€™t find the Dockerfile where the userid is set, but this is the last couple of entries from the history:

docker image history apache/zeppelin:0.9.0 --no-trunc --format '{{ .CreatedBy }}' | head -n5
/bin/sh -c #(nop)  CMD ["bin/zeppelin.sh"]
/bin/sh -c #(nop)  WORKDIR /opt/zeppelin
/bin/sh -c #(nop)  ENTRYPOINT ["/usr/bin/tini" "--"]
/bin/sh -c #(nop)  EXPOSE 8080
/bin/sh -c #(nop)  USER 1000

You can also find it on Docker Hub: apache/zeppelin:0.9.0 history

Bonus command to get the last five entries of the history from the oldest to the newest:

nl <(docker image history apache/zeppelin:0.9.0 --no-trunc --format '{{ .CreatedBy }}') | sort -r | cut -f2- | tail -n5
/bin/sh -c #(nop)  USER 1000
/bin/sh -c #(nop)  EXPOSE 8080
/bin/sh -c #(nop)  ENTRYPOINT ["/usr/bin/tini" "--"]
/bin/sh -c #(nop)  WORKDIR /opt/zeppelin
/bin/sh -c #(nop)  CMD ["bin/zeppelin.sh"]

Thank you, I solved this by setting the user to 0 in docker run.

docker run -dit --name zep -p 8080:8080 -u 0 -v $(pwd)/notebook:/opt/zeppelin/notebook apache/zeppelin:0.9.0

1 Like

Now it has write permission because it starts with root user inside the container. Try to avoid that especially when the image has a non-root user by default. Setting permissions is just one command on the host.

sudo chown -R 1000:1000 /notebook

Thanks again! I originally thought the issue is not having permission to write within the container, but now I understand that the zeppelin user is trying to write in the host folder. Another solution that I tried is creating the directory first with the 1000 user on the host before running the command, this worked as well!