Skip to content
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

FATAL: password authentication / DETAIL: Role “” does not exist #17

Closed
ippocratis opened this issue Feb 10, 2022 · 5 comments
Closed

Comments

@ippocratis
Copy link

ippocratis commented Feb 10, 2022

i cant access http://ip:2283 , https://ip:2284 nor can create a user
lsogs say i didnt configure database properly

immich_server    | 
proxy_nginx      | 2022/02/10 10:31:38 [error] 22#22: *1 connect() failed (111: Connection refused) while connecting to upstream, client: 192.168.1.32, server: , request: "GET / HTTP/1.1", upstream: "http://.21.0.4:3000/", host: "192.168.1.24:2283"
proxy_nginx      | 192.168.1.32 - - [10/Feb/2022:10:31:38 +0000] "GET / HTTP/1.1" 502 559 "-" "Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/97.0.4692.99 Safari/537.36" "-"
proxy_nginx      | 2022/02/10 10:31:38 [error] 22#22: *1 connect() failed (111: Connection refused) while connecting to upstream, client: 192.168.1.32, server: , request: "GET /favicon.ico HTTP/1.1", upstream: "http://xxx.21.0.4:3000/favicon.ico", host: "192.168.1.24:2283", referrer: "http://192.168.1.24:2283/"
proxy_nginx      | 192.168.1.32 - - [10/Feb/2022:10:31:38 +0000] "GET /favicon.ico HTTP/1.1" 502 559 "http://192.168.1.24:2283/" "Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/97.0.4692.99 Safari/537.36" "-"

and

immich_postgres  | 2022-02-10 10:31:59.225 UTC [32] FATAL:  password authentication failed for user "immich"
immich_postgres  | 2022-02-10 10:31:59.225 UTC [32] DETAIL:  Role "immich" does not exist.
immich_postgres  | 	Connection matched pg_hba.conf line 100: "host all all all scram-sha-256"
immich_server    | [Nest] 29  - 02/10/2022, 10:31:59 AM   ERROR [TypeOrmModule] Unable to connect to the database. Retrying (1)...
immich_server    | error: password authentication failed for user "immich"
immich_server    |     at Parser.parseErrorMessage (/usr/src/app/node_modules/pg-protocol/src/parser.ts:369:69)
immich_server    |     at Parser.handlePacket (/usr/src/app/node_modules/pg-protocol/src/parser.ts:188:21)
immich_server    |     at Parser.parse (/usr/src/app/node_modules/pg-protocol/src/parser.ts:103:30)
immich_server    |     at Socket.<anonymous> (/usr/src/app/node_modules/pg-protocol/src/index.ts:7:48)
immich_server    |     at Socket.emit (node:events:520:28)
immich_server    |     at addChunk (node:internal/streams/readable:315:12)
immich_server    |     at readableAddChunk (node:internal/streams/readable:289:9)
immich_server    |     at Socket.Readable.push (node:internal/streams/readable:228:10)
immich_server    |     at TCP.onStreamRead (node:internal/stream_base_commons:190:23)
immich_postgres  | 2022-02-10 10:32:02.520 UTC [33] FATAL:  password authentication failed for user "immich"
immich_postgres  | 2022-02-10 10:32:02.520 UTC [33] DETAIL:  Role "immich" does not exist.
immich_postgres  | 	Connection matched pg_hba.conf line 100: "host all all all scram-sha-256"

my .env

NODE_ENV=development

# Database
DB_USERNAME=immich
DB_PASSWORD=immich
DB_DATABASE_NAME=immich

# Upload File Config
UPLOAD_LOCATION=./upload

# JWT SECRET
JWT_SECRET=immich

my docker-compose.yml

  database:
    container_name: immich_postgres
    image: postgres:14
    env_file:
      - .env
    environment:
      POSTGRES_PASSWORD: immich
      POSTGRES_USER: immich
      POSTGRES_DB: immich
      PG_DATA: /var/lib/postgresql/data
    volumes:
      - pgdata:/var/lib/postgresql/data
    ports:
      - 5432:5432
    networks:
      - immich_network

