Skip to content
This repository was archived by the owner on Nov 15, 2019. It is now read-only.
This repository was archived by the owner on Nov 15, 2019. It is now read-only.

Hackmd container cannot connect to database  #9

@briandicky

Description

@briandicky

Hi there,
I tried to run the latest docker-hackmd on my server (Ubuntu 16.04), but failed.
I checked docker and docker-compose are all up-to-date.
I can't figure out how to fix it, but I guess there is something going wrong in Postgres database.
Could you give me some advice? Any hints are highly appreciated.
Thanks.

Below is the error message,

Creating dockerhackmd_hackmdPostgres_1
Creating dockerhackmd_hackmd_1
Attaching to dockerhackmd_hackmdPostgres_1, dockerhackmd_hackmd_1
hackmdPostgres_1  | The files belonging to this database system will be owned by user "postgres".
hackmdPostgres_1  | This user must also own the server process.
hackmdPostgres_1  |
hackmdPostgres_1  | The database cluster will be initialized with locale "en_US.utf8".
hackmdPostgres_1  | The default database encoding has accordingly been set to "UTF8".
hackmdPostgres_1  | The default text search configuration will be set to "english".
hackmdPostgres_1  |
hackmd_1          | 2017/03/23 10:12:47 Waiting for host: hackmdPostgres:5432
hackmdPostgres_1  | Data page checksums are disabled.
hackmdPostgres_1  |
hackmd_1          | 2017/03/23 10:12:47 Problem with dial: dial tcp 172.17.0.2:5432: getsockopt: connection refused. Sleeping 5s
hackmdPostgres_1  | fixing permissions on existing directory /var/lib/postgresql/data ... ok
hackmdPostgres_1  | creating subdirectories ... ok
hackmdPostgres_1  | selecting default max_connections ... 100
hackmdPostgres_1  | selecting default shared_buffers ... 128MB
hackmdPostgres_1  | selecting dynamic shared memory implementation ... posix
hackmdPostgres_1  | creating configuration files ... ok
hackmdPostgres_1  | running bootstrap script ... ok
hackmdPostgres_1  | performing post-bootstrap initialization ... ok
hackmdPostgres_1  | syncing data to disk ... ok
hackmdPostgres_1  |
hackmdPostgres_1  | Success. You can now start the database server using:
hackmdPostgres_1  |
hackmdPostgres_1  |     pg_ctl -D /var/lib/postgresql/data -l logfile start
hackmdPostgres_1  |
hackmdPostgres_1  |
hackmdPostgres_1  | WARNING: enabling "trust" authentication for local connections
hackmdPostgres_1  | You can change this by editing pg_hba.conf or using the option -A, or
hackmdPostgres_1  | --auth-local and --auth-host, the next time you run initdb.
hackmdPostgres_1  | waiting for server to start....LOG:  database system was shut down at 2017-03-23 10:12:47 UTC
hackmdPostgres_1  | LOG:  MultiXact member wraparound protections are now enabled
hackmdPostgres_1  | LOG:  database system is ready to accept connections
hackmdPostgres_1  | LOG:  autovacuum launcher started
hackmdPostgres_1  |  done
hackmdPostgres_1  | server started
hackmdPostgres_1  | CREATE DATABASE
hackmdPostgres_1  |
hackmdPostgres_1  | CREATE ROLE
hackmdPostgres_1  |
hackmdPostgres_1  |
hackmdPostgres_1  | /usr/local/bin/docker-entrypoint.sh: ignoring /docker-entrypoint-initdb.d/*
hackmdPostgres_1  |
hackmdPostgres_1  | LOG:  received fast shutdown request
hackmdPostgres_1  | LOG:  aborting any active transactions
hackmdPostgres_1  | waiting for server to shut down...LOG:  autovacuum launcher shutting down
hackmdPostgres_1  | .LOG:  shutting down
hackmdPostgres_1  | LOG:  database system is shut down
hackmdPostgres_1  |  done
hackmdPostgres_1  | server stopped
hackmdPostgres_1  |
hackmdPostgres_1  | PostgreSQL init process complete; ready for start up.
hackmdPostgres_1  |
hackmdPostgres_1  | LOG:  database system was shut down at 2017-03-23 10:12:49 UTC
hackmdPostgres_1  | LOG:  MultiXact member wraparound protections are now enabled
hackmdPostgres_1  | LOG:  database system is ready to accept connections
hackmdPostgres_1  | LOG:  autovacuum launcher started
hackmd_1          | 2017/03/23 10:12:52 Connected to tcp://hackmdPostgres:5432
hackmd_1          |
hackmd_1          | Sequelize [Node: 6.10.1, CLI: 2.6.0, ORM: 3.30.2]
hackmd_1          |
hackmd_1          | Parsed url postgres://hackmd:*****@hackmdPostgres:5432/hackmd
hackmd_1          | == 20160515114000-user-add-tokens: migrating =======
hackmdPostgres_1  | ERROR:  relation "public.Users" does not exist
hackmdPostgres_1  | STATEMENT:  ALTER TABLE "public"."Users" ADD COLUMN "accessToken" VARCHAR(255);
hackmdPostgres_1  | ERROR:  relation "public.Users" does not exist
hackmdPostgres_1  | STATEMENT:  ALTER TABLE "public"."Users" ADD COLUMN "refreshToken" VARCHAR(255);
hackmd_1          | Unhandled rejection SequelizeDatabaseError: relation "public.Users" does not exist
hackmd_1          |     at Query.formatError (/hackmd/node_modules/sequelize/lib/dialects/postgres/query.js:357:14)
hackmd_1          |     at Query.<anonymous> (/hackmd/node_modules/sequelize/lib/dialects/postgres/query.js:88:19)
hackmd_1          |     at emitOne (events.js:96:13)
hackmd_1          |     at Query.emit (events.js:188:7)
hackmd_1          |     at Query.handleError (/hackmd/node_modules/pg/lib/query.js:143:8)
hackmd_1          |     at Connection.<anonymous> (/hackmd/node_modules/pg/lib/client.js:180:26)
hackmd_1          |     at emitOne (events.js:96:13)
hackmd_1          |     at Connection.emit (events.js:188:7)
hackmd_1          |     at Socket.<anonymous> (/hackmd/node_modules/pg/lib/connection.js:136:12)
hackmd_1          |     at emitOne (events.js:96:13)
hackmd_1          |     at Socket.emit (events.js:188:7)
hackmd_1          |     at readableAddChunk (_stream_readable.js:176:18)
hackmd_1          |     at Socket.Readable.push (_stream_readable.js:134:10)
hackmd_1          |     at TCP.onread (net.js:551:20)
hackmd_1          | Unhandled rejection SequelizeDatabaseError: relation "public.Users" does not exist
hackmd_1          |     at Query.formatError (/hackmd/node_modules/sequelize/lib/dialects/postgres/query.js:357:14)
hackmd_1          |     at Query.<anonymous> (/hackmd/node_modules/sequelize/lib/dialects/postgres/query.js:88:19)
hackmd_1          |     at emitOne (events.js:96:13)
hackmd_1          |     at Query.emit (events.js:188:7)
hackmd_1          |     at Query.handleError (/hackmd/node_modules/pg/lib/query.js:143:8)
hackmd_1          |     at Connection.<anonymous> (/hackmd/node_modules/pg/lib/client.js:180:26)
hackmd_1          |     at emitOne (events.js:96:13)
hackmd_1          |     at Connection.emit (events.js:188:7)
hackmd_1          |     at Socket.<anonymous> (/hackmd/node_modules/pg/lib/connection.js:136:12)
hackmd_1          |     at emitOne (events.js:96:13)
hackmd_1          |     at Socket.emit (events.js:188:7)
hackmd_1          |     at readableAddChunk (_stream_readable.js:176:18)
hackmd_1          |     at Socket.Readable.push (_stream_readable.js:134:10)
hackmd_1          |     at TCP.onread (net.js:551:20)
hackmd_1          | == 20160515114000-user-add-tokens: migrated (0.044s)
hackmd_1          | == 20160607060246-support-revision: migrating =======
hackmdPostgres_1  | ERROR:  relation "public.Notes" does not exist
hackmdPostgres_1  | STATEMENT:  ALTER TABLE "public"."Notes" ADD COLUMN "savedAt" TIMESTAMP WITH TIME ZONE;
hackmd_1          | Unhandled rejection SequelizeDatabaseError: relation "public.Notes" does not exist
hackmd_1          |     at Query.formatError (/hackmd/node_modules/sequelize/lib/dialects/postgres/query.js:357:14)
hackmd_1          |     at Query.<anonymous> (/hackmd/node_modules/sequelize/lib/dialects/postgres/query.js:88:19)
hackmd_1          |     at emitOne (events.js:96:13)
hackmd_1          |     at Query.emit (events.js:188:7)
hackmd_1          |     at Query.handleError (/hackmd/node_modules/pg/lib/query.js:143:8)
hackmd_1          |     at Connection.<anonymous> (/hackmd/node_modules/pg/lib/client.js:180:26)
hackmd_1          |     at emitOne (events.js:96:13)
hackmd_1          |     at Connection.emit (events.js:188:7)
hackmd_1          |     at Socket.<anonymous> (/hackmd/node_modules/pg/lib/connection.js:136:12)
hackmd_1          |     at emitOne (events.js:96:13)
hackmd_1          |     at Socket.emit (events.js:188:7)
hackmd_1          |     at readableAddChunk (_stream_readable.js:176:18)
hackmd_1          |     at Socket.Readable.push (_stream_readable.js:134:10)
hackmd_1          |     at TCP.onread (net.js:551:20)
hackmd_1          | == 20160607060246-support-revision: migrated (0.030s)
hackmd_1          | == 20160703062241-support-authorship: migrating =======
hackmdPostgres_1  | ERROR:  relation "public.Notes" does not exist
hackmdPostgres_1  | STATEMENT:  ALTER TABLE "public"."Notes" ADD COLUMN "authorship" TEXT;
hackmdPostgres_1  | ERROR:  relation "public.Revisions" does not exist
hackmdPostgres_1  | STATEMENT:  ALTER TABLE "public"."Revisions" ADD COLUMN "authorship" TEXT;
hackmd_1          | Unhandled rejection SequelizeDatabaseError: relation "public.Revisions" does not exist
hackmd_1          |     at Query.formatError (/hackmd/node_modules/sequelize/lib/dialects/postgres/query.js:357:14)
hackmd_1          |     at Query.<anonymous> (/hackmd/node_modules/sequelize/lib/dialects/postgres/query.js:88:19)
hackmd_1          |     at emitOne (events.js:96:13)
hackmd_1          |     at Query.emit (events.js:188:7)
hackmd_1          |     at Query.handleError (/hackmd/node_modules/pg/lib/query.js:143:8)
hackmd_1          |     at Connection.<anonymous> (/hackmd/node_modules/pg/lib/client.js:180:26)
hackmd_1          |     at emitOne (events.js:96:13)
hackmd_1          |     at Connection.emit (events.js:188:7)
hackmd_1          |     at Socket.<anonymous> (/hackmd/node_modules/pg/lib/connection.js:136:12)
hackmd_1          |     at emitOne (events.js:96:13)
hackmd_1          |     at Socket.emit (events.js:188:7)
hackmd_1          |     at readableAddChunk (_stream_readable.js:176:18)
hackmd_1          |     at Socket.Readable.push (_stream_readable.js:134:10)
hackmd_1          |     at TCP.onread (net.js:551:20)
hackmd_1          | Unhandled rejection SequelizeDatabaseError: relation "public.Notes" does not exist
hackmd_1          |     at Query.formatError (/hackmd/node_modules/sequelize/lib/dialects/postgres/query.js:357:14)
hackmd_1          |     at Query.<anonymous> (/hackmd/node_modules/sequelize/lib/dialects/postgres/query.js:88:19)
hackmd_1          |     at emitOne (events.js:96:13)
hackmd_1          |     at Query.emit (events.js:188:7)
hackmd_1          |     at Query.handleError (/hackmd/node_modules/pg/lib/query.js:143:8)
hackmd_1          |     at Connection.<anonymous> (/hackmd/node_modules/pg/lib/client.js:180:26)
hackmd_1          |     at emitOne (events.js:96:13)
hackmd_1          |     at Connection.emit (events.js:188:7)
hackmd_1          |     at Socket.<anonymous> (/hackmd/node_modules/pg/lib/connection.js:136:12)
hackmd_1          |     at emitOne (events.js:96:13)
hackmd_1          |     at Socket.emit (events.js:188:7)
hackmd_1          |     at readableAddChunk (_stream_readable.js:176:18)
hackmd_1          |     at Socket.Readable.push (_stream_readable.js:134:10)
hackmd_1          |     at TCP.onread (net.js:551:20)
hackmd_1          | == 20160703062241-support-authorship: migrated (0.040s)
hackmd_1          | == 20161009040430-support-delete-note: migrating =======
hackmdPostgres_1  | ERROR:  relation "public.Notes" does not exist
hackmdPostgres_1  | STATEMENT:  ALTER TABLE "public"."Notes" ADD COLUMN "deletedAt" TIMESTAMP WITH TIME ZONE;
hackmd_1          | Unhandled rejection SequelizeDatabaseError: relation "public.Notes" does not exist
hackmd_1          |     at Query.formatError (/hackmd/node_modules/sequelize/lib/dialects/postgres/query.js:357:14)
hackmd_1          |     at Query.<anonymous> (/hackmd/node_modules/sequelize/lib/dialects/postgres/query.js:88:19)
hackmd_1          |     at emitOne (events.js:96:13)
hackmd_1          |     at Query.emit (events.js:188:7)
hackmd_1          |     at Query.handleError (/hackmd/node_modules/pg/lib/query.js:143:8)
hackmd_1          |     at Connection.<anonymous> (/hackmd/node_modules/pg/lib/client.js:180:26)
hackmd_1          |     at emitOne (events.js:96:13)
hackmd_1          |     at Connection.emit (events.js:188:7)
hackmd_1          |     at Socket.<anonymous> (/hackmd/node_modules/pg/lib/connection.js:136:12)
hackmd_1          |     at emitOne (events.js:96:13)
hackmd_1          |     at Socket.emit (events.js:188:7)
hackmd_1          |     at readableAddChunk (_stream_readable.js:176:18)
hackmd_1          |     at Socket.Readable.push (_stream_readable.js:134:10)
hackmd_1          |     at TCP.onread (net.js:551:20)
hackmd_1          | == 20161009040430-support-delete-note: migrated (0.028s)
hackmd_1          | == 20161201050312-support-email-signin: migrating =======
hackmdPostgres_1  | ERROR:  relation "public.Users" does not exist
hackmdPostgres_1  | STATEMENT:  ALTER TABLE "public"."Users" ADD COLUMN "email" TEXT;
hackmdPostgres_1  | ERROR:  relation "public.Users" does not exist
hackmdPostgres_1  | STATEMENT:  ALTER TABLE "public"."Users" ADD COLUMN "password" TEXT;
hackmd_1          | Unhandled rejection SequelizeDatabaseError: relation "public.Users" does not exist
hackmd_1          |     at Query.formatError (/hackmd/node_modules/sequelize/lib/dialects/postgres/query.js:357:14)
hackmd_1          |     at Query.<anonymous> (/hackmd/node_modules/sequelize/lib/dialects/postgres/query.js:88:19)
hackmd_1          |     at emitOne (events.js:96:13)
hackmd_1          |     at Query.emit (events.js:188:7)
hackmd_1          |     at Query.handleError (/hackmd/node_modules/pg/lib/query.js:143:8)
hackmd_1          |     at Connection.<anonymous> (/hackmd/node_modules/pg/lib/client.js:180:26)
hackmd_1          |     at emitOne (events.js:96:13)
hackmd_1          |     at Connection.emit (events.js:188:7)
hackmd_1          |     at Socket.<anonymous> (/hackmd/node_modules/pg/lib/connection.js:136:12)
hackmd_1          |     at emitOne (events.js:96:13)
hackmd_1          |     at Socket.emit (events.js:188:7)
hackmd_1          |     at readableAddChunk (_stream_readable.js:176:18)
hackmd_1          |     at Socket.Readable.push (_stream_readable.js:134:10)
hackmd_1          |     at TCP.onread (net.js:551:20)
hackmd_1          | Unhandled rejection SequelizeDatabaseError: relation "public.Users" does not exist
hackmd_1          |     at Query.formatError (/hackmd/node_modules/sequelize/lib/dialects/postgres/query.js:357:14)
hackmd_1          |     at Query.<anonymous> (/hackmd/node_modules/sequelize/lib/dialects/postgres/query.js:88:19)
hackmd_1          |     at emitOne (events.js:96:13)
hackmd_1          |     at Query.emit (events.js:188:7)
hackmd_1          |     at Query.handleError (/hackmd/node_modules/pg/lib/query.js:143:8)
hackmd_1          |     at Connection.<anonymous> (/hackmd/node_modules/pg/lib/client.js:180:26)
hackmd_1          |     at emitOne (events.js:96:13)
hackmd_1          |     at Connection.emit (events.js:188:7)
hackmd_1          |     at Socket.<anonymous> (/hackmd/node_modules/pg/lib/connection.js:136:12)
hackmd_1          |     at emitOne (events.js:96:13)
hackmd_1          |     at Socket.emit (events.js:188:7)
hackmd_1          |     at readableAddChunk (_stream_readable.js:176:18)
hackmd_1          |     at Socket.Readable.push (_stream_readable.js:134:10)
hackmd_1          |     at TCP.onread (net.js:551:20)
hackmd_1          | == 20161201050312-support-email-signin: migrated (0.023s)
hackmd_1          | 2017-03-23T10:12:58.299Z - info: HTTP Server listening at port 3000

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