multi-scrobbler: bug: multi-scrobbler creates countless empty log files + detects memory leak

Please check existing knowledge before opening an issue

Describe the Bug

multi-scrobbler managed to make my filesystem run out of inodes by creating countless (the ls command literally did not respond for 10+ seconds) empty log files following this naming scheme in the persistent /config/logs/ folder. scrobble-2024-10-27.1000.log I thought maybe my old config clashed with a new version so I deleted the container, renamed the config directory, created a new empty config directory, repulled and redeployed, but the problem persists. This is my compose (I removed the IPs and the API Key).

services: multi-scrobbler: image: foxxmd/multi-scrobbler:latest container_name: multi-scrobbler environment: - TZ=Europe/Berlin - BASE_URL= - MALOJA_URL= - MALOJA_API_KEY= - PUID=1000 - PGID=1000 volumes: - /opt/multi-scrobbler/config:/config #networks: # - (optional to add container to the same bridge network that maloja is inside to be able to use docker internal networking & dns to resolve and connect to maloja URL via http://maloja:port) ports: - 9078:9078 # first port is the HOST port multi-scrobbler will serve UI on restart: unless-stopped

I have no idea what’s going on as until a couple hours prior to this it was successfully syncing lastfm plays to maloja.

Platform

Docker

Versions

multi-scrobbler:latest docker tag, maloja 3.2.2

Logs

[migrations] started
[migrations] no migrations found
───────────────────────────────────────
  _____ __ __ _____ _____ _____ _____ 
 |     |  |  |   __|_   _|     |     |
 |   --|  |  |__   | | | |  |  | | | |
 |_____|_____|_____| |_| |_____|_|_|_|
       _____ __ __ _ __    ____  
      | __  |  |  | |  |  |    \ 
      | __ -|  |  | |  |__|  |  |
      |_____|_____|_|_____|____/ 
  Based on images from linuxserver.io
───────────────────────────────────────
To support LSIO projects visit:
https://www.linuxserver.io/donate/
───────────────────────────────────────
GID/UID
───────────────────────────────────────
User UID:    1000
User GID:    1000
───────────────────────────────────────
-------------------------------------
Setting up multi-scrobbler config directory based on CONFIG_DIR env: /config
Directory is not empty, not creating examples.
chown'ing directory to ensure correct permissions.
Done!
-------------------------------------
[custom-init] No custom files found, skipping...
multi-scrobbler is starting!
[ls.io-init] done.
[2024-10-27 02:43:43.029 +0100] VERBOSE: [Init] Config Dir ENV: /config -> Resolved: /config
[2024-10-27 02:43:43.050 +0100] INFO   : [Init] Version: 0.8.6
[2024-10-27 02:43:43.051 +0100] INFO   : [Init] Generating schema definitions...
[2024-10-27 02:43:45.094 +0100] INFO   : [Init] Schema definitions generated
Warning: connect.session() MemoryStore is not
designed for a production environment, as it will leak
memory, and will not scale past a single process.
2:43:45 AM [vite-express] Running in production mode
2:43:45 AM [vite-express] Inline config detected, ignoring Vite config file
2:43:45 AM [vite-express] Serving static files from /app/dist
[2024-10-27 02:43:45.129 +0100] INFO   : [App] [API] Server started:
---> Local          http://localhost:9078
---> Network        http://172.24.0.2:9078
      
--- HINT ---
MS is likely being run in a container with BRIDGE networking which means the above addresses are not accessible from outside this container.
To ensure the container is accessible make sure you have mapped the *container* port 9078 to a *host* port. https://foxxmd.github.io/multi-scrobbler/docs/installation#networking
The container will then be accessible at http://HOST_MACHINE_IP:HOST_PORT (or http://redacted:9078/ since you defined this!)
      
