Comments (5)
That did the trick. And yeah, I changed the name of the user and database as well as the password! Thanks for your help.
from container.
Looking at the timestamps, is it possible that your network already contains another container called database
? Can you check that if you replace your traefik_network
with an docker-compose internal one, as in the example, that things start working? In this case you probably need to rename the database container to codimd-database
or alike.
from container.
@SISheogorath - First, thanks for the response.
I can't drop from the traefik network all together, as homelab fronts that database with a domain, so it's available outside the machine.
That said, I did rename the database service name to codiMdDatabase, and modified the database connection string apropriately. Here's the final docker compose:
---
version: '3'
# This networks section required for the pacakge to be visible to Traefik.
# DO NOT Remove
networks:
traefik_network:
external:
name: homelabos_traefik
services:
codiMdDatabase:
networks:
- traefik_network
image: postgres:9.6-alpine
environment:
# MYSQL_PASSWORD=lookup('password', './settings/passwords/package_name_db_password chars=digits')
- POSTGRES_USER=hackmd
- POSTGRES_PASSWORD=hackmdpass
- POSTGRES_DB=hackmd
volumes:
- "/var/homelabos/codimd/postgresql/data:/var/lib/postgresql/data"
restart: unless-stopped
codiMdApp:
# REQUIRED
image: quay.io/codimd/server:latest
restart: unless-stopped
networks:
- traefik_network
environment:
- CMD_DB_URL=postgres://hackmd:hackmdpass@codiMdDatabase:5432/hackmd
labels:
- "traefik.enable=true"
- "traefik.docker.network=homelabos_traefik"
- "traefik.http.services.codimd.loadbalancer.server.scheme=http"
- "traefik.http.services.codimd.loadbalancer.server.port=3000"
- "traefik.http.routers.codimd-http.rule=Host(`codimd.pinguinshow.com`)"
- "traefik.http.routers.codimd-http.entrypoints=http"
- "traefik.http.routers.codimd-http.middlewares=customFrameHomelab@file"
- "traefik.http.routers.codimd.rule=Host(`codimd.pinguinshow.com`)"
- "traefik.http.routers.codimd.entrypoints=https"
- "traefik.http.routers.codimd.middlewares=customFrameHomelab@file"
- "traefik.http.routers.codimd.tls=true"
- "traefik.http.routers.codimd.tls.certresolver=dns"
- "traefik.http.routers.codimd.tls.domains[0].main=pinguinshow.com"
- "traefik.http.routers.codimd.tls.domains[0].sans=*.pinguinshow.com"
depends_on:
- codiMdDatabase
However, when I bring this up, I still see failures, and codimd doesn't start. Logs:
Creating codimd_codiMdDatabase_1 ... done
Creating codimd_codiMdApp_1 ... done
Attaching to codimd_codiMdDatabase_1, codimd_codiMdApp_1
codiMdDatabase_1 |
codiMdDatabase_1 | PostgreSQL Database directory appears to contain a database; Skipping initialization
codiMdDatabase_1 |
codiMdDatabase_1 | LOG: database system was shut down at 2020-05-07 14:20:11 UTC
codiMdDatabase_1 | LOG: MultiXact member wraparound protections are now enabled
codiMdDatabase_1 | LOG: database system is ready to accept connections
codiMdDatabase_1 | LOG: autovacuum launcher started
codiMdApp_1 | 2020/05/07 14:20:25 Waiting for: tcp://codiMdDatabase:5432
codiMdApp_1 | 2020/05/07 14:20:25 Connected to tcp://codiMdDatabase:5432
codiMdDatabase_1 | LOG: incomplete startup packet
codiMdApp_1 |
codiMdApp_1 | Sequelize CLI [Node: 12.16.2, CLI: 5.5.1, ORM: 5.21.4]
codiMdApp_1 |
codiMdApp_1 | Parsed url postgres://hackmd:*****@codiMdDatabase:5432/hackmd
codiMdDatabase_1 | FATAL: password authentication failed for user "hackmd"
codiMdDatabase_1 | DETAIL: Role "hackmd" does not exist.
codiMdDatabase_1 | Connection matched pg_hba.conf line 95: "host all all all md5"
codiMdApp_1 |
codiMdApp_1 | ERROR: password authentication failed for user "hackmd"
codiMdApp_1 |
codiMdApp_1 | 2020-05-07T14:20:29.411Z warn: Neither 'domain' nor 'CMD_DOMAIN' is configured. This can cause issues with various components.
codiMdApp_1 | Hint: Make sure 'protocolUseSSL' and 'urlAddPort' or 'CMD_PROTOCOL_USESSL' and 'CMD_URL_ADDPORT' are configured properly.
codiMdApp_1 | 2020-05-07T14:20:29.415Z warn: Session secret not set. Using random generated one. Please set `sessionSecret` in your config.js file. All users will be logged out.
codiMdApp_1 | 2020-05-07T14:20:29.415Z warn: PDF export was disabled for this release to mitigate a critical security issue. This feature will hopefully become available again in future releases.
codiMdApp_1 | Thu, 07 May 2020 14:20:29 GMT hsts deprecated The "includeSubdomains" parameter is deprecated. Use "includeSubDomains" (with a capital D) instead. at app.js:85:18
codiMdDatabase_1 | FATAL: password authentication failed for user "hackmd"
codiMdDatabase_1 | DETAIL: Role "hackmd" does not exist.
codiMdDatabase_1 | Connection matched pg_hba.conf line 95: "host all all all md5"
codiMdApp_1 | Unhandled rejection SequelizeConnectionError: password authentication failed for user "hackmd"
codiMdApp_1 | at /codimd/node_modules/sequelize/lib/dialects/postgres/connection-manager.js:182:24
codiMdApp_1 | at Connection.connectingErrorHandler (/codimd/node_modules/pg/lib/client.js:194:14)
codiMdApp_1 | at Connection.emit (events.js:310:20)
codiMdApp_1 | at Socket.<anonymous> (/codimd/node_modules/pg/lib/connection.js:134:12)
codiMdApp_1 | at Socket.emit (events.js:310:20)
codiMdApp_1 | at addChunk (_stream_readable.js:286:12)
codiMdApp_1 | at readableAddChunk (_stream_readable.js:268:9)
codiMdApp_1 | at Socket.Readable.push (_stream_readable.js:209:10)
codiMdApp_1 | at TCP.onStreamRead (internal/stream_base_commons.js:186:23)
codiMdDatabase_1 | FATAL: password authentication failed for user "hackmd"
codiMdDatabase_1 | DETAIL: Role "hackmd" does not exist.
codiMdDatabase_1 | Connection matched pg_hba.conf line 95: "host all all all md5"
codiMdApp_1 | 2020-05-07T14:25:29.894Z error: revision saver failed: SequelizeConnectionError: password authentication failed for user "hackmd"
codiMdDatabase_1 | FATAL: password authentication failed for user "hackmd"
codiMdDatabase_1 | DETAIL: Role "hackmd" does not exist.
codiMdDatabase_1 | Connection matched pg_hba.conf line 95: "host all all all md5"
codiMdApp_1 | 2020-05-07T14:30:29.881Z error: revision saver failed: SequelizeConnectionError: password authentication failed for user "hackmd"
from container.
@SISheogorath - Important Update.
Renaming the database service, coupled with using Mariadb works.
from container.
Maybe you have to reset the database volumes in order to make everything work as expected, but that sounds like it goes in the right direction :)
If you want to do me a personal favor, you also change the name of database and user, as well as the password, after resetting your db storage 😉
from container.
Related Issues (20)
- Dependency Dashboard
- future of docker deployment HOT 2
- Postgres upgrade instructions missing HOT 3
- problem with 1.9.1 image HOT 1
- git not found HOT 1
- MariaDB sample not working with MariaDB 10.6 HOT 19
- Database cannot be reached. Try 1 of 30 HOT 14
- Updating MariaDB to utf8mb4 character set failed
- exec /usr/local/bin/docker-entrypoint.sh: no such file or directory
- Old containers removal prevents pinning HOT 4
- Add OCI annotations to images HOT 4
- BuildKit/buildx required for building docker images (with ansible) HOT 8
- Use of FQIN in Dockerfile FROM instructions HOT 2
- Can't Login After CodiMd Upgrade HOT 1
- oAuth2 not working HOT 7
- Consider hardcoding GID alongside UID for image user?
- npm permission error HOT 2
- Improve Container size HOT 3
- database connection error - permission denied for user hedgedoc HOT 2
- Update spam on the release channel HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from container.