zlsl/flibusta

Issue Starting Up: this site can't be reached

Closed this issue · 4 comments

Hi!
default docker-compose.yaml has issue in the line

            - './phpdocker/nginx/nginx.conf:/etc/nginx/conf.d/default.conf'

ERROR

...
flags: 0x5000: not a directory: unknown: Are you trying to mount a directory onto a file (or vice-versa)? Check if the specified host path exists and is the expected type

However, even if I run service with modified docker-compose.yaml, and seeing no errors in logs, I cannot access my service on :27100 -- I presume, something may be wrong with nginx config.
Assistance is required, thank you!

my docker-compose.yaml:

services:
  postgres:
    build: flibusta/phpdocker/pg
    networks:
      flibusta:
    container_name: flibusta_psql
    working_dir: /application
    volumes:
      - '${DATA}/psql_data:/var/lib/postgresql/data'
      - '${DATA}/application:/application'
    environment:
      - POSTGRES_USER=flibusta
      - POSTGRES_PASSWORD=flibusta
      - POSTGRES_DB=flibusta
    ports:
      - '27101:5432'

  webserver:
    image: 'nginx:alpine'
    networks:
      flibusta:
    container_name: flibusta_app
    working_dir: /application
    volumes:
      - '${DATA}/application:/application'
      - '${DATA}/cache:/application/cache'
      - '${FNET}:/application/flibusta'
      - '${FSQL}/lib.a.attached.zip:/application/cache/lib.a.attached.zip'
      - '${FSQL}/lib.b.attached.zip:/application/cache/lib.b.attached.zip'
        # - '${DATA}/phpdocker/nginx/nginx.conf:/etc/nginx/conf.d'

    ports:
      - '27100:80'

  php-fpm:
    build: flibusta/phpdocker/php-fpm
    networks:
      flibusta:
    container_name: flibusta_php
    working_dir: /application
    volumes:
      - '${DATA}/application:/application'
      - '${DATA}/cache/cache'
      - '${FSQL}/lib.a.attached.zip:/application/cache/lib.a.attached.zip'
      - '${FSQL}/lib.b.attached.zip:/application/cache/lib.b.attached.zip'
      - '${FNET}:/application/flibusta'
      - '${FSQL}:/application/sql'
        # - '${DATA}/php/php-fpm:/etc/php/7.4/fpm/conf.d'
networks:
  flibusta:

Here are my logs:

(base) valerii@mu:~/configs/flibusta$ docker-compose up
[+] Running 3/0
 ✔ Container flibusta_php   Created                                                                             0.0s
 ✔ Container flibusta_psql  Created                                                                             0.0s
 ✔ Container flibusta_app   Created                                                                             0.0s
