kagemomiji / airsonic-advanced

airsonic-advanced
GNU General Public License v3.0
152 stars 14 forks source link

[Bug]: Airsonic will not listen to increased file upload limits. #267

Closed DutchComputerKid closed 1 year ago

DutchComputerKid commented 1 year ago

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:

spring.servlet.multipart.max-file-size=2048MB
spring.servlet.multipart.max-request-size=2048MB

And

spring.http.multipart.max-file-size=2048MB
spring.http.multipart.max-request-size=2048MB

But whatever is changed, it will not listen and stay at its default 512MB.

Steps to reproduce

  1. Upload any file bigger than 512MB
  2. Try to change the upload limit in /etc/systemd/airsonic.service or /etc/default/airsonic
  3. Nothing changes.

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

# Airsonic preferences.  NOTE: This file is automatically generated. Do not modify while application is running

JWTKey=
SettingsChanged=
EncryptionKeyPassword=
EncryptionKeySalt=
IndexCreationInterval=1
IndexCreationHour=3
FastCacheEnabled=false
OrganizeByFolderStructure=true
UploadsFolder=/mnt/media/Uploads
ExcludePattern=
IgnoreSymLinks=false
EnableCueIndexing=false
HideIndexedFiles=false
GettingStartedEnabled=false
IndexString=A B C D E F G H I J K L M N O P Q R S T U V W X-Z(XYZ)
IgnoredArticles=The El La Los Las Le Les
GenreSeparators=; , /
Shortcuts=New Incoming Podcast
PlaylistFolder=/var/playlists
MusicFileTypes=mp3 ogg oga aac m4a m4b flac wav wma aif aiff ape mpc shn mka opus alm 669 mdl far xm mod fnk imf it liq wow mtm ptm rtm stm s3m ult dmf dbm med okt emod sfx m15 mtn amf gdm stx gmc psm j2b umx amd rad hsc flx gtk mgt mtp wv dsf
VideoFileTypes=flv avi mpg mpeg mp4 m4v mkv mov wmv ogv divx m2ts webm
CoverArtFileTypes2=cover.jpg cover.png cover.gif folder.jpg jpg jpeg gif png
CoverArtSource=FILETAG
CoverArtConcurrency=4
CoverArtQuality=100
SortAlbumsByYear=true
WelcomeTitle=Welcome to Airsonic!
WelcomeSubtitle=
WelcomeMessage2=
LoginMessage=
server.servlet.session.timeout=60m
Theme=slick
LocaleLanguage=en
LocaleCountry=
LocaleVariant=
DownloadBitrateLimit=0
UploadBitrateLimit=0
LdapEnabled=false
LdapUrl=ldap://host.domain.com:389/cn=Users,dc=domain,dc=com
LdapSearchFilter=(sAMAccountName={0})
LdapManagerDn=
LdapAutoShadowing=false
SmtpServer=smtp.mailbox.org
SmtpEncryption=STARTTLS
SmtpPort=587
SmtpUser=
SmtpFrom=
SmtpPassword=
CaptchaEnabled=false
ReCaptchaSiteKey=
SplitOptions=-ss %o -t %d
SplitCommand=ffmpeg %S -i %s -vcodec copy -acodec copy -f %f -
DownsamplingCommand4=ffmpeg %S -i %s -map 0:0 -b:a %bk -v 0 -f mp3 -
HlsCommand4=ffmpeg -ss %o -i %s -s %wx%h -async 1 -c:v libx264 -flags +cgop -b:v %vk -maxrate %bk -preset superfast -copyts -b:a %rk -bufsize 256k -map 0:0 -map 0:%i -ac 2 -ar 44100 -v 0 -threads 0 -force_key_frames expr:gte(t,n_forced*10) -start_number %j -hls_time %d -hls_list_size 0 -hls_segment_filename %n %p
JukeboxCommand2=ffmpeg -ss %o -i %s -map 0:0 -v 0 -ar 44100 -ac 2 -f s16be -
VideoImageCommand=ffmpeg -r 1 -ss %o -t 1 -i %s -s %wx%h -v 0 -f mjpeg -
SubtitlesExtractionCommand=ffmpeg -i %s -map 0:%i -f %f -
TranscodeEstimateTimePadding=2000
TranscodeEstimateBytePadding=0
PodcastUpdateInterval=24
PodcastEpisodeRetentionCount=10
PodcastEpisodeDownloadCount=10
FullScan=false
ClearFullScanSettingAfterScan=false
spring.liquibase.parameters.mysqlVarcharLimit=384
DbBackupUpdateInterval=168
DbBackupRetentionCount=2
#spring.http.multipart.max-file-size=2048MB
#spring.http.multipart.max-request-size=2048MB
spring.servlet.multipart.max-file-size=2048MB
spring.servlet.multipart.max-request-size=2048MB
#spring.servlet.multipart.max-file-size=512MB
#spring.servlet.multipart.max-request-size=512MB

