Skip to content
This repository was archived by the owner on Sep 4, 2024. It is now read-only.
This repository was archived by the owner on Sep 4, 2024. It is now read-only.

Postgres unknown host exception in Airflow quickstart  #282

Open

Description

@merobi-hub

Barring an issue with my local environment, there seems to be a bug in the quickstart in the API container configuration.

2024-02-13 11:25:01 ERROR [2024-02-13 16:25:01,522] org.apache.tomcat.jdbc.pool.ConnectionPool: Unable to create initial connections of pool.
2024-02-13 11:25:01 ! java.net.UnknownHostException: postgres
2024-02-13 11:25:01 ! at java.base/sun.nio.ch.NioSocketImpl.connect(NioSocketImpl.java:572)
2024-02-13 11:25:01 ! at java.base/java.net.SocksSocketImpl.connect(SocksSocketImpl.java:327)
2024-02-13 11:25:01 ! at java.base/java.net.Socket.connect(Socket.java:633)
2024-02-13 11:25:01 ! at org.postgresql.core.PGStream.createSocket(PGStream.java:243)
2024-02-13 11:25:01 ! at org.postgresql.core.PGStream.<init>(PGStream.java:98)
2024-02-13 11:25:01 ! at org.postgresql.core.v3.ConnectionFactoryImpl.tryConnect(ConnectionFactoryImpl.java:132)
2024-02-13 11:25:01 ! at org.postgresql.core.v3.ConnectionFactoryImpl.openConnectionImpl(ConnectionFactoryImpl.java:258)
2024-02-13 11:25:01 ! ... 26 common frames omitted
2024-02-13 11:25:01 ! Causing: org.postgresql.util.PSQLException: The connection attempt failed.
2024-02-13 11:25:01 ! at org.postgresql.core.v3.ConnectionFactoryImpl.openConnectionImpl(ConnectionFactoryImpl.java:354)
2024-02-13 11:25:01 ! at org.postgresql.core.ConnectionFactory.openConnection(ConnectionFactory.java:54)
2024-02-13 11:25:01 ! at org.postgresql.jdbc.PgConnection.<init>(PgConnection.java:263)
2024-02-13 11:25:01 ! at org.postgresql.Driver.makeConnection(Driver.java:443)
2024-02-13 11:25:01 ! at org.postgresql.Driver.connect(Driver.java:297)
2024-02-13 11:25:01 ! at org.apache.tomcat.jdbc.pool.PooledConnection.connectUsingDriver(PooledConnection.java:346)
2024-02-13 11:25:01 ! at org.apache.tomcat.jdbc.pool.PooledConnection.connect(PooledConnection.java:227)
2024-02-13 11:25:01 ! at org.apache.tomcat.jdbc.pool.ConnectionPool.createConnection(ConnectionPool.java:772)
2024-02-13 11:25:01 ! at org.apache.tomcat.jdbc.pool.ConnectionPool.borrowConnection(ConnectionPool.java:700)
2024-02-13 11:25:01 ! at org.apache.tomcat.jdbc.pool.ConnectionPool.init(ConnectionPool.java:499)
2024-02-13 11:25:01 ! at org.apache.tomcat.jdbc.pool.ConnectionPool.<init>(ConnectionPool.java:155)
2024-02-13 11:25:01 ! at org.apache.tomcat.jdbc.pool.DataSourceProxy.pCreatePool(DataSourceProxy.java:118)
2024-02-13 11:25:01 ! at org.apache.tomcat.jdbc.pool.DataSourceProxy.createPool(DataSourceProxy.java:107)
2024-02-13 11:25:01 ! at org.apache.tomcat.jdbc.pool.DataSourceProxy.getConnection(DataSourceProxy.java:131)
2024-02-13 11:25:01 ! at org.flywaydb.core.internal.jdbc.JdbcUtils.openConnection(JdbcUtils.java:48)
2024-02-13 11:25:01 ! at org.flywaydb.core.internal.jdbc.JdbcConnectionFactory.<init>(JdbcConnectionFactory.java:75)
2024-02-13 11:25:01 ! at org.flywaydb.core.FlywayExecutor.execute(FlywayExecutor.java:147)
2024-02-13 11:25:01 ! at org.flywaydb.core.Flyway.info(Flyway.java:190)
2024-02-13 11:25:01 ! at marquez.db.DbMigration.hasPendingDbMigrations(DbMigration.java:78)
2024-02-13 11:25:01 ! at marquez.db.DbMigration.migrateDbOrError(DbMigration.java:33)
2024-02-13 11:25:01 ! at marquez.MarquezApp.run(MarquezApp.java:109)
2024-02-13 11:25:01 ! at marquez.MarquezApp.run(MarquezApp.java:51)
2024-02-13 11:25:01 ! at io.dropwizard.cli.EnvironmentCommand.run(EnvironmentCommand.java:67)
2024-02-13 11:25:01 ! at io.dropwizard.cli.ConfiguredCommand.run(ConfiguredCommand.java:98)
2024-02-13 11:25:01 ! at io.dropwizard.cli.Cli.run(Cli.java:78)
2024-02-13 11:25:01 ! at io.dropwizard.Application.run(Application.java:94)
2024-02-13 11:25:01 ! at marquez.MarquezApp.main(MarquezApp.java:63)
2024-02-13 11:25:01 INFO  [2024-02-13 16:25:01,525] marquez.MarquezApp: Stopping app...