Attaching to flibusta_app, flibusta_php, flibusta_psql
flibusta_app   | /docker-entrypoint.sh: /docker-entrypoint.d/ is not empty, will attempt to perform configuration
flibusta_app   | /docker-entrypoint.sh: Looking for shell scripts in /docker-entrypoint.d/
flibusta_app   | /docker-entrypoint.sh: Launching /docker-entrypoint.d/10-listen-on-ipv6-by-default.sh
flibusta_app   | 10-listen-on-ipv6-by-default.sh: info: /etc/nginx/conf.d/default.conf is not a file or does not exist
flibusta_app   | /docker-entrypoint.sh: Sourcing /docker-entrypoint.d/15-local-resolvers.envsh
flibusta_app   | /docker-entrypoint.sh: Launching /docker-entrypoint.d/20-envsubst-on-templates.sh
flibusta_app   | /docker-entrypoint.sh: Launching /docker-entrypoint.d/30-tune-worker-processes.sh
flibusta_app   | /docker-entrypoint.sh: Configuration complete; ready for start up
flibusta_app   | 2024/10/02 12:02:50 [notice] 1#1: using the "epoll" event method
flibusta_app   | 2024/10/02 12:02:50 [notice] 1#1: nginx/1.27.1
flibusta_app   | 2024/10/02 12:02:50 [notice] 1#1: built by gcc 13.2.1 20240309 (Alpine 13.2.1_git20240309)
flibusta_app   | 2024/10/02 12:02:50 [notice] 1#1: OS: Linux 6.8.0-41-generic
flibusta_app   | 2024/10/02 12:02:50 [notice] 1#1: getrlimit(RLIMIT_NOFILE): 1048576:1048576
flibusta_app   | 2024/10/02 12:02:50 [notice] 1#1: start worker processes
flibusta_app   | 2024/10/02 12:02:50 [notice] 1#1: start worker process 20
flibusta_app   | 2024/10/02 12:02:50 [notice] 1#1: start worker process 21
flibusta_app   | 2024/10/02 12:02:50 [notice] 1#1: start worker process 22
flibusta_app   | 2024/10/02 12:02:50 [notice] 1#1: start worker process 23
flibusta_app   | 2024/10/02 12:02:50 [notice] 1#1: start worker process 24
flibusta_app   | 2024/10/02 12:02:50 [notice] 1#1: start worker process 25
flibusta_app   | 2024/10/02 12:02:50 [notice] 1#1: start worker process 26
flibusta_app   | 2024/10/02 12:02:50 [notice] 1#1: start worker process 27
flibusta_app   | 2024/10/02 12:02:50 [notice] 1#1: start worker process 28
flibusta_app   | 2024/10/02 12:02:50 [notice] 1#1: start worker process 29
flibusta_app   | 2024/10/02 12:02:50 [notice] 1#1: start worker process 30
flibusta_app   | 2024/10/02 12:02:50 [notice] 1#1: start worker process 31
flibusta_php   | [02-Oct-2024 12:02:50] NOTICE: fpm is running, pid 1
flibusta_psql  | The files belonging to this database system will be owned by user "postgres".
flibusta_psql  | This user must also own the server process.
flibusta_psql  |
flibusta_psql  | The database cluster will be initialized with locale "en_US.utf8".
flibusta_psql  | The default database encoding has accordingly been set to "UTF8".
flibusta_psql  | The default text search configuration will be set to "english".
flibusta_psql  |
flibusta_psql  | Data page checksums are disabled.
flibusta_psql  |
flibusta_psql  | fixing permissions on existing directory /var/lib/postgresql/data ... ok
flibusta_psql  | creating subdirectories ... ok
flibusta_psql  | selecting dynamic shared memory implementation ... posix
flibusta_php   | [02-Oct-2024 12:02:50] NOTICE: ready to handle connections
flibusta_php   | [02-Oct-2024 12:02:50] NOTICE: systemd monitor interval set to 10000ms
flibusta_psql  | selecting default max_connections ... 100
flibusta_psql  | selecting default shared_buffers ... 128MB
flibusta_psql  | selecting default time zone ... Etc/UTC
flibusta_psql  | creating configuration files ... ok
flibusta_psql  | running bootstrap script ... ok
flibusta_psql  | performing post-bootstrap initialization ... ok
flibusta_psql  | syncing data to disk ... ok
flibusta_psql  |
flibusta_psql  |
flibusta_psql  | Success. You can now start the database server using:
flibusta_psql  |
flibusta_psql  |     pg_ctl -D /var/lib/postgresql/data -l logfile start
flibusta_psql  |
flibusta_psql  | initdb: warning: enabling "trust" authentication for local connections
flibusta_psql  | You can change this by editing pg_hba.conf or using the option -A, or
flibusta_psql  | --auth-local and --auth-host, the next time you run initdb.
flibusta_psql  | waiting for server to start....2024-10-02 12:02:50.944 UTC [48] LOG:  starting PostgreSQL 13.4 (Debian 13.4-4.pgdg110+1) on x86_64-pc-linux-gnu, compiled by gcc (Debian 10.2.1-6) 10.2.1 20210110, 64-bit
flibusta_psql  | 2024-10-02 12:02:50.945 UTC [48] LOG:  listening on Unix socket "/var/run/postgresql/.s.PGSQL.5432"
flibusta_psql  | 2024-10-02 12:02:50.948 UTC [49] LOG:  database system was shut down at 2024-10-02 12:02:50 UTC
flibusta_psql  | 2024-10-02 12:02:50.954 UTC [48] LOG:  database system is ready to accept connections
flibusta_psql  |  done
flibusta_psql  | server started
flibusta_psql  | CREATE DATABASE
flibusta_psql  |
flibusta_psql  |
flibusta_psql  | /usr/local/bin/docker-entrypoint.sh: running /docker-entrypoint-initdb.d/init_db.sql
flibusta_psql  | SET
flibusta_psql  | SET
flibusta_psql  | SET
flibusta_psql  | SET
flibusta_psql  | SET
flibusta_psql  |  set_config
flibusta_psql  | ------------
flibusta_psql  |
flibusta_psql  | (1 row)
flibusta_psql  |
flibusta_psql  | SET
flibusta_psql  | SET
flibusta_psql  | SET
flibusta_psql  | SET
flibusta_psql  | CREATE EXTENSION
flibusta_psql  | COMMENT
flibusta_psql  | CREATE EXTENSION
flibusta_psql  | COMMENT
flibusta_psql  | SET
flibusta_psql  | SET
flibusta_psql  | CREATE TABLE
flibusta_psql  | ALTER TABLE
flibusta_psql  | CREATE SEQUENCE
flibusta_psql  | ALTER TABLE
flibusta_psql  | ALTER SEQUENCE
flibusta_psql  | CREATE TABLE
flibusta_psql  | ALTER TABLE
flibusta_psql  | CREATE SEQUENCE
flibusta_psql  | ALTER TABLE
flibusta_psql  | ALTER SEQUENCE
flibusta_psql  | CREATE TABLE
flibusta_psql  | ALTER TABLE
flibusta_psql  | CREATE TABLE
flibusta_psql  | ALTER TABLE
flibusta_psql  | CREATE TABLE
flibusta_psql  | ALTER TABLE
flibusta_psql  | CREATE TABLE
flibusta_psql  | ALTER TABLE
flibusta_psql  | CREATE TABLE
flibusta_psql  | ALTER TABLE
flibusta_psql  | CREATE SEQUENCE
flibusta_psql  | ALTER TABLE
flibusta_psql  | ALTER SEQUENCE
flibusta_psql  | CREATE TABLE
flibusta_psql  | ALTER TABLE
flibusta_psql  | CREATE SEQUENCE
flibusta_psql  | ALTER TABLE
flibusta_psql  | ALTER SEQUENCE
flibusta_psql  | CREATE TABLE
flibusta_psql  | ALTER TABLE
flibusta_psql  | CREATE TABLE
flibusta_psql  | ALTER TABLE
flibusta_psql  | CREATE TABLE
flibusta_psql  | ALTER TABLE
flibusta_psql  | CREATE SEQUENCE
flibusta_psql  | ALTER TABLE
flibusta_psql  | ALTER SEQUENCE
flibusta_psql  | CREATE TABLE
flibusta_psql  | ALTER TABLE
flibusta_psql  | CREATE TABLE
flibusta_psql  | ALTER TABLE
flibusta_psql  | CREATE TABLE
flibusta_psql  | ALTER TABLE
flibusta_psql  | CREATE TABLE
flibusta_psql  | ALTER TABLE
flibusta_psql  | CREATE SEQUENCE
flibusta_psql  | ALTER TABLE
flibusta_psql  | ALTER SEQUENCE
flibusta_psql  | CREATE TABLE
flibusta_psql  | ALTER TABLE
flibusta_psql  | CREATE SEQUENCE
flibusta_psql  | ALTER TABLE
flibusta_psql  | ALTER SEQUENCE
flibusta_psql  | CREATE TABLE
flibusta_psql  | ALTER TABLE
flibusta_psql  | CREATE SEQUENCE
flibusta_psql  | ALTER TABLE
flibusta_psql  | ALTER SEQUENCE
flibusta_psql  | CREATE TABLE
flibusta_psql  | ALTER TABLE
flibusta_psql  | CREATE TABLE
flibusta_psql  | ALTER TABLE
flibusta_psql  | CREATE SEQUENCE
flibusta_psql  | ALTER TABLE
flibusta_psql  | ALTER SEQUENCE
flibusta_psql  | CREATE TABLE
flibusta_psql  | ALTER TABLE
flibusta_psql  | CREATE TABLE
flibusta_psql  | ALTER TABLE
flibusta_psql  | CREATE TABLE
flibusta_psql  | ALTER TABLE
flibusta_psql  | CREATE TABLE
flibusta_psql  | ALTER TABLE
flibusta_psql  | CREATE TABLE
flibusta_psql  | ALTER TABLE
flibusta_psql  | CREATE TABLE
flibusta_psql  | ALTER TABLE
flibusta_psql  | CREATE TABLE
flibusta_psql  | ALTER TABLE
flibusta_psql  | CREATE TABLE
flibusta_psql  | ALTER TABLE
flibusta_psql  | CREATE TABLE
flibusta_psql  | ALTER TABLE
flibusta_psql  | CREATE TABLE
flibusta_psql  | ALTER TABLE
flibusta_psql  | ALTER TABLE
flibusta_psql  | ALTER TABLE
flibusta_psql  | ALTER TABLE
flibusta_psql  | ALTER TABLE
flibusta_psql  | ALTER TABLE
flibusta_psql  | ALTER TABLE
flibusta_psql  | ALTER TABLE
flibusta_psql  | ALTER TABLE
flibusta_psql  | ALTER TABLE
flibusta_psql  | ALTER TABLE
flibusta_psql  | ALTER TABLE
flibusta_psql  | ALTER TABLE
flibusta_psql  | ALTER TABLE
flibusta_psql  | ALTER TABLE
flibusta_psql  | ALTER TABLE
flibusta_psql  | ALTER TABLE
flibusta_psql  | ALTER TABLE
flibusta_psql  | ALTER TABLE
flibusta_psql  | ALTER TABLE
flibusta_psql  | CREATE INDEX
flibusta_psql  | CREATE INDEX
flibusta_psql  | CREATE INDEX
flibusta_psql  | CREATE INDEX
flibusta_psql  | CREATE INDEX
flibusta_psql  | CREATE INDEX
flibusta_psql  | CREATE INDEX
flibusta_psql  | CREATE INDEX
flibusta_psql  | CREATE INDEX
flibusta_psql  | CREATE INDEX
flibusta_psql  | CREATE INDEX
flibusta_psql  | CREATE INDEX
flibusta_psql  | CREATE INDEX
flibusta_psql  | CREATE INDEX
flibusta_psql  | CREATE INDEX
flibusta_psql  | CREATE INDEX
flibusta_psql  | CREATE INDEX
flibusta_psql  | CREATE INDEX
flibusta_psql  | CREATE INDEX
flibusta_psql  | CREATE INDEX
flibusta_psql  | CREATE INDEX
flibusta_psql  | CREATE INDEX
flibusta_psql  | CREATE INDEX
flibusta_psql  | CREATE INDEX
flibusta_psql  | CREATE INDEX
flibusta_psql  | CREATE INDEX
flibusta_psql  | CREATE INDEX
flibusta_psql  | CREATE INDEX
flibusta_psql  | CREATE INDEX
flibusta_psql  | CREATE INDEX
flibusta_psql  | CREATE INDEX
flibusta_psql  | CREATE INDEX
flibusta_psql  | CREATE INDEX
flibusta_psql  | CREATE INDEX
flibusta_psql  | CREATE INDEX
flibusta_psql  | CREATE INDEX
flibusta_psql  | CREATE INDEX
flibusta_psql  | CREATE INDEX
flibusta_psql  | CREATE INDEX
flibusta_psql  | CREATE INDEX
flibusta_psql  | CREATE INDEX
flibusta_psql  | CREATE INDEX
flibusta_psql  | CREATE INDEX
flibusta_psql  | CREATE INDEX
flibusta_psql  | CREATE INDEX
flibusta_psql  | CREATE INDEX
flibusta_psql  | CREATE INDEX
flibusta_psql  | CREATE INDEX
flibusta_psql  | CREATE INDEX
flibusta_psql  | CREATE INDEX
flibusta_psql  | CREATE INDEX
flibusta_psql  | CREATE INDEX
flibusta_psql  | CREATE INDEX
flibusta_psql  | CREATE INDEX
flibusta_psql  | CREATE INDEX
flibusta_psql  | CREATE INDEX
flibusta_psql  | CREATE INDEX
flibusta_psql  | CREATE INDEX
flibusta_psql  | CREATE INDEX
flibusta_psql  | CREATE INDEX
flibusta_psql  | CREATE INDEX
flibusta_psql  | CREATE INDEX
flibusta_psql  | CREATE INDEX
flibusta_psql  | CREATE INDEX
flibusta_psql  | CREATE INDEX
flibusta_psql  | CREATE INDEX
flibusta_psql  | CREATE INDEX
flibusta_psql  | CREATE INDEX
flibusta_psql  | CREATE INDEX
flibusta_psql  | CREATE INDEX
flibusta_psql  | ALTER TABLE
flibusta_psql  |
flibusta_psql  |
flibusta_psql  | 2024-10-02 12:02:51.290 UTC [48] LOG:  received fast shutdown request
flibusta_psql  | waiting for server to shut down....2024-10-02 12:02:51.290 UTC [48] LOG:  aborting any active transactions
flibusta_psql  | 2024-10-02 12:02:51.292 UTC [48] LOG:  background worker "logical replication launcher" (PID 55) exited with exit code 1
flibusta_psql  | 2024-10-02 12:02:51.292 UTC [50] LOG:  shutting down
flibusta_psql  | 2024-10-02 12:02:51.313 UTC [48] LOG:  database system is shut down
flibusta_psql  |  done
flibusta_psql  | server stopped
flibusta_psql  |
flibusta_psql  | PostgreSQL init process complete; ready for start up.
flibusta_psql  |
flibusta_psql  | 2024-10-02 12:02:51.414 UTC [1] LOG:  starting PostgreSQL 13.4 (Debian 13.4-4.pgdg110+1) on x86_64-pc-linux-gnu, compiled by gcc (Debian 10.2.1-6) 10.2.1 20210110, 64-bit
flibusta_psql  | 2024-10-02 12:02:51.415 UTC [1] LOG:  listening on IPv4 address "0.0.0.0", port 5432
flibusta_psql  | 2024-10-02 12:02:51.415 UTC [1] LOG:  listening on IPv6 address "::", port 5432
flibusta_psql  | 2024-10-02 12:02:51.416 UTC [1] LOG:  listening on Unix socket "/var/run/postgresql/.s.PGSQL.5432"
flibusta_psql  | 2024-10-02 12:02:51.420 UTC [64] LOG:  database system was shut down at 2024-10-02 12:02:51 UTC
flibusta_psql  | 2024-10-02 12:02:51.426 UTC [1] LOG:  database system is ready to accept connections

