Permission denied for making directories for logfile

Hi,

I’m trying to create logfiles for Elastiflow, and I’m using the docker version 7.0.2 of Elastiflow and docker-compose. I’ve set

EF_LOGGER_FILE_LOG_ENABLE: 'true'
EF_LOGGER_FILE_LOG_FILENAME: '/var/log/elastiflow/flowcoll/flowcoll.log'

I’m getting the error message below.

write error: can't make directories for new logfile: mkdir /var/log/elastiflow/flowcoll: permission denied

Is there anything else I need to do?

Thank you.

Hello, be sure that /var/log/elastiflow/flowcoll is mounted in your compose file like this:

volumes:
  - /var/log/elastiflow/flowcoll:/var/log/elastiflow/flowcoll

Also, are you sure that you don’t want to obtain logs using docker?:
docker service logs CONTAINER_ID

2 Likes

Thanks for the suggestion, it was the first step to getting it to work. I then set the directories to +w after that, but got another “permission denied” message (cannot open log file). Then I restarted the docker service (still didn’t work), and then I added the :z flag to the mounted volumes, and it finally worked.

I removed the :z flags and started the containers again, and it still worked, so I’m confused as to what actually happened. Did the :z flag just kickstart some process and wasn’t necessary after that?

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.