Proxy Server

NGINX

client detail

Firefox / Chrome

language

English

Relevant log output

org.springframework.web.multipart.MaxUploadSizeExceededException: Maximum upload size exceeded; nested exception is java.lang.IllegalStateException: org.apache.tomcat.util.http.fileupload.impl.SizeLimitExceededException: the request was rejected because its size (599711231) exceeds the configured maximum (536870912)
        at org.springframework.web.multipart.support.StandardMultipartHttpServletRequest.handleParseFailure(StandardMultipartHttpServletRequest.java:124) ~[spring-web-5.3.29.jar!/:5.3.29]
        at org.springframework.web.multipart.support.StandardMultipartHttpServletRequest.parseRequest(StandardMultipartHttpServletRequest.java:115) ~[spring-web-5.3.29.jar!/:5.3.29]
        at org.springframework.web.multipart.support.StandardMultipartHttpServletRequest.<init>(StandardMultipartHttpServletRequest.java:88) ~[spring-web-5.3.29.jar!/:5.3.29]
        at org.springframework.web.multipart.support.StandardServletMultipartResolver.resolveMultipart(StandardServletMultipartResolver.java:122) ~[spring-web-5.3.29.jar!/:5.3.29]
        at org.springframework.web.servlet.DispatcherServlet.checkMultipart(DispatcherServlet.java:1210) ~[spring-webmvc-5.3.29.jar!/:5.3.29]
        at org.springframework.web.servlet.DispatcherServlet.doDispatch(DispatcherServlet.java:1044) ~[spring-webmvc-5.3.29.jar!/:5.3.29]
        at org.springframework.web.servlet.DispatcherServlet.doService(DispatcherServlet.java:965) ~[spring-webmvc-5.3.29.jar!/:5.3.29]
        at org.springframework.web.servlet.FrameworkServlet.processRequest(FrameworkServlet.java:1006) ~[spring-webmvc-5.3.29.jar!/:5.3.29]
        at org.springframework.web.servlet.FrameworkServlet.doPost(FrameworkServlet.java:909) ~[spring-webmvc-5.3.29.jar!/:5.3.29]
        at javax.servlet.http.HttpServlet.service(HttpServlet.java:517) ~[jakarta.servlet-api-4.0.4.jar!/:4.0.4]
        at org.springframework.web.servlet.FrameworkServlet.service(FrameworkServlet.java:883) ~[spring-webmvc-5.3.29.jar!/:5.3.29]
        at javax.servlet.http.HttpServlet.service(HttpServlet.java:584) ~[jakarta.servlet-api-4.0.4.jar!/:4.0.4]
        at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:209) ~[tomcat-embed-core-9.0.78.jar!/:na]
        at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:153) ~[tomcat-embed-core-9.0.78.jar!/:na]
        at org.apache.tomcat.websocket.server.WsFilter.doFilter(WsFilter.java:51) ~[tomcat-embed-websocket-9.0.78.jar!/:na]
        at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:178) ~[tomcat-embed-core-9.0.78.jar!/:na]
        at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:153) ~[tomcat-embed-core-9.0.78.jar!/:na]
        at org.airsonic.player.filter.MetricsFilter.doFilter(MetricsFilter.java:30) ~[classes!/:11.1.3-SNAPSHOT]
        at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:178) ~[tomcat-embed-core-9.0.78.jar!/:na]
        at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:153) ~[tomcat-embed-core-9.0.78.jar!/:na]
        at org.airsonic.player.filter.RequestEncodingFilter.doFilter(RequestEncodingFilter.java:45) ~[classes!/:11.1.3-SNAPSHOT]
        at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:178) ~[tomcat-embed-core-9.0.78.jar!/:na]
        at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:153) ~[tomcat-embed-core-9.0.78.jar!/:na]
        at org.airsonic.player.filter.ParameterDecodingFilter.doFilter(ParameterDecodingFilter.java:64) ~[classes!/:11.1.3-SNAPSHOT]
        at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:178) ~[tomcat-embed-core-9.0.78.jar!/:na]
        at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:153) ~[tomcat-embed-core-9.0.78.jar!/:na]
        at org.airsonic.player.filter.BootstrapVerificationFilter.doFilter(BootstrapVerificationFilter.java:63) ~[classes!/:11.1.3-SNAPSHOT]
        at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:178) ~[tomcat-embed-core-9.0.78.jar!/:na]
        at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:153) ~[tomcat-embed-core-9.0.78.jar!/:na]
        at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:337) ~[spring-security-web-5.7.10.jar!/:5.7.10]
        at org.springframework.security.web.access.intercept.FilterSecurityInterceptor.invoke(FilterSecurityInterceptor.java:115) ~[spring-security-web-5.7.10.jar!/:5.7.10]
        at org.springframework.security.web.access.intercept.FilterSecurityInterceptor.doFilter(FilterSecurityInterceptor.java:81) ~[spring-security-web-5.7.10.jar!/:5.7.10]
        at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:346) ~[spring-security-web-5.7.10.jar!/:5.7.10]
        at org.springframework.security.web.access.ExceptionTranslationFilter.doFilter(ExceptionTranslationFilter.java:122) ~[spring-security-web-5.7.10.jar!/:5.7.10]
        at org.springframework.security.web.access.ExceptionTranslationFilter.doFilter(ExceptionTranslationFilter.java:116) ~[spring-security-web-5.7.10.jar!/:5.7.10]
        at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:346) ~[spring-security-web-5.7.10.jar!/:5.7.10]
        at org.springframework.security.web.session.SessionManagementFilter.doFilter(SessionManagementFilter.java:126) ~[spring-security-web-5.7.10.jar!/:5.7.10]
        at org.springframework.security.web.session.SessionManagementFilter.doFilter(SessionManagementFilter.java:81) ~[spring-security-web-5.7.10.jar!/:5.7.10]
        at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:346) ~[spring-security-web-5.7.10.jar!/:5.7.10]
        at org.springframework.security.web.authentication.AnonymousAuthenticationFilter.doFilter(AnonymousAuthenticationFilter.java:109) ~[spring-security-web-5.7.10.jar!/:5.7.10]
        at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:346) ~[spring-security-web-5.7.10.jar!/:5.7.10]
        at org.springframework.security.web.authentication.rememberme.RememberMeAuthenticationFilter.doFilter(RememberMeAuthenticationFilter.java:106) ~[spring-security-web-5.7.10.jar!/:5.7.10]
        at org.springframework.security.web.authentication.rememberme.RememberMeAuthenticationFilter.doFilter(RememberMeAuthenticationFilter.java:97) ~[spring-security-web-5.7.10.jar!/:5.7.10]
        at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:346) ~[spring-security-web-5.7.10.jar!/:5.7.10]
        at org.springframework.security.web.servletapi.SecurityContextHolderAwareRequestFilter.doFilter(SecurityContextHolderAwareRequestFilter.java:149) ~[spring-security-web-5.7.10.jar!/:5.7.10]
        at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:346) ~[spring-security-web-5.7.10.jar!/:5.7.10]
        at org.springframework.security.web.savedrequest.RequestCacheAwareFilter.doFilter(RequestCacheAwareFilter.java:63) ~[spring-security-web-5.7.10.jar!/:5.7.10]
        at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:346) ~[spring-security-web-5.7.10.jar!/:5.7.10]
        at org.springframework.security.web.authentication.AbstractAuthenticationProcessingFilter.doFilter(AbstractAuthenticationProcessingFilter.java:223) ~[spring-security-web-5.7.10.jar!/:5.7.10]
        at org.springframework.security.web.authentication.AbstractAuthenticationProcessingFilter.doFilter(AbstractAuthenticationProcessingFilter.java:217) ~[spring-security-web-5.7.10.jar!/:5.7.10]
        at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:346) ~[spring-security-web-5.7.10.jar!/:5.7.10]
        at org.springframework.security.web.authentication.www.BasicAuthenticationFilter.doFilterInternal(BasicAuthenticationFilter.java:164) ~[spring-security-web-5.7.10.jar!/:5.7.10]
        at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:117) ~[spring-web-5.3.29.jar!/:5.3.29]
        at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:346) ~[spring-security-web-5.7.10.jar!/:5.7.10]
        at org.springframework.security.web.authentication.AbstractAuthenticationProcessingFilter.doFilter(AbstractAuthenticationProcessingFilter.java:223) ~[spring-security-web-5.7.10.jar!/:5.7.10]
        at org.springframework.security.web.authentication.AbstractAuthenticationProcessingFilter.doFilter(AbstractAuthenticationProcessingFilter.java:217) ~[spring-security-web-5.7.10.jar!/:5.7.10]
        at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:346) ~[spring-security-web-5.7.10.jar!/:5.7.10]
        at org.springframework.security.web.authentication.logout.LogoutFilter.doFilter(LogoutFilter.java:103) ~[spring-security-web-5.7.10.jar!/:5.7.10]
        at org.springframework.security.web.authentication.logout.LogoutFilter.doFilter(LogoutFilter.java:89) ~[spring-security-web-5.7.10.jar!/:5.7.10]
        at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:346) ~[spring-security-web-5.7.10.jar!/:5.7.10]
        at org.springframework.security.web.csrf.CsrfFilter.doFilterInternal(CsrfFilter.java:132) ~[spring-security-web-5.7.10.jar!/:5.7.10]
        at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:117) ~[spring-web-5.3.29.jar!/:5.3.29]
        at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:346) ~[spring-security-web-5.7.10.jar!/:5.7.10]
        at org.springframework.web.filter.CorsFilter.doFilterInternal(CorsFilter.java:91) ~[spring-web-5.3.29.jar!/:5.3.29]
        at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:117) ~[spring-web-5.3.29.jar!/:5.3.29]
        at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:346) ~[spring-security-web-5.7.10.jar!/:5.7.10]
        at org.springframework.security.web.header.HeaderWriterFilter.doHeadersAfter(HeaderWriterFilter.java:90) ~[spring-security-web-5.7.10.jar!/:5.7.10]
        at org.springframework.security.web.header.HeaderWriterFilter.doFilterInternal(HeaderWriterFilter.java:75) ~[spring-security-web-5.7.10.jar!/:5.7.10]
        at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:117) ~[spring-web-5.3.29.jar!/:5.3.29]
        at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:346) ~[spring-security-web-5.7.10.jar!/:5.7.10]
        at org.springframework.security.web.context.SecurityContextPersistenceFilter.doFilter(SecurityContextPersistenceFilter.java:112) ~[spring-security-web-5.7.10.jar!/:5.7.10]
        at org.springframework.security.web.context.SecurityContextPersistenceFilter.doFilter(SecurityContextPersistenceFilter.java:82) ~[spring-security-web-5.7.10.jar!/:5.7.10]
        at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:346) ~[spring-security-web-5.7.10.jar!/:5.7.10]
        at org.springframework.security.web.context.request.async.WebAsyncManagerIntegrationFilter.doFilterInternal(WebAsyncManagerIntegrationFilter.java:55) ~[spring-security-web-5.7.10.jar!/:5.7.10]
        at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:117) ~[spring-web-5.3.29.jar!/:5.3.29]
        at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:346) ~[spring-security-web-5.7.10.jar!/:5.7.10]
        at org.springframework.security.web.session.DisableEncodeUrlFilter.doFilterInternal(DisableEncodeUrlFilter.java:42) ~[spring-security-web-5.7.10.jar!/:5.7.10]
        at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:117) ~[spring-web-5.3.29.jar!/:5.3.29]
        at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:346) ~[spring-security-web-5.7.10.jar!/:5.7.10]
        at org.springframework.security.web.FilterChainProxy.doFilterInternal(FilterChainProxy.java:221) ~[spring-security-web-5.7.10.jar!/:5.7.10]
        at org.springframework.security.web.FilterChainProxy.doFilter(FilterChainProxy.java:186) ~[spring-security-web-5.7.10.jar!/:5.7.10]
        at org.springframework.web.filter.DelegatingFilterProxy.invokeDelegate(DelegatingFilterProxy.java:354) ~[spring-web-5.3.29.jar!/:5.3.29]
        at org.springframework.web.filter.DelegatingFilterProxy.doFilter(DelegatingFilterProxy.java:267) ~[spring-web-5.3.29.jar!/:5.3.29]
        at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:178) ~[tomcat-embed-core-9.0.78.jar!/:na]
        at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:153) ~[tomcat-embed-core-9.0.78.jar!/:na]
        at org.springframework.web.filter.RequestContextFilter.doFilterInternal(RequestContextFilter.java:100) ~[spring-web-5.3.29.jar!/:5.3.29]
        at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:117) ~[spring-web-5.3.29.jar!/:5.3.29]
        at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:178) ~[tomcat-embed-core-9.0.78.jar!/:na]
        at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:153) ~[tomcat-embed-core-9.0.78.jar!/:na]
        at org.springframework.web.filter.FormContentFilter.doFilterInternal(FormContentFilter.java:93) ~[spring-web-5.3.29.jar!/:5.3.29]
        at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:117) ~[spring-web-5.3.29.jar!/:5.3.29]
        at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:178) ~[tomcat-embed-core-9.0.78.jar!/:na]
        at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:153) ~[tomcat-embed-core-9.0.78.jar!/:na]
        at org.springframework.web.filter.HiddenHttpMethodFilter.doFilterInternal(HiddenHttpMethodFilter.java:94) ~[spring-web-5.3.29.jar!/:5.3.29]
        at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:117) ~[spring-web-5.3.29.jar!/:5.3.29]
        at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:178) ~[tomcat-embed-core-9.0.78.jar!/:na]
        at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:153) ~[tomcat-embed-core-9.0.78.jar!/:na]
        at org.springframework.boot.actuate.metrics.web.servlet.WebMvcMetricsFilter.doFilterInternal(WebMvcMetricsFilter.java:96) ~[spring-boot-actuator-2.7.14.jar!/:2.7.14]
        at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:117) ~[spring-web-5.3.29.jar!/:5.3.29]
        at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:178) ~[tomcat-embed-core-9.0.78.jar!/:na]
        at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:153) ~[tomcat-embed-core-9.0.78.jar!/:na]
        at org.springframework.web.filter.CharacterEncodingFilter.doFilterInternal(CharacterEncodingFilter.java:201) ~[spring-web-5.3.29.jar!/:5.3.29]
        at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:117) ~[spring-web-5.3.29.jar!/:5.3.29]
        at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:178) ~[tomcat-embed-core-9.0.78.jar!/:na]
        at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:153) ~[tomcat-embed-core-9.0.78.jar!/:na]
        at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:167) ~[tomcat-embed-core-9.0.78.jar!/:na]
        at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:90) ~[tomcat-embed-core-9.0.78.jar!/:na]
        at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:481) ~[tomcat-embed-core-9.0.78.jar!/:na]
        at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:130) ~[tomcat-embed-core-9.0.78.jar!/:na]
        at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:93) ~[tomcat-embed-core-9.0.78.jar!/:na]
        at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:74) ~[tomcat-embed-core-9.0.78.jar!/:na]
        at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:343) ~[tomcat-embed-core-9.0.78.jar!/:na]
        at org.apache.coyote.http11.Http11Processor.service(Http11Processor.java:390) ~[tomcat-embed-core-9.0.78.jar!/:na]
        at org.apache.coyote.AbstractProcessorLight.process(AbstractProcessorLight.java:63) ~[tomcat-embed-core-9.0.78.jar!/:na]
        at org.apache.coyote.AbstractProtocol$ConnectionHandler.process(AbstractProtocol.java:926) ~[tomcat-embed-core-9.0.78.jar!/:na]
        at org.apache.tomcat.util.net.NioEndpoint$SocketProcessor.doRun(NioEndpoint.java:1791) ~[tomcat-embed-core-9.0.78.jar!/:na]
        at org.apache.tomcat.util.net.SocketProcessorBase.run(SocketProcessorBase.java:52) ~[tomcat-embed-core-9.0.78.jar!/:na]
        at org.apache.tomcat.util.threads.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1191) ~[tomcat-embed-core-9.0.78.jar!/:na]
        at org.apache.tomcat.util.threads.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:659) ~[tomcat-embed-core-9.0.78.jar!/:na]
        at org.apache.tomcat.util.threads.TaskThread$WrappingRunnable.run(TaskThread.java:61) ~[tomcat-embed-core-9.0.78.jar!/:na]
        at java.base/java.lang.Thread.run(Thread.java:833) ~[na:na]
