[Bug]: Web client has repeated socket disconnects #2027

Closed
opened 2026-04-25 00:02:36 +02:00 by adam · 4 comments
Owner

Originally created by @laingc on GitHub (May 31, 2024).

What happened?

The web interface constantly pulses notification banners, flipping between "Socket Disconnected" and "Socket Connected".

Compose File

I am running ABS using docker. Below is my compose file:

---
version: "2.1"
services:
  audiobookshelf:
    image: ghcr.io/advplyr/audiobookshelf:latest
    container_name: audiobookshelf
    environment:
      - PUID=1000
      - PGID=998
      - TZ=Pacific/Auckland
    volumes:
      - "/home/REDACTED/services/audiobookshelf/data/audiobookshelf/config:/config"
      - "/media/REDACTED/media/audiobooks:/audiobooks"
      - "/media/REDACTED/media/podcasts:/podcasts"
      - "/media/REDACTED/media/audiobookshelf_metadata:/metadata"
    labels:
      - "traefik.enable=true"
      - "traefik.http.routers.audiobookshelf-router.entrypoints=web-secure"
      - "traefik.http.routers.audiobookshelf-router.tls.certresolver=letsencrypt"
      - "traefik.http.routers.audiobookshelf-router.tls.domains[0].main=REDACTED"
      - "traefik.http.routers.audiobookshelf-router.service=audiobookshelf"
      - "traefik.http.services.audiobookshelf.loadbalancer.server.port=80"
      - "traefik.http.routers.audiobookshelf-router.rule=Host(`audiobookshelf.REDACTED`)"
    restart: unless-stopped
    networks:
      - traefik_network
networks:
  traefik_network:
    external: true

Example Screenshot

image

What did you expect to happen?

To not have repeated socket connects and disconnects.

Steps to reproduce the issue

  1. Log into the web client

That's all!

Audiobookshelf version

v2.10.1

How are you running audiobookshelf?

Docker

What OS is your Audiobookshelf server hosted from?

Linux

If the issue is being seen in the UI, what browsers are you seeing the problem on?

Chrome

Logs

2024-05-31 22:32:46.491

INFO

[SocketAuthority] Socket 5kcfjhD_VXoCxJiXAAHH disconnected from client "admin" after 2004ms (Reason: transport close)

2024-05-31 22:32:47.487

INFO

[SocketAuthority] Socket Connected 0_hD1py6xbXgf0mFAAHJ

2024-05-31 22:32:47.493

DEBUG

[SocketAuthority] User Online admin

2024-05-31 22:32:47.612

DEBUG

[ApiCacheManager] Array.afterUpsert: Clearing cache

2024-05-31 22:32:49.489

DEBUG

[SocketAuthority] User Offline admin

2024-05-31 22:32:49.489

INFO

[SocketAuthority] Socket 0_hD1py6xbXgf0mFAAHJ disconnected from client "admin" after 2002ms (Reason: transport close)

2024-05-31 22:32:50.256

INFO

[SocketAuthority] Socket Connected NX3D4O0vooR_uDK5AAHL

2024-05-31 22:32:50.261

DEBUG

[SocketAuthority] User Online admin

2024-05-31 22:32:52.259

DEBUG

[SocketAuthority] User Offline admin

2024-05-31 22:32:52.259

INFO

[SocketAuthority] Socket NX3D4O0vooR_uDK5AAHL disconnected from client "admin" after 2004ms (Reason: transport close)

2024-05-31 22:32:53.152

INFO

[SocketAuthority] Socket Connected Y7lrTyzSju9DUmLWAAHN

2024-05-31 22:32:53.157

DEBUG

[SocketAuthority] User Online admin

2024-05-31 22:32:55.154

DEBUG

[SocketAuthority] User Offline admin

2024-05-31 22:32:55.155

INFO

[SocketAuthority] Socket Y7lrTyzSju9DUmLWAAHN disconnected from client "admin" after 2003ms (Reason: transport close)

2024-05-31 22:32:56.457

INFO

[SocketAuthority] Socket Connected UteElNHjPtrWzehRAAHP

2024-05-31 22:32:56.461

DEBUG

[SocketAuthority] User Online admin

2024-05-31 22:32:58.460

DEBUG

[SocketAuthority] User Offline admin

2024-05-31 22:32:58.460

INFO

[SocketAuthority] Socket UteElNHjPtrWzehRAAHP disconnected from client "admin" after 2004ms (Reason: transport close)

2024-05-31 22:32:59.363

INFO

[SocketAuthority] Socket Connected WG-wWznfSEFtNC_nAAHR

2024-05-31 22:32:59.369

DEBUG

[SocketAuthority] User Online admin

Additional Notes

No response

