Coder Social home page Coder Social logo

Comments (12)

AlphaNecron avatar AlphaNecron commented on July 23, 2024 1
  • Stop all related containers
  • Do docker rmi postgres -f
  • Rebuild using Docker compose
    However, you can consider changing from v0 to dev branch. (By editing docker-compose.yml)

from void.

AlphaNecron avatar AlphaNecron commented on July 23, 2024 1

No need, normally it does automatically for you.

from void.

AlphaNecron avatar AlphaNecron commented on July 23, 2024

Can you do docker ps?

from void.

tmeuze avatar tmeuze commented on July 23, 2024

Sure thing. Here are the relevant containers (I can provide full output if desired):

f18e20491339   ghcr.io/alphanecron/void/void:v0 "docker-entrypoint.sā€¦"   56 minutes ago   Up 56 minutes 0.0.0.0:9400->9400/tcp, :::9400->9400/tcp  void_void_1
1d424b01eedc   postgres  "docker-entrypoint.sā€¦"   56 minutes ago   Up 56 minutes (healthy)   5432/tcp void_postgres_1

Edit: I have set 9400 as the [core] port in config.toml

Thank you for your time and attention.

from void.

AlphaNecron avatar AlphaNecron commented on July 23, 2024

Can you upload the logs of void_postgres_1? Have you tried restarting both containers?

from void.

AlphaNecron avatar AlphaNecron commented on July 23, 2024

Try export DATABASE_URL=postgres://postgres:postgres@postgres/postgres?

from void.

tmeuze avatar tmeuze commented on July 23, 2024

I did overlook the database_url config.toml parameter. I have since specified the password in the URL: postgres://postgres:postgres@postgres/postgres -> postgres://postgres:<password>@postgres/postgres

(is that correct?)

Now I'm getting authentication failures where I didn't before:

PostgreSQL Database directory appears to contain a database; Skipping initialization
2022-02-15 16:08:31.201 UTC [1] LOG:  starting PostgreSQL 14.2 (Debian 14.2-1.pgdg110+1) on x86_64-pc-linux-gnu, compiled by gcc (Debian 10.2.1-6) 10.2.1 20210110, 64-bit
2022-02-15 16:08:31.201 UTC [1] LOG:  listening on IPv4 address "0.0.0.0", port 5432
2022-02-15 16:08:31.201 UTC [1] LOG:  listening on IPv6 address "::", port 5432
2022-02-15 16:08:31.208 UTC [1] LOG:  listening on Unix socket "/var/run/postgresql/.s.PGSQL.5432"
2022-02-15 16:08:31.213 UTC [26] LOG:  database system was interrupted; last known up at 2022-02-15 16:07:07 UTC
2022-02-15 16:08:31.381 UTC [26] LOG:  database system was not properly shut down; automatic recovery in progress
2022-02-15 16:08:31.383 UTC [26] LOG:  redo starts at 0/16FB188
2022-02-15 16:08:31.383 UTC [26] LOG:  invalid record length at 0/16FB270: wanted 24, got 0
2022-02-15 16:08:31.383 UTC [26] LOG:  redo done at 0/16FB238 system usage: CPU: user: 0.00 s, system: 0.00 s, elapsed: 0.00 s
2022-02-15 16:08:31.401 UTC [1] LOG:  database system is ready to accept connections
2022-02-15 16:08:36.151 UTC [33] FATAL:  password authentication failed for user "postgres"
2022-02-15 16:08:36.151 UTC [33] DETAIL:  Connection matched pg_hba.conf line 100: "host all all all scram-sha-256"
2022-02-15 16:10:09.330 UTC [111] FATAL:  password authentication failed for user "postgres"
2022-02-15 16:10:09.330 UTC [111] DETAIL:  Connection matched pg_hba.conf line 100: "host all all all scram-sha-256"
...

Though I'm certain I set the same password in all parameters and in the docker-compose.yml

export DATABASE_URL=DATABASE_URL=postgres://postgres:<password>@postgres/postgres did not do the trick:

  error: Error validating datasource `db`: the URL must start with the protocol `postgresql://` or `postgres://`.
  -->  schema.prisma:3
   | 
 2 |   provider = "postgresql"
 3 |   url      = env("DATABASE_URL")

Was the doubled DATABASE_URL= intentional?

Surely I'm just doing something dumb or overlooking something simple.

from void.

AlphaNecron avatar AlphaNecron commented on July 23, 2024

Yes, sorry, the default password for postgres in docker is always postgres, as well as the username, host and database name.

from void.

tmeuze avatar tmeuze commented on July 23, 2024

All good! Ok, I set everything back to default postgres password. Rebuilt both containers - same authentication failure.

Gotta be human-error, or something on my end. I'll keep playing around with it.

Thank you so much.

from void.

AlphaNecron avatar AlphaNecron commented on July 23, 2024

You can try removing postgres image from docker and pull it once again. Hope this workaround would solve your problem.

from void.

tmeuze avatar tmeuze commented on July 23, 2024

Hey @AlphaNecron , sorry for the delay, and thank you for your help.

I took the postgres container out of the equation, and just used my own postgres server. Doing this, I was able to run the command to create the default user.

Might be noteworthy - using the postgres container - on attempting to log in, I would not get a "user does not exist" error. No error at all. When I specified my own database server, the error would then appear until I ran the command to create the user.

Thanks again!

from void.

tmeuze avatar tmeuze commented on July 23, 2024

Please consider adding to documentation the two prerequisite commands to execute:
export DATABASE_URL=postgres://postgres:<password>@postgres/postgres
yarn prisma db seed

For other users.

from void.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    šŸ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ā¤ļø Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.