Activity

  1. mobuchowski commented on Feb 13, 2024

    @mobuchowski
    Member

    @merobi-hub no logs from Postgres container?

  2. merobi-hub commented on Feb 13, 2024

    @merobi-hub
    CollaboratorAuthor

    Thanks @mobuchowski . Here are those logs:

    2024-02-13 16:32:20 The files belonging to this database system will be owned by user "postgres".
    2024-02-13 16:32:20 This user must also own the server process.
    2024-02-13 16:32:20 
    2024-02-13 16:32:20 The database cluster will be initialized with locale "en_US.utf8".
    2024-02-13 16:32:20 The default database encoding has accordingly been set to "UTF8".
    2024-02-13 16:32:20 The default text search configuration will be set to "english".
    2024-02-13 16:32:20 
    2024-02-13 16:32:20 Data page checksums are disabled.
    2024-02-13 16:32:20 
    2024-02-13 16:32:20 fixing permissions on existing directory /var/lib/postgresql/data ... ok
    2024-02-13 16:32:20 creating subdirectories ... ok
    2024-02-13 16:32:20 selecting dynamic shared memory implementation ... posix
    2024-02-13 16:32:20 selecting default max_connections ... 100
    2024-02-13 16:32:20 selecting default shared_buffers ... 128MB
    2024-02-13 16:32:20 selecting default time zone ... Etc/UTC
    2024-02-13 16:32:20 creating configuration files ... ok
    2024-02-13 16:32:20 running bootstrap script ... ok
    2024-02-13 16:32:20 performing post-bootstrap initialization ... ok
    2024-02-13 16:32:20 syncing data to disk ... ok
    2024-02-13 16:32:20 
    2024-02-13 16:32:20 
    2024-02-13 16:32:20 Success. You can now start the database server using:
    2024-02-13 16:32:20 
    2024-02-13 16:32:20     pg_ctl -D /var/lib/postgresql/data -l logfile start
    2024-02-13 16:32:20 
    2024-02-13 16:32:20 waiting for server to start....2024-02-13 21:32:20.923 UTC [47] LOG:  starting PostgreSQL 12.1 (Debian 12.1-1.pgdg100+1) on aarch64-unknown-linux-gnu, compiled by gcc (Debian 8.3.0-6) 8.3.0, 64-bit
    2024-02-13 16:32:20 2024-02-13 21:32:20.924 UTC [47] LOG:  listening on Unix socket "/var/run/postgresql/.s.PGSQL.5432"
    2024-02-13 16:32:20 2024-02-13 21:32:20.941 UTC [48] LOG:  database system was shut down at 2024-02-13 21:32:20 UTC
    2024-02-13 16:32:20 2024-02-13 21:32:20.943 UTC [47] LOG:  database system is ready to accept connections
    2024-02-13 16:32:21  done
    2024-02-13 16:32:21 server started
    2024-02-13 16:32:21 CREATE DATABASE
    2024-02-13 16:32:21 
    2024-02-13 16:32:21 
    2024-02-13 16:32:21 /usr/local/bin/docker-entrypoint.sh: ignoring /docker-entrypoint-initdb.d/*
    2024-02-13 16:32:21 
    2024-02-13 16:32:21 waiting for server to shut down...2024-02-13 21:32:21.150 UTC [47] LOG:  received fast shutdown request
    2024-02-13 16:32:21 .2024-02-13 21:32:21.151 UTC [47] LOG:  aborting any active transactions
    2024-02-13 16:32:21 2024-02-13 21:32:21.152 UTC [47] LOG:  background worker "logical replication launcher" (PID 54) exited with exit code 1
    2024-02-13 16:32:21 2024-02-13 21:32:21.152 UTC [49] LOG:  shutting down
    2024-02-13 16:32:21 2024-02-13 21:32:21.161 UTC [47] LOG:  database system is shut down
    2024-02-13 16:32:21  done
    2024-02-13 16:32:21 server stopped
    2024-02-13 16:32:21 
    2024-02-13 16:32:21 PostgreSQL init process complete; ready for start up.
    2024-02-13 16:32:21 
    2024-02-13 16:32:20 initdb: warning: enabling "trust" authentication for local connections
    2024-02-13 16:32:20 You can change this by editing pg_hba.conf or using the option -A, or
    2024-02-13 16:32:20 --auth-local and --auth-host, the next time you run initdb.
    2024-02-13 16:32:21 2024-02-13 21:32:21.256 UTC [1] LOG:  starting PostgreSQL 12.1 (Debian 12.1-1.pgdg100+1) on aarch64-unknown-linux-gnu, compiled by gcc (Debian 8.3.0-6) 8.3.0, 64-bit
    2024-02-13 16:32:21 2024-02-13 21:32:21.256 UTC [1] LOG:  listening on IPv4 address "0.0.0.0", port 5432
    2024-02-13 16:32:21 2024-02-13 21:32:21.257 UTC [1] LOG:  listening on IPv6 address "::", port 5432
    2024-02-13 16:32:21 2024-02-13 21:32:21.260 UTC [1] LOG:  listening on Unix socket "/var/run/postgresql/.s.PGSQL.5432"
    2024-02-13 16:32:21 2024-02-13 21:32:21.267 UTC [65] LOG:  database system was shut down at 2024-02-13 21:32:21 UTC
    2024-02-13 16:32:21 2024-02-13 21:32:21.270 UTC [1] LOG:  database system is ready to accept connections
    
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions