Error: EACCES: permission denied, open '/app/data/fs.lock'



  • I updated jsreport/jsreport:2.5.0-full to jsreport/jsreport:2.7.0-full in docker but running into this: Error: EACCES: permission denied, open '/app/data/fs.lock'

    when its trying to initialize the docker container.

    Here is the docker file I'm using which worked for 2.5.0:

    FROM jsreport/jsreport:2.7.0-full
    EXPOSE 5488
    
    COPY ./data /app/data
    COPY ./jsreport.config.json /app/jsreport.config.json
    COPY ./prod.config.json /app/prod.config.json
    COPY ./node_modules /app/node_modules
    
    RUN export NODE_OPTIONS=--max_old_space_size=6096
    


  • Please use the following:

    COPY --chown=jsreport:jsreport ./data /app/data
    

    The user running the node process doesn't have root permissions and you need to chown during copy to the image.
    https://jsreport.net/learn/docker?version=2.11.0#customize-docker-image



  • That worked! Thanks for the quick response.



  • i have the same issue this is my dockerfile

    FROM jsreport/jsreport:2.7.0-full
    # Set working directory di dalam container
    WORKDIR /app
    
    RUN mkdir -p /app/data
    
    COPY  package*.json ./
    
    RUN npm install --unsafe-perm && npm cache clean --force
    
    COPY --chown=jsreport:jsreport jsreport.config.json /app/
    COPY --chown=jsreport:jsreport /data /app/data
    
    COPY --chown=jsreport:jsreport . .
    
    # Ekspos port jsreport
    EXPOSE 5488
    
    CMD [ "sh", "-c", "rm -f /app/data/fs.lock && npm start" ]
    
    


  • @irkhamdivistant Can you upgrade to the latest jsreport version? jsreport 2.7.0 is very old.


Log in to reply
 

Looks like your connection to jsreport forum was lost, please wait while we try to reconnect.