colinbankier/realworld-tide

Problem starting the app

Closed this issue · 3 comments

I've followed the setup steps, but still have problem.

  1. I've installed diesel
  2. executed ./scripts/init_db.sh

But I get error massage "app can't connect to port ", so I made changes:

modified   configuration/development.yml
@@ -1,4 +1,4 @@
 application:
   host: localhost
 database:
-  port: 5433
+  port: 5432

Now I get this message:

[2020-08-14T23:30:53Z ERROR r2d2] FATAL:  password authentication failed for user "postgres"
FATAL:  password authentication failed for user "postgres"

[2020-08-14T23:30:53Z ERROR r2d2] FATAL:  password authentication failed for user "postgres"
FATAL:  password authentication failed for user "postgres"

[2020-08-14T23:30:53Z ERROR r2d2] FATAL:  password authentication failed for user "postgres"
FATAL:  password authentication failed for user "postgres"

the default password defined by init_db.sh should be "password". But why this error happend?

I works after I changed the default password. This is my all diff.

Unstaged changes (4)
modified   configuration/base.yml
@@ -3,9 +3,9 @@ application:
   port: 5000
 database:
   host: localhost
-  port: 5432
+  port: 5434
   username: postgres
-  password: password
+  password: 123456
   db: realword
 authentication:
   secret: asupersecretsecret
modified   configuration/development.yml
@@ -1,4 +1,4 @@
 application:
   host: localhost
 database:
-  port: 5433
+  port: 5434
modified   scripts/init_db.sh
@@ -5,7 +5,7 @@ set -eo pipefail
 # Check if a user has been set, otherwise default to 'postgres'
 DB_USER=${POSTGRES_USER:=postgres}
 # Check if a password has been set, otherwise default to 'password'
-DB_PASSWORD="${POSTGRES_PASSWORD:=password}"
+DB_PASSWORD="${POSTGRES_PASSWORD:=123456}"
 # Check if a password has been set, otherwise default to 'realworld'
 DB_NAME="${POSTGRES_DB:=realword}"
 # Check if a port has been set, otherwise default to '5434'

now still looking for correct endpoints :)

The app is running well:

image

image

but endpoints not found: (maybe I need to search the correct path)

image

Thanks - it's not clear why the password would matter, but I'll run through the steps on a clean checkout to ensure it works as described. It may be more likely that the port was the issue, which is different between test / development dbs - the readme does include setting the env var to set this, e.g. POSTGRES_PORT=5433 ./scripts/init_db.sh for running in dev mode.

Also, your URL doesn't look right - routes are scoped under /api/, so try /api/users/. The realworld test suit passes for all routes if run as per the readme.

Also, your URL doesn't look right - routes are scoped under /api/, so try /api/users/. The realworld test suit passes for all routes if run as per the readme.

Oh, I don't see the /api/ in the postman collections. Solved, thanks.