How to fix Quay nginx: [alert] could not open error log file: open() "/var/log/nginx/error.log" failed (2: No such file or directory)

Problem

In your quay log, you see the following error message:

nginx: [alert] could not open error log file: open() "/var/log/nginx/error.log" failed (2: No such file or directory)
nginx stderr | 2024/07/13 01:04:58 [emerg] 175#0: open() "/var/log/nginx/error.log" failed (2: No such file or directory)

Solution

Note: This error typically isn’t critical, you can just ignore it.

You have likely mounted a docker volume as /var/log in your quay setup, e.g. in docker-compose.yml:

services:
  quay:
    image: quay.io/projectquay/quay:latest
    # [...]
    volumes:
      - ./quay_log:/var/log
      # [...]

In this directory, create the nginx directory and make it writeable using

mkdir -p quay_log/nginx
chmod a+x quay_log/nginx

After that, restart quay and the error should disappear.