--- HINT ---
[2024-10-27 02:43:45.131 +0100] INFO   : [App] [API] User-defined base URL for UI and redirect URLs (spotify, deezer, lastfm): http://redacted:9078/
[2024-10-27 02:43:45.168 +0100] DEBUG  : [App] [Scrobblers] Constructing maloja (unnamed-mlj) client...
[2024-10-27 02:43:45.170 +0100] INFO   : [App] [Scrobblers] [Maloja - unnamed-mlj] Client Added
[2024-10-27 02:43:45.171 +0100] INFO   : [App] Starting scrobble clients...
[2024-10-27 02:43:45.172 +0100] DEBUG  : [App] [Scrobblers] [Maloja - unnamed-mlj] Attempting to initialize...
[2024-10-27 02:43:45.173 +0100] VERBOSE: [App] [Scrobblers] [Maloja - unnamed-mlj] Building required data init succeeded
[2024-10-27 02:43:45.189 +0100] INFO   : [App] [Scrobblers] [Maloja - unnamed-mlj] Communication test succeeded.
[2024-10-27 02:43:45.190 +0100] INFO   : [App] [Scrobblers] [Maloja - unnamed-mlj] Maloja Server Version: 3.2.2
[2024-10-27 02:43:45.196 +0100] VERBOSE: [App] [Scrobblers] [Maloja - unnamed-mlj] Connection check succeeded
[2024-10-27 02:43:45.200 +0100] INFO   : [App] [Scrobblers] [Maloja - unnamed-mlj] Auth test passed!
[2024-10-27 02:43:45.201 +0100] INFO   : [App] [Scrobblers] [Maloja - unnamed-mlj] Fully Initialized!
[2024-10-27 02:43:45.202 +0100] VERBOSE: [App] [Scrobblers] [Maloja - unnamed-mlj] Fetching up to 100 initial scrobbles...
[2024-10-27 02:43:45.202 +0100] DEBUG  : [App] [Scrobblers] [Maloja - unnamed-mlj] Refreshing recent scrobbles
[2024-10-27 02:43:45.212 +0100] DEBUG  : [App] [Scrobblers] [Maloja - unnamed-mlj] Found 100 recent scrobbles
[2024-10-27 02:43:45.215 +0100] INFO   : [App] [Scrobblers] [Maloja - unnamed-mlj] Scrobble processing started
[2024-10-27 02:43:45.237 +0100] INFO   : [App] [Sources] Finished initializing sources
[2024-10-27 02:43:45.238 +0100] INFO   : [App] Scheduler started.
(node:184) MaxListenersExceededWarning: Possible EventEmitter memory leak detected. 11 ready listeners added to [SonicBoom]. Use emitter.setMaxListeners() to increase limit
(Use `node --trace-warnings ...` to show where the warning was created)
(node:184) MaxListenersExceededWarning: Possible EventEmitter memory leak detected. 11 ready listeners added to [SonicBoom]. Use emitter.setMaxListeners() to increase limit
(node:184) MaxListenersExceededWarning: Possible EventEmitter memory leak detected. 11 ready listeners added to [SonicBoom]. Use emitter.setMaxListeners() to increase limit
(node:184) MaxListenersExceededWarning: Possible EventEmitter memory leak detected. 11 ready listeners added to [SonicBoom]. Use emitter.setMaxListeners() to increase limit
(node:184) MaxListenersExceededWarning: Possible EventEmitter memory leak detected. 11 ready listeners added to [SonicBoom]. Use emitter.setMaxListeners() to increase limit
(node:184) MaxListenersExceededWarning: Possible EventEmitter memory leak detected. 11 ready listeners added to [SonicBoom]. Use emitter.setMaxListeners() to increase limit
(node:184) MaxListenersExceededWarning: Possible EventEmitter memory leak detected. 11 ready listeners added to [SonicBoom]. Use emitter.setMaxListeners() to increase limit
(node:184) MaxListenersExceededWarning: Possible EventEmitter memory leak detected. 11 ready listeners added to [SonicBoom]. Use emitter.setMaxListeners() to increase limit
(node:184) MaxListenersExceededWarning: Possible EventEmitter memory leak detected. 11 ready listeners added to [SonicBoom]. Use emitter.setMaxListeners() to increase limit

Additional Context

No response