Originally created by @laingc on GitHub (May 31, 2024). ### What happened? The web interface constantly pulses notification banners, flipping between "Socket Disconnected" and "Socket Connected". ## Compose File I am running ABS using docker. Below is my compose file: ``` --- version: "2.1" services: audiobookshelf: image: ghcr.io/advplyr/audiobookshelf:latest container_name: audiobookshelf environment: - PUID=1000 - PGID=998 - TZ=Pacific/Auckland volumes: - "/home/REDACTED/services/audiobookshelf/data/audiobookshelf/config:/config" - "/media/REDACTED/media/audiobooks:/audiobooks" - "/media/REDACTED/media/podcasts:/podcasts" - "/media/REDACTED/media/audiobookshelf_metadata:/metadata" labels: - "traefik.enable=true" - "traefik.http.routers.audiobookshelf-router.entrypoints=web-secure" - "traefik.http.routers.audiobookshelf-router.tls.certresolver=letsencrypt" - "traefik.http.routers.audiobookshelf-router.tls.domains[0].main=REDACTED" - "traefik.http.routers.audiobookshelf-router.service=audiobookshelf" - "traefik.http.services.audiobookshelf.loadbalancer.server.port=80" - "traefik.http.routers.audiobookshelf-router.rule=Host(`audiobookshelf.REDACTED`)" restart: unless-stopped networks: - traefik_network networks: traefik_network: external: true ``` ## Example Screenshot <img width="410" alt="image" src="https://github.com/advplyr/audiobookshelf-app/assets/783876/4c29c30b-617d-47ec-bf1d-8b4cc27eb75d"> ### What did you expect to happen? To not have repeated socket connects and disconnects. ### Steps to reproduce the issue 1. Log into the web client That's all! ### Audiobookshelf version v2.10.1 ### How are you running audiobookshelf? Docker ### What OS is your Audiobookshelf server hosted from? Linux ### If the issue is being seen in the UI, what browsers are you seeing the problem on? Chrome ### Logs ```shell 2024-05-31 22:32:46.491 INFO [SocketAuthority] Socket 5kcfjhD_VXoCxJiXAAHH disconnected from client "admin" after 2004ms (Reason: transport close) 2024-05-31 22:32:47.487 INFO [SocketAuthority] Socket Connected 0_hD1py6xbXgf0mFAAHJ 2024-05-31 22:32:47.493 DEBUG [SocketAuthority] User Online admin 2024-05-31 22:32:47.612 DEBUG [ApiCacheManager] Array.afterUpsert: Clearing cache 2024-05-31 22:32:49.489 DEBUG [SocketAuthority] User Offline admin 2024-05-31 22:32:49.489 INFO [SocketAuthority] Socket 0_hD1py6xbXgf0mFAAHJ disconnected from client "admin" after 2002ms (Reason: transport close) 2024-05-31 22:32:50.256 INFO [SocketAuthority] Socket Connected NX3D4O0vooR_uDK5AAHL 2024-05-31 22:32:50.261 DEBUG [SocketAuthority] User Online admin 2024-05-31 22:32:52.259 DEBUG [SocketAuthority] User Offline admin 2024-05-31 22:32:52.259 INFO [SocketAuthority] Socket NX3D4O0vooR_uDK5AAHL disconnected from client "admin" after 2004ms (Reason: transport close) 2024-05-31 22:32:53.152 INFO [SocketAuthority] Socket Connected Y7lrTyzSju9DUmLWAAHN 2024-05-31 22:32:53.157 DEBUG [SocketAuthority] User Online admin 2024-05-31 22:32:55.154 DEBUG [SocketAuthority] User Offline admin 2024-05-31 22:32:55.155 INFO [SocketAuthority] Socket Y7lrTyzSju9DUmLWAAHN disconnected from client "admin" after 2003ms (Reason: transport close) 2024-05-31 22:32:56.457 INFO [SocketAuthority] Socket Connected UteElNHjPtrWzehRAAHP 2024-05-31 22:32:56.461 DEBUG [SocketAuthority] User Online admin 2024-05-31 22:32:58.460 DEBUG [SocketAuthority] User Offline admin 2024-05-31 22:32:58.460 INFO [SocketAuthority] Socket UteElNHjPtrWzehRAAHP disconnected from client "admin" after 2004ms (Reason: transport close) 2024-05-31 22:32:59.363 INFO [SocketAuthority] Socket Connected WG-wWznfSEFtNC_nAAHR 2024-05-31 22:32:59.369 DEBUG [SocketAuthority] User Online admin ``` ### Additional Notes _No response_
adam added the bug label 2026-04-25 00:02:36 +02:00
adam closed this issue 2026-04-25 00:02:36 +02:00
Author
Owner

@advplyr commented on GitHub (May 31, 2024):

Does this happen when you are not using traefik?

@advplyr commented on GitHub (May 31, 2024): Does this happen when you are not using traefik?
Author
Owner

@laingc commented on GitHub (Jun 1, 2024):

I have just tested this in response to your question, and I can confirm that it does not occur when not behind the traefik reverse proxy.

  1. Are you able to reproduce if you use traefik?
  2. Should I test another reverse proxy, e.g. caddy?
@laingc commented on GitHub (Jun 1, 2024): I have just tested this in response to your question, and I can confirm that it does *not* occur when not behind the traefik reverse proxy. 1. Are you able to reproduce if you use traefik? 2. Should I test another reverse proxy, e.g. caddy?
Author
Owner

@laingc commented on GitHub (Jun 1, 2024):

Update: I have now resolved this by enabling the following Traefik option

traefik.http.middlewares.sslheader.headers.customrequestheaders.X-Forwarded-Proto=https

This is not an audiobookshelf bug, so you can safely close. Hopefully this record helps someone else, though.

Thanks for maintaining audiobookshelf for us all to enjoy 💛

@laingc commented on GitHub (Jun 1, 2024): Update: I have now resolved this by enabling the following Traefik option `traefik.http.middlewares.sslheader.headers.customrequestheaders.X-Forwarded-Proto=https` This is not an audiobookshelf bug, so you can safely close. Hopefully this record helps someone else, though. Thanks for maintaining audiobookshelf for us all to enjoy 💛
Author
Owner

@advplyr commented on GitHub (Jun 1, 2024):

I typically ask to use local network connection first because if it works on the local network connection it points to it being an issue with the users network setup and not audiobookshelf.

Thanks for following up for others!

@advplyr commented on GitHub (Jun 1, 2024): I typically ask to use local network connection first because if it works on the local network connection it points to it being an issue with the users network setup and not audiobookshelf. Thanks for following up for others!
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/audiobookshelf#2027