New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

mesh.lock could not be writen on OpenShift #506

MehrCurry opened this Issue Oct 2, 2018 · 3 comments


None yet
2 participants

MehrCurry commented Oct 2, 2018

Gentics Mesh Version, operating system, or hardware.

  • v0.24.0

Operating System

  • Openshift


  • from the Docker Image


In Openshift any Pod runs with a random user id. So writing mesh.lock during startup fails

02:09:55.921 [Veiled Pupitar] INFO  [main] - Could not find keystore {config/keystore.jceks}. Creating one for you..
  | 02:09:55.981 [Veiled Pupitar] INFO  [main] - Keystore {config/keystore.jceks} created. The keystore password is listed in your {mesh.yml} file.
  | Exception in thread "main" Permission denied
  | at Method)
  | at
  | at com.gentics.mesh.cli.MeshImpl.createLockFile(
  | at
  | at
  | at com.gentics.mesh.server.ServerRunner.main(
  | 02:09:55.984 [Veiled Pupitar] INFO  [Thread-0] - Mesh shutting down...
  | Error while shutting down mesh.
  | java.lang.NullPointerException
  | at com.gentics.mesh.cli.MeshImpl.shutdown(
  | at com.gentics.mesh.cli.MeshImpl.lambda$registerShutdownHook$2(
  | at

/data, /config, /elasticsearch and /tmp (via MESH_TEMP_DIR) is writable via emptyDir volumes.

But mesh still tries to write /mesh/mesh.lock which is not possible.


oc new-app gentics/mesh

Expected behaviour and actual behaviour

It should be written to MESH_TEMP_DIR by default IMHO

Is there any undocumented env var for setting the lock file location?


This comment has been minimized.


Jotschi commented Oct 2, 2018

Thanks for the issue. The path to every file, folder that is managed by Gentics Mesh should be configurable. I'll try to squeeze the change into the next 0.24.x release. There is currently no setting for this. The path to the lock file is always relative to the current working directory.

@Jotschi Jotschi added the enhancement label Oct 2, 2018

@Jotschi Jotschi self-assigned this Oct 2, 2018


This comment has been minimized.

MehrCurry commented Oct 2, 2018

I solved the problem on my own by writting a new Dockerfile which is more suitable for Openshift

FROM openjdk:8

RUN useradd -ms /bin/bash mesh

RUN mkdir /mesh && chown mesh /mesh

ADD mesh-server-0.24.0.jar /opt/mesh/mesh.jar

VOLUME /mesh

USER mesh    


ENTRYPOINT [ "java", "-jar", "/opt/mesh/mesh.jar" ]

The trick is to move everything out of the working directory so that we can bind-mount an emptyDir volume in OpenShift which makes it writable.

Anyway MESH_LOCK_PATH solves the problem also.

@Jotschi Jotschi closed this in dba2cb1 Oct 3, 2018


This comment has been minimized.


Jotschi commented Oct 5, 2018

The setting has been released with 0.24.1

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment