kagemomiji / airsonic-advanced

airsonic-advanced
GNU General Public License v3.0
175 stars 15 forks source link

[Bug]: Import of a large m3u playlist results in java.lang.NullPointerException: null #461

Open litebito opened 6 months ago

litebito commented 6 months ago

What happened?

Importing a large m3u playlist failed.

 Failed to auto-import playlist /data/mstream_data/_MusicPlaylists/(a) My A Collection.m3u

java.lang.NullPointerException: null

The playlist is was importing in the past without issues, after adding about 20 songs to it it started to fail, and shows 0 in the UI.

As a note : the file is now 7872 lines long

Steps to reproduce

  1. run a "scan media folders now"

Version

11.1.4-SNAPSHOT (Edge)

Version Detail

11.1.4-SNAPSHOT.20240512134012

Operating System

CentOS 7

Java Version

OpenJDK Runtime Environment 21.9 (build 18.0.2+9)

Database

Other

DB Detail

internal db

Configuration paramter

# cat /etc/sysconfig/airsonic
# Set the location of the standalone war to use
JAVA_JAR=/var/airsonic/airsonic.war

# Set any java opts separated by spaces
JAVA_OPTS=-Xmx3048m -Xms3048m

# Set a different location for airsonic home.
# If this path is /var/libresonic or even contains "libresonic",
# the data from a previous libresonic can be used as is (i.e. without
# renaming libresonic.properties,db/libresonic*,etc
AIRSONIC_HOME=/var/airsonic

# Change the port to listen on
PORT=14040

# Change the path that is listened on
CONTEXT_PATH=/

# Add any java args. These are different than JAVA_OPTS in that
# they are passed directly to the program. The default is empty:
#JAVA_ARGS=

# Note that there are several settings for spring boot, not explicitly listed
# here, but can be used in either JAVA_OPTS or JAVA_ARGS. The full list
# can be found here:
# https://docs.spring.io/spring-boot/docs/1.4.5.RELEASE/reference/htmlsingle/#common-application-properties
# For example to set debug across the board:
#JAVA_ARGS=--debug

# Or to change the ip address that is listened on:
#JAVA_ARGS=--server.address=127.0.0.1

JAVA_ARGS=--logging.level.org.airsonic=info

# cat /etc/systemd/system/airsonic.service
[Unit]
Description=Airsonic Media Server
After=remote-fs.target network.target
AssertPathExists=/var/airsonic

[Service]
Type=simple
Environment="JAVA_JAR=/var/airsonic/airsonic.war"
Environment="JAVA_OPTS=-Xmx700m"
Environment="AIRSONIC_HOME=/var/airsonic"
Environment="PORT=8080"
Environment="CONTEXT_PATH=/airsonic"
Environment="JAVA_ARGS="
EnvironmentFile=-/etc/sysconfig/airsonic
ExecStart=/usr/bin/java \
          $JAVA_OPTS \
          -Dairsonic.home=${AIRSONIC_HOME} \
          -Dserver.servlet.contextPath=${CONTEXT_PATH} \
          -Dserver.port=${PORT} \
          -Dfile.encoding=UTF-8 \
          -Dsun.jnu.encoding=UTF-8 \
          -jar ${JAVA_JAR} $JAVA_ARGS
User=airsonic
Group=airsonic

# See https://www.freedesktop.org/software/systemd/man/systemd.exec.html
# for details
DevicePolicy=closed
DeviceAllow=char-alsa rw
NoNewPrivileges=yes
PrivateTmp=yes
PrivateUsers=yes
ProtectControlGroups=yes
ProtectKernelModules=yes
ProtectKernelTunables=yes
RestrictAddressFamilies=AF_UNIX AF_INET AF_INET6
RestrictNamespaces=yes
RestrictRealtime=yes
SystemCallFilter=~@clock @debug @module @mount @obsolete @privileged @reboot @setuid @swap
ReadWritePaths=/var/airsonic

# You can uncomment the following line if you're not using the jukebox
# This will prevent airsonic from accessing any real (physical) devices
#PrivateDevices=yes

# You can change the following line to `strict` instead of `full`
# if you don't want airsonic to be able to
# write anything on your filesystem outside of AIRSONIC_HOME.
ProtectSystem=full

# You can uncomment the following line if you don't have any media
# in /home/…. This will prevent airsonic from ever reading/writing anything there.
ProtectHome=true

# You can uncomment the following line if you're not using the OpenJDK.
# This will prevent processes from having a memory zone that is both writeable
# and executeable, making hacker's lifes a bit harder.
#MemoryDenyWriteExecute=yes

[Install]
WantedBy=multi-user.target

#

Proxy Server

No response

client detail

No response

language

None

Relevant log output

Failed to auto-import playlist /data/mstream_data/_MusicPlaylists/(a) My A Collection.m3u

java.lang.NullPointerException: null
litebito commented 6 months ago

I'm migrating to a new server: CentOS 9 Stream, and Postgres as a DB backend On this new server setup, the error does not show up, and the Imported playlist shows all (7861) songs. (so no java.lang.NullPointerException: null error during import for now on the new server)

thewriteway commented 5 months ago

Did you manage to capture any additional logging information? It would help to list out the rest of the log from that timeframe. Unfortunately that error message shown is too generic to know what could be causing the problem.

litebito commented 5 months ago

Hi, There was not a lot of logging before the error. I'll try to enable debugging if I see the error again