Caused by: java.lang.IllegalStateException: org.apache.tomcat.util.http.fileupload.impl.SizeLimitExceededException: the request was rejected because its size (599711231) exceeds the configured maximum (536870912)
        at org.apache.catalina.connector.Request.parseParts(Request.java:2891) ~[tomcat-embed-core-9.0.78.jar!/:na]
        at org.apache.catalina.connector.Request.parseParameters(Request.java:3182) ~[tomcat-embed-core-9.0.78.jar!/:na]
        at org.apache.catalina.connector.Request.getParameter(Request.java:1118) ~[tomcat-embed-core-9.0.78.jar!/:na]
        at org.apache.catalina.connector.RequestFacade.getParameter(RequestFacade.java:309) ~[tomcat-embed-core-9.0.78.jar!/:na]
        at org.springframework.web.filter.HiddenHttpMethodFilter.doFilterInternal(HiddenHttpMethodFilter.java:85) ~[spring-web-5.3.29.jar!/:5.3.29]
        ... 27 common frames omitted
Caused by: org.apache.tomcat.util.http.fileupload.impl.SizeLimitExceededException: the request was rejected because its size (599711231) exceeds the configured maximum (536870912)
        at org.apache.tomcat.util.http.fileupload.impl.FileItemIteratorImpl.init(FileItemIteratorImpl.java:161) ~[tomcat-embed-core-9.0.78.jar!/:na]
        at org.apache.tomcat.util.http.fileupload.impl.FileItemIteratorImpl.getMultiPartStream(FileItemIteratorImpl.java:205) ~[tomcat-embed-core-9.0.78.jar!/:na]
        at org.apache.tomcat.util.http.fileupload.impl.FileItemIteratorImpl.findNextItem(FileItemIteratorImpl.java:224) ~[tomcat-embed-core-9.0.78.jar!/:na]
        at org.apache.tomcat.util.http.fileupload.impl.FileItemIteratorImpl.<init>(FileItemIteratorImpl.java:142) ~[tomcat-embed-core-9.0.78.jar!/:na]
        at org.apache.tomcat.util.http.fileupload.FileUploadBase.getItemIterator(FileUploadBase.java:277) ~[tomcat-embed-core-9.0.78.jar!/:na]
        at org.apache.tomcat.util.http.fileupload.FileUploadBase.parseRequest(FileUploadBase.java:301) ~[tomcat-embed-core-9.0.78.jar!/:na]
        at org.apache.catalina.connector.Request.parseParts(Request.java:2850) ~[tomcat-embed-core-9.0.78.jar!/:na]
        ... 31 common frames omitted
kagemomiji commented 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?

zc-devs commented 1 year ago

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 commented 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?

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 and SPRING_SERVLET_MULTIPART_MAX_REQUEST_SIZE environment variables. Don't know where to put it in systemd, though.

No change either.

kagemomiji commented 1 year ago

@DutchComputerKid Could you paste the exact contents of either /etc/systemd/airsonic.service or /etc/default/airsonic that you tried?

kagemomiji commented 1 year ago

@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 ?

DutchComputerKid commented 1 year ago

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.

khers commented 1 year ago

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
kagemomiji commented 1 year ago

@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.

/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 -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

/etc/default/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=-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.

khers commented 1 year ago

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.

DutchComputerKid commented 1 year ago

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.

kagemomiji commented 1 year ago

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.