About this issue

  • Original URL
  • State: closed
  • Created 2 years ago
  • Reactions: 3
  • Comments: 25 (5 by maintainers)

Commits related to this issue

Most upvoted comments

Confirming. happened to me too yesterday. But I didnt even update, so why is it happening to all of us at the same time? Is it maybe because of the time change?

bingo.

Offending lines in the pino-roll dependency:

https://github.com/mcollina/pino-roll/blob/ddc07b51976d2ea409762b6389622ce1c9d5aa81/lib/utils.js#L28-L29

const start = today.setHours(0, 0, 0, 0)
return { frequency, start, next: getNextDay(start) }

[...]

function getNextDay (start) {
  return new Date(start + 24 * 60 * 60 * 1000).setHours(0, 0, 0, 0)
}

It calculates tomorrow’s date by adding 24 hours to the previous midnight, but today is the one day of the year (in Europe) that’s 25 hours long.

So good news, it’ll magically fix itself at midnight. Bad news, the same bug will trigger for users in the US next weekend.

This issue should be fixed in the latest foxxmd/multi-scrobbler:edge docker image and master branch. I’ll cut a release for it tomorrow or wednesday.

Thanks for the confirmation 👍 I’m still on my first cup of coffee and waking up. Working on creating a reproducible example for pino-roll.

it’ll magically fix itself at midnight.

Can confirm, its fixed now. Till the next year I guess 😃

remember that there is a time shift in spring too. 😃

yes, but for that case is a 23 hours day, so at least it would not be the same issue, maybe an issue, but not the same 🤣

Confirming. happened to me too yesterday. But I didnt even update, so why is it happening to all of us at the same time? Is it maybe because of the time change?

"build_version": "Linuxserver.io version:- 4df2f176-ls37 Build-date:- 2024-07-12T07:56:51+00:00", "com.docker.compose.config-hash": "26c6ee3206d196f7ec1ffbc5bedd8a888221f1088f7e0d6d2f4ba4c1ec0320e6", "com.docker.compose.container-number": "1", "com.docker.compose.depends_on": "", "com.docker.compose.image": "sha256:8e1a704da8689e87bb38c07b907f48934128a3ae28f60bfaf2cfa35830c39d0a", "com.docker.compose.oneoff": "False", "com.docker.compose.project": "mediaserver", "com.docker.compose.service": "multi-scrobbler", "com.docker.compose.version": "2.29.1", "maintainer": "TheLamer", "org.opencontainers.image.authors": "linuxserver.io", "org.opencontainers.image.created": "2024-07-18T18:19:50.386Z", "org.opencontainers.image.description": "Scrobble plays from multiple sources to multiple clients", "org.opencontainers.image.documentation": "https://docs.linuxserver.io/images/docker-baseimage-debian", "org.opencontainers.image.licenses": "MIT", "org.opencontainers.image.ref.name": "8c8d587ef08111a2b011f1a425aab7b7e8710cc0", "org.opencontainers.image.revision": "729250a2ccb2d3c8030baf7a5b07ddfcbbd53977", "org.opencontainers.image.source": "https://github.com/FoxxMD/multi-scrobbler", "org.opencontainers.image.title": "multi-scrobbler", "org.opencontainers.image.url": "https://github.com/FoxxMD/multi-scrobbler", "org.opencontainers.image.vendor": "linuxserver.io", "org.opencontainers.image.version": "latest"

This is fixed in 0.8.7

I’ve logged the issue on pino-roll and have a PR opened to fix the Standard Time -> DST issue as well as test for DST -> Standard that will occur in March https://github.com/mcollina/pino-roll/pull/96

The pino-roll owner is pretty responsive so I imagine it’ll be merged shortly but if it’s not in by tomorrow/wednesday I’ll hotfix with a patch in multi-scrobbler so USA users can update before this coming weekend.

@megatwig may be right but I also use my own file formatting based on date so this might be the culprit too. I’m investigating and attempting to reproduce.

Your code works fine (at least for the default config). I tried patching pino-roll locally last night to do .setDate(+1) instead of .setHours(+24) and the bug went away.