is it really nginx config issue? possibly with lib.a.attached.zip and lib.b.attached.zip folders that created on start if such files not exist in FlibustaSQL folder? could you check if such folders exist, if yes, please remove them and copy appropriate files from https://flibusta.is/sql/ that usually downloaded via getcovers.sh script

zlsl commented

is it really nginx config issue? possibly with lib.a.attached.zip and lib.b.attached.zip folders that created on start if such files not exist in FlibustaSQL folder? could you check if such folders exist, if yes, please remove them and copy appropriate files from https://flibusta.is/sql/ that usually downloaded via getcovers.sh script

lib.a.attached.zip and lib.b.attached.zip - contains image covers.
Now all covers generated from fb2, djvu, pdf files directly

yeah, but in docker-compose.yml file we have these lines:

        volumes:
            - './application:/application'
            - './cache:/application/cache'
            - './FlibustaSQL/lib.a.attached.zip:/application/cache/lib.a.attached.zip'
            - './FlibustaSQL/lib.b.attached.zip:/application/cache/lib.b.attached.zip'

so when you do first time docker-compose up it works fine, but inside container it create links from ./FlibustaSQL/lib.a.attached.zip to ./cache/lib.a.attached.zip and when you stop containers by docker-compose down, we will see new empty files in cache folder lib.a.attached.zip and lib.b.attached.zip. Then you try to start containers again and docker compose will face with the error: flags: 0x5000: not a directory: unknown: Are you trying to mount a directory onto a file (or vice-versa)? Check if the specified host path exists and is the expected type
To fix it you can remove these empty files rm ./cache/*.zip before starting them again.

One more think from my side, that we can remove these volumes at all

            - './FlibustaSQL/lib.a.attached.zip:/application/cache/lib.a.attached.zip'
            - './FlibustaSQL/lib.b.attached.zip:/application/cache/lib.b.attached.zip'

Instead we can just download them into cache folder. instead of ./FlibustaSQL

I'll prepare MR with that fix

MR with fix - #21