most likely i missed something
any ideas apreciated

@ippocratis
Copy link
Author

If your server_pgdata volume has files in it then the entrypoint script won't initialize the database
i had to delete the db container and db volume and recreate

@League2EB
Copy link
Contributor

League2EB commented Jun 14, 2022

@ippocratis

Thank you for your feedback

I tried docker-compose Down to remove the container and re-docker-compose up -D

I still have this problem, I hope you can help me

and ... my .env id default like this

DB_HOSTNAME=immich_postgres
DB_USERNAME=postgres
DB_PASSWORD=postgres
DB_DATABASE_NAME=immich

REDIS_HOSTNAME=immich_redis

UPLOAD_LOCATION=/home/pi/ssd/immich/upload

JWT_SECRET=randomstringthatissolongandpowerfulthatnoonecanguess

ENABLE_MAPBOX=true
MAPBOX_KEY=fwefwf

VITE_SERVER_ENDPOINT=http://10.0.4.91:2283

and this blow is error msg like you

thank you help me bro

@alextran1502 Thank you again. Please help me if you have enough time
Thank you so much

immich-server_1  | [Nest] 29  - 06/14/2022, 5:35:44 PM   ERROR [TypeOrmModule] Unable to connect to the database. Retrying (9)...
immich-server_1  | error: password authentication failed for user "postgres"
immich-server_1  |     at Parser.parseErrorMessage (/usr/src/app/node_modules/pg-protocol/src/parser.ts:369:69)
immich-server_1  |     at Parser.handlePacket (/usr/src/app/node_modules/pg-protocol/src/parser.ts:188:21)
immich-server_1  |     at Parser.parse (/usr/src/app/node_modules/pg-protocol/src/parser.ts:103:30)
immich-server_1  |     at Socket.<anonymous> (/usr/src/app/node_modules/pg-protocol/src/index.ts:7:48)
immich-server_1  |     at Socket.emit (node:events:527:28)
immich-server_1  |     at addChunk (node:internal/streams/readable:315:12)
immich-server_1  |     at readableAddChunk (node:internal/streams/readable:289:9)
immich-server_1  |     at Socket.Readable.push (node:internal/streams/readable:228:10)
immich-server_1  |     at TCP.onStreamRead (node:internal/stream_base_commons:190:23)
immich-server_1  | [Nest] 29  - 06/14/2022, 5:35:44 PM   ERROR [ExceptionHandler] password authentication failed for user "postgres"
immich-server_1  | error: password authentication failed for user "postgres"
immich-server_1  |     at Parser.parseErrorMessage (/usr/src/app/node_modules/pg-protocol/src/parser.ts:369:69)
immich-server_1  |     at Parser.handlePacket (/usr/src/app/node_modules/pg-protocol/src/parser.ts:188:21)
immich-server_1  |     at Parser.parse (/usr/src/app/node_modules/pg-protocol/src/parser.ts:103:30)
immich-server_1  |     at Socket.<anonymous> (/usr/src/app/node_modules/pg-protocol/src/index.ts:7:48)
immich-server_1  |     at Socket.emit (node:events:527:28)
immich-server_1  |     at addChunk (node:internal/streams/readable:315:12)
immich-server_1  |     at readableAddChunk (node:internal/streams/readable:289:9)
immich-server_1  |     at Socket.Readable.push (node:internal/streams/readable:228:10)
immich-server_1  |     at TCP.onStreamRead (node:internal/stream_base_commons:190:23)

@alextran1502 alextran1502 reopened this Jun 14, 2022
@alextran1502
Copy link
Contributor

alextran1502 commented Jun 14, 2022

@League2EB is this a clean setup? Can you remove all of the containers, images, and volumes that relate to Immich and try again?

@ippocratis
Copy link
Author

ippocratis commented Jun 14, 2022

docker volume ls
Then docker volume rm "volume name"

Where volume name add all immich related volumes one by one

Or you can docker volume prune of you are sure all your needed volumes are atached to running containers

Then recreate immich

@League2EB
Copy link
Contributor

@ippocratis
Thank you for your help. The problem has been solved

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants