Socket.io UnauthorizedException: Authentication required

Hi I am trying to connect to immich server using socket.io , I am getting an UnauthorizedException: Authentication required response in the server. I am using : inside or outide docker ( localhost:2283 )
const socket = io("http://immich-server:2283", { path: "/api/socket.io", transports: ["websocket"], auth: { token }, });
The tocken is generated using
const response = await fetch(${IMMICH_API_BASE}/auth/login, { method: "POST", headers: { "Content-Type": "application/json" }, body: JSON.stringify({ email: EMAIL, password: PASSWORD }), });
or using
curl -X POST http://localhost:2283/api/auth/login -H "Content-Type: application/json" -d '{"email":"email@domain","password":"..."}'
using socket.on("connect", () => { .... ) I see that I am connected , but directly disconnected from the server due to unauthorized response .
[Nest] 25 - 10/31/2025, 8:30:09 AM LOG [Api:WebsocketRepository] Websocket Connect: g1HqIKlUVe2lhaGGAAAF [Nest] 25 - 10/31/2025, 8:30:09 AM ERROR [Api:WebsocketRepository] Websocket connection error: UnauthorizedException: Authentication required **UnauthorizedException: Authentication required** at AuthService.validate (/usr/src/app/server/dist/services/auth.service.js:165:15) ... /usr/src/app/server/node_modules/.pnpm/rxjs@7.8.2/node_modules/rxjs/dist/cjs/internal/operators/distinctUntilChanged.js:18:28 [Nest] 25 - 10/31/2025, 8:30:09 AM LOG [Api:WebsocketRepository] Websocket Disconnect: g1HqIKlUVe2lhaGGAAAF
I am using latest immich version
cat package.json { "name": "immich-ws-listener", "version": "1.0.0", "type": "module", "dependencies": { "@Immich/sdk": "^2.1.0", "node-fetch": "^3.3.2", "socket.io-client": "^4.8.1" } }
Any help with this i greatly appreciated Alain
4 Replies
Immich
Immich2w ago
:wave: Hey @snapdragon, Thanks for reaching out to us. Please carefully read this message and follow the recommended actions. This will help us be more effective in our support effort and leave more time for building Immich :immich:. References - Container Logs: docker compose logs docs - Container Status: docker ps -a docs - Reverse Proxy: https://immich.app/docs/administration/reverse-proxy - Code Formatting https://support.discord.com/hc/en-us/articles/210298617-Markdown-Text-101-Chat-Formatting-Bold-Italic-Underline#h_01GY0DAKGXDEHE263BCAYEGFJA Checklist I have... 1. :ballot_box_with_check: verified I'm on the latest release(note that mobile app releases may take some time). 2. :ballot_box_with_check: read applicable release notes. 3. :ballot_box_with_check: reviewed the FAQs for known issues. 4. :ballot_box_with_check: reviewed Github for known issues. 5. :ballot_box_with_check: tried accessing Immich via local ip (without a custom reverse proxy). 6. :ballot_box_with_check: uploaded the relevant information (see below). 7. :ballot_box_with_check: tried an incognito window, disabled extensions, cleared mobile app cache, logged out and back in, different browsers, etc. as applicable (an item can be marked as "complete" by reacting with the appropriate number) Information In order to be able to effectively help you, we need you to provide clear information to show what the problem is. The exact details needed vary per case, but here is a list of things to consider: - Your docker-compose.yml and .env files. - Logs from all the containers and their status (see above). - All the troubleshooting steps you've tried so far. - Any recent changes you've made to Immich or your system. - Details about your system (both software/OS and hardware). - Details about your storage (filesystems, type of disks, output of commands like fdisk -l and df -h). - The version of the Immich server, mobile app, and other relevant pieces. - Any other information that you think might be relevant. Please paste files and logs with proper code formatting, and especially avoid blurry screenshots. Without the right information we can't work out what the problem is. Help us help you ;) If this ticket can be closed you can use the /close command, and re-open it later if needed. Successfully submitted, a tag has been added to inform contributors. :white_check_mark:
snapdragon
snapdragonOP2w ago
uname -a : Linux odroidn2 6.6.16-current-meson64 #1 SMP PREEMPT Mon Feb 5 20:14:39 UTC 2024 aarch64 aarch64 aarch64 GNU/Linux lsb_release -a No LSB modules are available. Distributor ID: Ubuntu Description: Ubuntu 22.04.3 LTS Release: 22.04 Codename: jammy root@odroidn2:/home/afawaz/docker/immich-app# df -h Filesystem Size Used Avail Use% Mounted on tmpfs 372M 13M 360M 4% /run /dev/mmcblk1p1 57G 14G 43G 24% / tmpfs 1.9G 0 1.9G 0% /dev/shm tmpfs 5.0M 0 5.0M 0% /run/lock tmpfs 1.9G 2.8M 1.9G 1% /tmp /dev/zram1 47M 38M 6.3M 86% /var/log overlay 57G 14G 43G 24% /var/lib/docker/overlay2/d7e96fefd7d03fd66a6026db5447a0dfc436144254111f6b11db63ac9ca3df5e/merged tmpfs 372M 4.0K 372M 1% /run/user/1000 overlay 57G 14G 43G 24% /var/lib/docker/overlay2/a44d68510f6edff8c44b97d508ee03388a458e2bff835b871a77dc87f4006d03/merged overlay 57G 14G 43G 24% /var/lib/docker/overlay2/df9587fa7f4da546be85dbaf3975ddb3b17b6593d71f98f40191e47615e17fd2/merged overlay 57G 14G 43G 24% /var/lib/docker/overlay2/ff5b4ee79a9a93b6499aba61428a9240a2bb1be206102f5731e7fc63e37dd1fa/merged overlay 57G 14G 43G 24% /var/lib/docker/overlay2/fb7d32ef87fba82da8e46c597ab7d50ec924ed5b9fb827e269c426941c55e60e/merged overlay 57G 14G 43G 24% /var/lib/docker/overlay2/0d749f9d2fa3ac52954b78f090d10f7524c4559a7ba5f251d416866ad551f095/merged overlay 57G 14G 43G 24% /var/lib/docker/overlay2/377c0019f40d1689b8f29be30a24d251d215f58686cf892a4a7e6e6a90eea4f0/merged
.env UPLOAD_LOCATION=/volume1/docker/immich-app/library DB_DATA_LOCATION=./immich-app/postgres TZ=Etc/CET IMMICH_VERSION=release DB_PASSWORD=my password DB_USERNAME=postgres DB_DATABASE_NAME=immich
snapdragon
snapdragonOP2w ago
snapdragon
snapdragonOP2w ago
anyone please ? 🙏

Did you find this page helpful?