Closed DutchComputerKid closed 1 year ago
@DutchComputerKid
The settings in airsonic.properties won't reflect the Spring configurations. You need to append
-Dspring.servlet.multipart.max-file-size=2048MB -Dspring.servlet.multipart.max-request-size=2048MB
to JAVA_OPTS.
How did you specify these in /etc/airsonic/default
or /etc/systemd/airsonic.service
?
You can also try SPRING_SERVLET_MULTIPART_MAX_FILE_SIZE
and SPRING_SERVLET_MULTIPART_MAX_REQUEST_SIZE
environment variables. Don't know where to put it in systemd, though.
@DutchComputerKid The settings in airsonic.properties won't reflect the Spring configurations. You need to append
-Dspring.servlet.multipart.max-file-size=2048MB -Dspring.servlet.multipart.max-request-size=2048MB
toJAVA_OPTS.
How did you specify these in/etc/airsonic/default
or/etc/systemd/airsonic.service
?
Yep, tried that both in the .service file and in airsonic's own config file in /etc/defaults/airsonic. No change. The .service file reads /etc/default/airsonic, or by default its set to /etc/sysconfig/airsonic but that does not apply to Debian systems. That uses /etc/default as explained in the how to for configuring Airsonic.
You can also try
SPRING_SERVLET_MULTIPART_MAX_FILE_SIZE
andSPRING_SERVLET_MULTIPART_MAX_REQUEST_SIZE
environment variables. Don't know where to put it in systemd, though.
No change either.
@DutchComputerKid
Could you paste the exact contents of either /etc/systemd/airsonic.service
or /etc/default/airsonic
that you tried?
@DutchComputerKid In my environment, the parameters are correctly applied, and I can successfully upload files up to 1GB in size. I would like to know more about how you configured it. Could you please paste the actual configuration file you tried ?
Excuse the delay,
Simple, https://airsonic.github.io/docs/install/war-standalone/ The .service file as listed and installed here in the documentation, and the /etc/default/airsonic configuration: (which should be generated upon installation anyway)
#JAVA_JAR=/var/airsonic/airsonic.war
# Set any java opts separated by spaces
JAVA_OPTS=-Xmx4096m
# 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=4534
# Change the path that is listened on
#CONTEXT_PATH=/airsonic
# 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=-Dserver.forward-headers-strategy=native
# 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
Attemped configuration headers to JAVA_ARGS and hardcoded in the .service file do nothing for both files. Of course the .service file will need to point to /etc/default, not /etc/sysconfig.
I am also seeing the same problem and I have configured my options in my service file (/etc/default/airsonic is all comments) and my service files is as follows:
[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=-Xmx2048m -Dspring.servlet.multipart.max-file-size=2048MB -Dspring.servlet.multipart.max-request-size=2048MB"
Environment="AIRSONIC_HOME=/var/airsonic"
Environment="HOST=127.0.0.1"
Environment="PORT=4040"
Environment="CONTEXT_PATH=/"
#Environment="CONTEXT_PATH=/airsonic"
Environment="JAVA_ARGS="
EnvironmentFile=-/etc/default/airsonic
ExecStart=/usr/bin/java \
$JAVA_OPTS \
-Dairsonic.home=${AIRSONIC_HOME} \
-Dserver.servlet.contextPath=${CONTEXT_PATH} \
-Dserver.port=${PORT} \
-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=/home/airsonic /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
@khers @DutchComputerKid
I tried the following configuration. In my test environment, Airsonic runs as the root user on a machine with limited memory. Therefore, I commented out the 'User' and 'Group' options and adjusted the memory settings based on @khers's comment.
[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 -Dspring.servlet.multipart.max-file-size=2048MB -Dspring.servlet.multipart.max-request-size=2048MB"
Environment="AIRSONIC_HOME=/var/airsonic"
Environment="HOST=127.0.0.1"
Environment="PORT=4040"
Environment="CONTEXT_PATH=/"
#Environment="CONTEXT_PATH=/airsonic"
Environment="JAVA_ARGS="
EnvironmentFile=-/etc/default/airsonic
ExecStart=/usr/bin/java \
$JAVA_OPTS \
-Dairsonic.home=${AIRSONIC_HOME} \
-Dserver.servlet.contextPath=${CONTEXT_PATH} \
-Dserver.port=${PORT} \
-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=/home/airsonic /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
# Set the location of the standalone war to use
#JAVA_JAR=/var/airsonic/airsonic.war
# Set any java opts separated by spaces
#JAVA_OPTS=-Xmx700m
# 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=8080
# Change the path that is listened on
#CONTEXT_PATH=/airsonic
# 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
I started airsonic.service and checked status by systemctl status airsonic
.
airsonic.service - Airsonic Media Server
Loaded: loaded (/etc/systemd/system/airsonic.service; disabled; vendor preset: enabled)
Active: active (running) since Sun 2023-09-03 13:57:24 UTC; 4min 39s ago
Main PID: 1750131 (java)
Tasks: 56 (limit: 14152)
Memory: 1.6G
CPU: 1min 53.022s
CGroup: /system.slice/airsonic.service
└─1750131 /usr/bin/java -Xmx700m -Dspring.servlet.multipart.max-file-size=2048MB -Dspring.servlet.multipart.max-request-size=2048MB -Dairsonic.home=/var/airsonic -Dserver.servlet.contextPath=/ -Dserver.port=4040 -jar /var/airsonic/airsonic.war
What I want you to check is whether the output of systemctl status airsonic
contains -Dspring.servlet.multipart.max-file-size=2048MB -Dspring.servlet.multipart.max-request- size=2048MB
is included? In my environment, the setting is reflected and files over 500MB are successfully uploaded.
Thanks for the suggestion, this found the problem. I had updated the service file, but not reloaded the systemd daemon so :
# systemctl status airsonic
Warning: The unit file, source configuration file or drop-ins of airsonic.service changed on disk. Run 'systemctl daemon-reload' to reload units.
● airsonic.service - Airsonic Media Server
Loaded: loaded (/etc/systemd/system/airsonic.service; enabled; vendor preset: enabled)
Active: active (running) since Thu 2023-08-31 20:24:25 UTC; 2 days ago
Main PID: 33656 (java)
Tasks: 82 (limit: 4558)
Memory: 2.7G
CPU: 33min 2.113s
CGroup: /system.slice/airsonic.service
└─33656 /usr/bin/java -Xmx2048m -Dairsonic.home=/var/airsonic -Dserver.servlet.contextPath=/ -Dserver.port=4040 -jar /var/airsonic/airsonic.war
Note the warning from systemd. after running systemctl daemon-reload
I now see:
# systemctl status airsonic
● airsonic.service - Airsonic Media Server
Loaded: loaded (/etc/systemd/system/airsonic.service; enabled; vendor preset: enabled)
Active: active (running) since Sun 2023-09-03 15:36:53 UTC; 1min 14s ago
Main PID: 63240 (java)
Tasks: 53 (limit: 4558)
Memory: 939.0M
CPU: 2min 3.560s
CGroup: /system.slice/airsonic.service
└─63240 /usr/bin/java -Xmx2048m -Dspring.servlet.multipart.max-file-size=2048MB -Dspring.servlet.multipart.max-request-size=2048MB -Dairsonic.home=/var/airsonic -Dserver.servlet.contextPath=/ -Dserver.port=4040 -jar /var/airsonic/airsonic.war
And uploading a larger file now works. However, the progress bar that used to so the upload no longer seems to be there.
Well then.
By comparing @khers and my configs, I noticed his config was adding the file limit BEFORE the jar file, whereas i was getting them at the end of the command.
Changed them around, and it works now. Still using /etc/default/airsonic but now its:
# Set any java opts separated by spaces JAVA_OPTS=-Xmx4096m -Dspring.servlet.multipart.max-file-size=2048MB -Dspring.servlet.multipart.max-request-size=2048MB
Instead of adding it to JAVA_ARGS=-
, which does not work. Now I wonder if that is mentioned anywhere.
As for the progress bar, that has not really worked, even on Subsonic 6.1, the 'paid' version. (It can be cracked externally). Often it only counts or 'kicks in' when the unzipping begins, there is likely no progress bar for uploads at all.
This issue turned out to be a configuration problem, not a bug, so I'll be closing it. The progress bar concerns are separate, and I'll address them in a different issue.
What happened?
Any user will try to upload any zip bigger than 512Mb and fail every time. Changing /etc/systemd/airsonic.service or /etc/default/airsonic does nothing.
Tried:
And
But whatever is changed, it will not listen and stay at its default 512MB.
Steps to reproduce
Version
11.1.x (Edge)
Version Detail
11.1.3-SNAPSHOT.20230819133230
Operating System
Debian 12
Java Version
OpenJDK 64-Bit Server VM (build 17.0.8+7-Debian-1deb12u1, mixed mode, sharing)
Database
Other
DB Detail
Built-In
Configuration paramter
Proxy Server
NGINX
client detail
Firefox / Chrome
language
English
Relevant log output