Closed MaxwellDAssistek closed 1 day ago
This works for me:
services:
shlink:
image: shlinkio/shlink:4.2.5
ports:
- "8080:8080"
links:
- shlink-postgresql
depends_on:
- shlink-postgresql
environment:
DEFAULT_DOMAIN: "localhost:8080"
IS_HTTPS_ENABLED: "false"
DB_DRIVER: "postgres"
DB_USER: "postgres"
DB_PASSWORD: "shlink"
DB_HOST: "shlink-postgresql"
SHELL_VERBOSITY: "3"
shlink-postgresql:
image: postgres:16.3
environment:
POSTGRES_PASSWORD: shlink
POSTGRES_DB: shlink
{9:20}~/test-shlink-error ➭ docker compose up
[+] Running 2/0
✔ Container test-shlink-error-shlink-postgresql-1 Created 0.0s
✔ Container test-shlink-error-shlink-1 Created 0.0s
Attaching to shlink-1, shlink-postgresql-1
shlink-postgresql-1 |
shlink-postgresql-1 | PostgreSQL Database directory appears to contain a database; Skipping initialization
shlink-postgresql-1 |
shlink-postgresql-1 | 2024-11-10 08:20:09.528 UTC [1] LOG: starting PostgreSQL 16.3 (Debian 16.3-1.pgdg120+1) on x86_64-pc-linux-gnu, compiled by gcc (Debian 12.2.0-14) 12.2.0, 64-bit
shlink-postgresql-1 | 2024-11-10 08:20:09.528 UTC [1] LOG: listening on IPv4 address "0.0.0.0", port 5432
shlink-postgresql-1 | 2024-11-10 08:20:09.529 UTC [1] LOG: listening on IPv6 address "::", port 5432
shlink-postgresql-1 | 2024-11-10 08:20:09.541 UTC [1] LOG: listening on Unix socket "/var/run/postgresql/.s.PGSQL.5432"
shlink-postgresql-1 | 2024-11-10 08:20:09.558 UTC [29] LOG: database system was shut down at 2024-11-10 08:20:08 UTC
shlink-postgresql-1 | 2024-11-10 08:20:09.567 UTC [1] LOG: database system is ready to accept connections
shlink-1 | Initializing database if needed... [Running "/usr/local/bin/php bin/cli db:create"] RUN '/usr/local/bin/php' 'bin/cli' 'db:create'
shlink-1 | OUT Creating database tables...
shlink-1 | OUT
shlink-1 | ERR RUN '/usr/local/bin/php' 'bin/doctrine' 'orm:schema-tool:create' '--no-interaction'
shlink-1 | ERR ERR
shlink-1 | ERR ERR ! [CAUTION] This operation should not be executed in a production environment!
shlink-1 | ERR ERR
shlink-1 | ERR ERR Creating database schema...
shlink-1 | ERR ERR
shlink-1 | ERR ERR [OK] Database schema created successfully!
shlink-1 | ERR ERR
shlink-1 | ERR ERR
shlink-1 | OUT
shlink-1 | OUT
shlink-1 | ERR
shlink-1 | ERR RES Command ran successfully
shlink-1 | ERR
shlink-1 | OUT [OK] Database properly created!
shlink-1 | OUT
shlink-1 | OUT
shlink-1 | RES Command ran successfully
shlink-1 | Success!
shlink-1 | Updating database... [Running "/usr/local/bin/php bin/cli db:migrate"] RUN '/usr/local/bin/php' 'bin/cli' 'db:migrate'
shlink-1 | OUT Migrating database...
shlink-1 | OUT
shlink-1 | ERR RUN '/usr/local/bin/php' 'vendor/doctrine/migrations/bin/doctrine-migrations.php' 'migrations:migrate' '--no-interaction'
shlink-1 | ERR OUT
shlink-1 | ERR OUT [OK] Successfully migrated to version: ShlinkMigrations\Version20240331111447
shlink-1 | ERR OUT
shlink-1 | ERR OUT
shlink-1 | ERR OUT
shlink-1 | OUT
shlink-1 | OUT
shlink-1 | ERR
shlink-1 | ERR RES Command ran successfully
shlink-1 | ERR
shlink-1 | OUT [OK] Database properly migrated!
shlink-1 | OUT
shlink-1 | OUT
shlink-1 | RES Command ran successfully
shlink-1 | Success!
shlink-1 | Generating proxies... [Running "/usr/local/bin/php bin/doctrine orm:generate-proxies"] RUN '/usr/local/bin/php' 'bin/doctrine' 'orm:generate-proxies'
shlink-1 | ERR Processing entity "Shlinkio\Shlink\Core\Visit\Entity\OrphanVisitsCount"
shlink-1 | ERR Processing entity "Shlinkio\Shlink\Core\ShortUrl\Entity\ShortUrl"
shlink-1 | ERR Processing entity "Shlinkio\Shlink\Core\Tag\Entity\Tag"
shlink-1 | ERR Processing entity "Shlinkio\Shlink\Core\RedirectRule\Entity\RedirectCondition"
shlink-1 | ERR Processing entity "Shlinkio\Shlink\Core\Visit\Entity\ShortUrlVisitsCount"
shlink-1 | ERR Processing entity "Shlinkio\Shlink\Core\RedirectRule\Entity\ShortUrlRedirectRule"
shlink-1 | ERR Processing entity "Shlinkio\Shlink\Core\Domain\Entity\Domain"
shlink-1 | ERR Processing entity "Shlinkio\Shlink\Core\Visit\Entity\Visit"
shlink-1 | ERR Processing entity "Shlinkio\Shlink\Core\Visit\Entity\VisitLocation"
shlink-1 | ERR Processing entity "Shlinkio\Shlink\Rest\Entity\ApiKeyRole"
shlink-1 | ERR Processing entity "Shlinkio\Shlink\Rest\Entity\ApiKey"
shlink-1 | ERR
shlink-1 | ERR Proxy classes generated to "/etc/shlink/data/proxies"
shlink-1 | ERR
shlink-1 | RES Command ran successfully
shlink-1 | Success!
shlink-1 | Clearing entities cache... [Running "/usr/local/bin/php bin/doctrine orm:clear-cache:metadata"] RUN '/usr/local/bin/php' 'bin/doctrine' 'orm:clear-cache:metadata'
shlink-1 | ERR
shlink-1 | ERR // Clearing all Metadata cache entries
shlink-1 | ERR
shlink-1 | ERR [OK] Successfully deleted cache entries.
shlink-1 | ERR
shlink-1 | ERR
shlink-1 | RES Command ran successfully
shlink-1 | Success!
shlink-1 | {"level":"debug","ts":1731226811008406782,"logger":"rpc","msg":"plugin was started","address":"tcp://127.0.0.1:6001","list of the plugins with RPC methods:":["resetter","app","informer","jobs","lock"]}
shlink-1 | 2024-11-10T08:20:11+0000 DEBUG jobs initializing driver {"pipeline": "shlink", "driver": "memory"}
shlink-1 | 2024-11-10T08:20:11+0000 DEBUG jobs driver ready {"pipeline": "shlink", "driver": "memory", "start": "2024-11-10T08:20:11+0000", "elapsed": 0}
shlink-1 | {"level":"debug","ts":1731226811008656213,"logger":"memory","msg":"pipeline was started","driver":"memory","pipeline":"shlink","start":"2024-11-10 08:20:11.008653861 +0000 UTC","elapsed":"8.123µs"}
shlink-1 | [INFO] RoadRunner server started; version: 2024.2.1, buildtime: 2024-09-12T16:25:04+0000
shlink-1 | [INFO] sdnotify: not notified
Can you provide a docker-compose file where the issue can be reproduce consistently?
Closing as not reproducible. I'm happy to re-open if more specific details are provided.
Shlink version
4.2.5
PHP version
built-in
How do you serve Shlink
Docker image
Database engine
PostgreSQL
Database version
PostgreSQL 16.3
Current behavior
When the container is first started, I get the following error:
Expected behavior
Container should complete migration and start.
Minimum steps to reproduce
Set up the following environment variables: