varun-raj / immich-power-tools

Power tools for organizing your immich library
https://immich-power-tools.featureos.app/
326 stars 9 forks source link

Cannot destructure property 'auth' of 'e' as it is undefined #6

Closed DanGarion closed 2 months ago

DanGarion commented 2 months ago

I just installed the latest version this morning. I'm not sure If I'm connecting to my postgres or not since I don't have a port defined within it's container.

Here is my env.

IMMICH_URL=http://XXXX:2283 // This should be the immich url which is accessible in your browser IMMICH_API_KEY=XXXX # your_immich_api_key DATABASE_URL=immich_postgres://postgresXXXXXX:postgresXXXXXX@immich_postgres:5432/immich

I'm not sure what port my postgres is on but I assumed it was default. Looking through my settings I'm fairly certain it is the default port.

Below is the error in the containers log.

2024-08-20T15:11:51.588797805Z TypeError: Cannot destructure property 'auth' of 'e' as it is undefined. 2024-08-20T15:11:51.588826441Z at o (/app/.next/server/chunks/9.js:31:66121) 2024-08-20T15:11:51.588833564Z at l (/app/.next/server/chunks/9.js:31:66810) 2024-08-20T15:11:51.588839920Z at f (/app/.next/server/chunks/9.js:31:15660) 2024-08-20T15:11:51.588846066Z at /app/.next/server/chunks/9.js:31:11139 2024-08-20T15:11:51.588852212Z at Object.Kc as useMemo 2024-08-20T15:11:51.588857939Z at exports.useMemo (/app/node_modules/react/cjs/react.production.min.js:26:48) 2024-08-20T15:11:51.588876168Z at /app/.next/server/chunks/9.js:31:11055 2024-08-20T15:11:51.588881756Z at Wc (/app/node_modules/react-dom/cjs/react-dom-server.browser.production.min.js:68:44) 2024-08-20T15:11:51.588887553Z at Zc (/app/node_modules/react-dom/cjs/react-dom-server.browser.production.min.js:73:362) 2024-08-20T15:11:51.588892721Z at Z (/app/node_modules/react-dom/cjs/react-dom-server.browser.production.min.js:76:89) 2024-08-20T15:11:51.589557901Z ⨯ TypeError: Cannot destructure property 'auth' of 'e' as it is undefined.

varun-raj commented 2 months ago

Hi @DanGarion

Yeah this issue is solved in the new docker image version, can you try the below one?

docker run -d --name immich_power_tools -p 8001:3000 --env-file .env ghcr.io/varun-raj/immich-power-tools:latest
DanGarion commented 2 months ago

Hi @DanGarion

Yeah this issue is solved in the new docker image version, can you try the below one?

docker run -d --name immich_power_tools -p 8001:3000 --env-file .env ghcr.io/varun-raj/immich-power-tools:latest

I am running latest. I just pulled a new image again and still having the same issue.

DanGarion commented 2 months ago

FYI, even with the new release I'm still having the same problem.

`2024-08-21T20:39:30.382121868Z TypeError: Cannot destructure property 'auth' of 'e' as it is undefined.
2024-08-21T20:39:30.382395143Z     at o (/app/.next/server/chunks/9.js:31:66121)
2024-08-21T20:39:30.382400473Z     at l (/app/.next/server/chunks/9.js:31:66810)
2024-08-21T20:39:30.382403839Z     at f (/app/.next/server/chunks/9.js:31:15660)
2024-08-21T20:39:30.382406835Z     at /app/.next/server/chunks/9.js:31:11139
2024-08-21T20:39:30.382409811Z     at Object.Kc [as useMemo] (/app/node_modules/react-dom/cjs/react-dom-server.browser.production.min.js:60:240)
2024-08-21T20:39:30.382413047Z     at exports.useMemo (/app/node_modules/react/cjs/react.production.min.js:26:48)
2024-08-21T20:39:30.382416143Z     at /app/.next/server/chunks/9.js:31:11055
2024-08-21T20:39:30.382419088Z     at Wc (/app/node_modules/react-dom/cjs/react-dom-server.browser.production.min.js:68:44)
2024-08-21T20:39:30.382422084Z     at Zc (/app/node_modules/react-dom/cjs/react-dom-server.browser.production.min.js:73:362)
2024-08-21T20:39:30.382425099Z     at Z (/app/node_modules/react-dom/cjs/react-dom-server.browser.production.min.js:76:89)
2024-08-21T20:39:30.382671364Z  ⨯ TypeError: Cannot destructure property 'auth' of 'e' as it is undefined.`
sai80082 commented 2 months ago

Make sure that power-tools is on same network as immich. If you are using docker compose just add power-tools service to the immich compose file.check the sample docker-compose file.

hjspencer commented 2 months ago

Also check your .env file as I was having the same issue as I was copying it from the docker version using the dockerfile NEXT_PUBLIC_IMMICH_URL= should now be IMMICH_URL=

DanGarion commented 2 months ago

Yes, it is on the same network.

These 4 lines are for reference container_name for postgre: immich_postgres DB_PASSWORD=postgres DB_USERNAME=postgres DB_DATABASE_NAME=immich

Here is my env for power tools IMMICH_URL=http://IPOFSERVER:2283 IMMICH_API_KEY=XXXXXXXXX DATABASE_URL=immich_postgres://postgres:postgres@immich_postgres:5432/immich

sai80082 commented 2 months ago

Seems like your DATABASE_URL is incorrect it should be DATABASE_URL=postgresql://postgres:postgres@immich_postgres:5432/immich

DanGarion commented 2 months ago

Wouldn't it just be the name of the container the immich postgres container?

sai80082 commented 2 months ago

No, database connection string for postgres always starts with postgresql://.

DanGarion commented 2 months ago

Oh duh... that is the part before the ://

I think I should have this then! Duh on me! :) DATABASE_URL=postgresql://postgres:postgres@immich_postgres:5432/immich

DanGarion commented 2 months ago

Ok I figured it out. I think it was because I wasn't telling portainer to load the stack.env for the power tools... Even though I had the env items listed it wasn't inserting them in for power tools... My bad!