New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
serverpod create testpod
fails 80% of the time
#531
Comments
@lukehutch Can you please remove unwanted volumes in docker and try again? |
I shut down all Docker instances each time before running |
@lukehutch, can you provide a bit more information on what platform you are using. Can you also run |
|
Thank you. Perhaps the docker image on Linux opens the port for Postgres before its fully configured. A hack could be to add a short pause after the Postgres port is available. I'll give that a shot. |
The issue exists in Version 1 and is actually a feature of the postgres docker. Read more here: docker-library/postgres#203
|
@hermann-o Yes, I have been through here once and twice. Will update the script soon. |
After running the command, an error occurs:
My configuration 1 (Installation Result: Fatal): My configuration 2 (Installation Result: Fatal): My configuration 3 (Installation Result: Fatal): My configuration 4 (Installation Result: Fatal): My configuration 5 (Installation Result: Successful): My configuration 6 (Installation Result: Successful): My configuration 7 (Installation Result: Fatal): Everyone has the same error. No opportunity to test this interesting product ((( |
@lukehutch Are you still encountering this issue? |
@Isakdl I'm not sure, I got it working once and moved on. I just tried running |
@lukehutch Alright, yes I think what is happening there is that you are running into a connection error and we have no timeout here right now. If you run the command with |
@Isakdl OK, I got it to hang again with ✓ Getting Flutter app package dependencies. (2.2s)
⠙ Creating default database migration.... (0ms)
Creating initial migration.
✓ Creating default database migration. (0.2s)
⠙ Downloading and configuring Docker image.... (0ms)
Applying default migration.
Starting docker container.
Container testpod_server-redis-1 Recreate
Container testpod_server-postgres-1 Recreate
Container testpod_server-postgres-1 Recreated
Container testpod_server-redis-1 Recreated
Container testpod_server-redis-1 Starting
Container testpod_server-postgres-1 Starting
Container testpod_server-redis-1 Started
Container testpod_server-postgres-1 Started
Waiting for database to become available.
Applying migrations.
SERVERPOD version: 1.1.0, dart: 3.3.0-91.0.dev (dev) (Thu Nov 2 09:10:03 2023 -0700) on "linux_x64", time: 2023-12-07 02:34:24.319318Z
mode: development, role: maintenance, logging: verbose, serverId: default
Config loaded from: config/development.yaml
api port: 8080
api public host: localhost
api public port: 8080
api public scheme: http
insights port: 8081
insights public host: localhost
insights public port: 8081
insights public scheme: http
web port: 8082
web public host: localhost
web public port: 8082
web public scheme: http
database host: localhost
database port: 8090
database name: testpod
database user: postgres
database require SSL: false
database unix socket: false
database pass: ********
redis host: localhost
redis port: 8091
redis pass: ********
Failed to connect to the database. Retrying in 10 seconds. PostgreSQLSeverity.fatal 28P01: password authentication failed for user "postgres"
===== asynchronous gap ===========================
package:postgres_pool/postgres_pool.dart 351:18 PgPool.run.<fn>
package:retry/retry.dart 131:16 RetryOptions.retry
package:postgres_pool/postgres_pool.dart 349:14 PgPool.run
package:serverpod/src/database/database_connection.dart 42:5 DatabaseConnection.testConnection
package:serverpod/src/server/serverpod.dart 620:9 Serverpod._connectToDatabase
package:serverpod/src/server/serverpod.dart 348:21 Serverpod.start.<fn>
package:serverpod/src/server/serverpod.dart 341:5 Serverpod.start
package:testpod_server/server.dart 33:3 run
Database configuration:
database host: localhost
database port: 8090
database name: testpod
database user: postgres
database require SSL: false
database unix socket: false
database pass: ********
Failed to connect to the database. Retrying in 10 seconds. PostgreSQLSeverity.fatal 28P01: password authentication failed for user "postgres"
===== asynchronous gap ===========================
package:postgres_pool/postgres_pool.dart 351:18 PgPool.run.<fn>
package:retry/retry.dart 131:16 RetryOptions.retry
package:postgres_pool/postgres_pool.dart 349:14 PgPool.run
package:serverpod/src/database/database_connection.dart 42:5 DatabaseConnection.testConnection
package:serverpod/src/server/serverpod.dart 620:9 Serverpod._connectToDatabase
package:serverpod/src/server/serverpod.dart 348:21 Serverpod.start.<fn>
package:serverpod/src/server/serverpod.dart 341:5 Serverpod.start
package:testpod_server/server.dart 33:3 run
Failed to connect to the database. Retrying in 10 seconds. PostgreSQLSeverity.fatal 28P01: password authentication failed for user "postgres"
===== asynchronous gap ===========================
package:postgres_pool/postgres_pool.dart 351:18 PgPool.run.<fn>
package:retry/retry.dart 131:16 RetryOptions.retry
package:postgres_pool/postgres_pool.dart 349:14 PgPool.run
package:serverpod/src/database/database_connection.dart 42:5 DatabaseConnection.testConnection
package:serverpod/src/server/serverpod.dart 620:9 Serverpod._connectToDatabase
package:serverpod/src/server/serverpod.dart 348:21 Serverpod.start.<fn>
package:serverpod/src/server/serverpod.dart 341:5 Serverpod.start
package:testpod_server/server.dart 33:3 run
Failed to connect to the database. Retrying in 10 seconds. PostgreSQLSeverity.fatal 28P01: password authentication failed for user "postgres"
===== asynchronous gap ===========================
package:postgres_pool/postgres_pool.dart 351:18 PgPool.run.<fn>
package:retry/retry.dart 131:16 RetryOptions.retry
package:postgres_pool/postgres_pool.dart 349:14 PgPool.run
package:serverpod/src/database/database_connection.dart 42:5 DatabaseConnection.testConnection
package:serverpod/src/server/serverpod.dart 620:9 Serverpod._connectToDatabase
package:serverpod/src/server/serverpod.dart 348:21 Serverpod.start.<fn>
package:serverpod/src/server/serverpod.dart 341:5 Serverpod.start
package:testpod_server/server.dart 33:3 run |
@lukehutch Thank you. I think I know what is going on, you ran the command twice with the same project name, right? Since we create a docker container with a volume in the create command, you would have to clean up the volume since it contains the random generated password from the previous create command. Therefor it is now unable to connect on the second try. Now this is of course not great we have to give a proper error here, and secondly we are trying to connect to the database an infinite amount of times but we should have a timeout so we can bail. |
Yes, I did, and this makes sense. |
serverpod create testpod
fails 80% of the time with:It seems to be a race condition though, because I have had it succeed on the odd occasion. If this happens, then the testpod server can't connect to posgres: #521
The text was updated successfully, but these errors were encountered: