Exception in thread "main" java.lang.RuntimeException: Failed to reset file system
<p>I am trying to deploy sonarqube on OpenShift using docker file , Build is working , after deployment , I am seeing error.</p>

<pre><code>2016.08.30 10:06:42 INFO  app[o.s.a.AppFileSystem] Cleaning or creating temp directory /opt/sonarqube/temp
Exception in thread "main" java.lang.RuntimeException: Failed to reset file system
    at org.sonar.process.monitor.Monitor.resetFileSystem(Monitor.java:127)
    at org.sonar.process.monitor.Monitor.startProcesses(Monitor.java:107)
    at org.sonar.process.monitor.Monitor.start(Monitor.java:101)
    at org.sonar.application.App.start(App.java:54)
    at org.sonar.application.App.main(App.java:141)
Caused by: java.nio.file.AccessDeniedException: /opt/sonarqube/temp/README.txt
    at sun.nio.fs.UnixException.translateToIOException(UnixException.java:84)
    at sun.nio.fs.UnixException.rethrowAsIOException(UnixException.java:102)
    at sun.nio.fs.UnixException.rethrowAsIOException(UnixException.java:107)
    at sun.nio.fs.UnixFileSystemProvider.implDelete(UnixFileSystemProvider.java:244)
    at sun.nio.fs.AbstractFileSystemProvider.delete(AbstractFileSystemProvider.java:103)
    at java.nio.file.Files.delete(Files.java:1126)
    at org.sonar.application.AppFileSystem$CleanTempDirFileVisitor.visitFile(AppFileSystem.java:149)
    at org.sonar.application.AppFileSystem$CleanTempDirFileVisitor.visitFile(AppFileSystem.java:130)
    at java.nio.file.Files.walkFileTree(Files.java:2670)
    at org.sonar.application.AppFileSystem.createOrCleanTempDirectory(AppFileSystem.java:126)
    at org.sonar.application.AppFileSystem.reset(AppFileSystem.java:83)
    at org.sonar.process.monitor.Monitor.resetFileSystem(Monitor.java:124)
    ... 4 more
</code></pre>

<p>my docker file looks like - </p>

<pre><code> FROM rhel7:latest

MAINTAINER Naveen Kumar02 &lt;na&gt;

RUN set -x \
    &amp;&amp; yum -y install tar unzip \
    &amp;&amp; yum -y update \
    &amp;&amp; yum -y clean all 

ENV SONAR_VERSION=6.0 \
    SONARQUBE_HOME=/opt/sonarqube \
    # Database configuration
    # Defaults to using H2
    SONARQUBE_JDBC_USERNAME=sonar \
    SONARQUBE_JDBC_PASSWORD=sonar \
    SONARQUBE_JDBC_URL=
#java
ENV JAVA_HOME /opt/java
ENV JAVA_VERSION_MAJOR 8
ENV JAVA_VERSION_MINOR 102
ENV JAVA_VERSION_BUILD 14

RUN mkdir -p /opt \
  &amp;&amp; curl --fail --silent --location --retry 3 \
  --header "Cookie: oraclelicense=accept-securebackup-cookie; " \
  http://download.oracle.com/otn-pub/java/jdk/${JAVA_VERSION_MAJOR}u${JAVA_VERSION_MINOR}-b${JAVA_VERSION_BUILD}/server-jre-${JAVA_VERSION_MAJOR}u${JAVA_VERSION_MINOR}-linux-x64.tar.gz \
  | gunzip \
  | tar -x -C /opt \
  &amp;&amp; ln -s /opt/jdk1.${JAVA_VERSION_MAJOR}.0_${JAVA_VERSION_MINOR} ${JAVA_HOME}


# Http port
EXPOSE 9000

RUN set -x \

    # see https://bugs.debian.org/812708
    # and https://github.com/SonarSource/docker-sonarqube/pull/18#issuecomment-194045499
    &amp;&amp; cd /tmp \
    &amp;&amp; cd /opt \
    &amp;&amp; curl -o sonarqube.zip -fSL https://sonarsource.bintray.com/Distribution/sonarqube/sonarqube-$SONAR_VERSION.zip \
#    &amp;&amp; curl -o sonarqube.zip.asc -fSL https://sonarsource.bintray.com/Distribution/sonarqube/sonarqube-$SONAR_VERSION.zip.asc \
#    &amp;&amp; gpg --batch --verify sonarqube.zip.asc sonarqube.zip \
    &amp;&amp; unzip sonarqube.zip \
    &amp;&amp; mv sonarqube-$SONAR_VERSION sonarqube \
    &amp;&amp; rm sonarqube.zip* \
    &amp;&amp; rm -rf $SONARQUBE_HOME/bin/*

RUN echo "-Djava.awt.headless=true" &gt;&gt; /opt/sonarqube/conf/wrapper.conf
RUN echo "-Djava.io.tmpdir=/tmp" &gt;&gt; /opt/sonarqube/conf/wrapper.conf  


WORKDIR /

COPY containerfiles/run.sh /

RUN chmod 777 /run.sh 

#RUN useradd -r -u 200 -m -c "sonar role account" -d ${SONARQUBE_HOME} -s /bin/false sonar   

#USER sonar

VOLUME ["$SONARQUBE_HOME/data", "$SONARQUBE_HOME/extensions"]

#RUN chmod  -R 755 $SONARQUBE_HOME
#RUN chmod 755 $SONARQUBE_HOME/extensions
#RUN chmod 755 /opt/sonarqube/temp/
#RUN chmod 755 /opt/sonarqube/temp/README.txt

WORKDIR $SONARQUBE_HOME

#RUN chown -R sonar:sonar /opt/sonarqube/temp/

ENV JAVA_MAX_MEM 1200m
ENV JAVA_MIN_MEM 1200m
#ENV EXTRA_JAVA_OPTS "-Djava.util.prefs.systemRoot=/nexus-data/.java -Djava.util.prefs.userRoot=/nexus-data/.java/.userPrefs"
#ENV JAVA_OPTS "-Djava.awt.headless=true -Djava.io.tmpdir=/opt/temp"

#COPY containerfiles/run.sh /
#RUN chmod 755 $SONARQUBE_HOME/bin/run.sh

#RUN chmod +x ${SONARQUBE_HOME}/bin/run.sh
RUN useradd sonar
RUN chown -R sonar /opt/sonarqube
ENTRYPOINT ["/run.sh"]
</code></pre>

<p>run.sh </p>

<pre><code>#!/bin/bash

#chmod 777 /opt/java/bin/java
/opt/java/bin/java -jar lib/sonar-application-$SONAR_VERSION.jar \
  -Dsonar.log.console=true \
  -Dsonar.jdbc.username="$SONARQUBE_JDBC_USERNAME" \
  -Dsonar.jdbc.password="$SONARQUBE_JDBC_PASSWORD" \
  -Dsonar.jdbc.url="$SONARQUBE_JDBC_URL" \
  -Dsonar.web.javaAdditionalOpts="$SONARQUBE_WEB_JVM_OPTS -Djava.security.egd=file:/dev/./urandom" \
  "$@"
</code></pre>

<p>Could anyone please guide me to resolve this error ?</p>