[SOLVED] API issues, 1.16.1/1.16.0

Need help? Post your questions here.

Moderator: moderators

[SOLVED] API issues, 1.16.1/1.16.0

Postby tyral » Sun Sep 15, 2019 9:17 pm

Leaving this here for historical, but I figured our the issue. I had recently migrated my subsonic installation and changed the location of some of the media directories. After -thinking- it had automatically fixed the entries in the MySQL DB, I discovered I was incorrect. The error was coming from the file not existing which I found while trying to develop a bash oneliner as a stopgap until I resolved this blocker.

If you're programatically creating playlists through the API, make sure your paths are set properly in the database when you query song IDs, otherwise this error will occur.

==========
Just a brief tl;dr

I'm going to be referencing the last played date on songs and shuffling them into a playlist. What I want to be able to do (and would appear to be supported) is create the playlist with the songs in it in one go, like so (except with a bunch of SongId parameters) What I get instead is an empty playlist and this response:

Code: Select all
[root@watchog ~]# curl "https://whismur.project905.com:4041/rest/createPlaylist?u=admin&p=[redacted]&v=1.16.0&c=myapp&name=test&songId=28223"
<?xml version="1.0" encoding="UTF-8"?>
<subsonic-response xmlns="http://subsonic.org/restapi" status="failed" version="1.16.1">
   <error code="0" message="Access denied to file PartyLabz (JoLabz)"/>
</subsonic-response>


EDIT: Since I was going to need to make these public anyway I also tried adding a song using the updatePlaylist call:
Code: Select all
[root@watchog ~]# curl "https://whismur.project905.com:4041/rest/updatePlaylist?u=admin&p=[redacted]&v=1.16.0&c=myapp&playlistId=31&public=true&songIdToAdd=28223"
<?xml version="1.0" encoding="UTF-8"?>
<subsonic-response xmlns="http://subsonic.org/restapi" status="failed" version="1.16.1">
   <error code="0" message="Access denied to file PartyLabz (JoLabz)"/>
</subsonic-response>


The playlist is getting created, and the settings are being updated, it's just not letting me add the music to the playlist

<-------------------------Subsonic Help Request---------------------->
Problem Description: I'm writing a dynamic playlist generator and need to use the API to create playlists. Creating the playlist works. When adding songs during playlist creation, that fails.
Troubleshooting Steps: Attempted using the new and old way to authenticate, neither works.
Playback Application and version: curl request to create playlist
Subsonic Version: 6.1.5 (build 759abe) – December 1, 2018
Server Version: jetty-6.1.x, java 1.8.0_222, MySQL, Linux (119.0 MB / 591.5 MB)
Hardware Platform: CentOS Linux release 7.6.1810 (Core)
Java Memory Limit: Whatever the default is on Linux
Problem Filename: n/a
Output from ffmpeg -i:

Code: Select all
[root@watchog ~]# /var/subsonic/transcode/ffmpeg -i "/home/subsonic/data/music/02 - Weed Card [Explicit].mp3"
ffmpeg version 3.0-static http://johnvansickle.com/ffmpeg/  Copyright (c) 2000-2016 the FFmpeg developers
  built with gcc 5.3.1 (Debian 5.3.1-8) 20160205
  configuration: --enable-gpl --enable-version3 --disable-shared --disable-debug --enable-runtime-cpudetect --enable-libmp3lame --enable-libx264 --enable-libx265 --enable-libwebp --enable-libspeex --enable-libvorbis --enable-libvpx --enable-libfreetype --enable-fontconfig --enable-libxvid --enable-libopencore-amrnb --enable-libopencore-amrwb --enable-libtheora --enable-libvo-amrwbenc --enable-gray --enable-libopenjpeg --enable-libopus --enable-libass --enable-gnutls --enable-libvidstab --enable-libsoxr --enable-frei0r --enable-libfribidi --disable-indev=sndio --disable-outdev=sndio --enable-librtmp --enable-libmfx --cc=gcc
  libavutil      55. 17.103 / 55. 17.103
  libavcodec     57. 24.102 / 57. 24.102
  libavformat    57. 25.100 / 57. 25.100
  libavdevice    57.  0.101 / 57.  0.101
  libavfilter     6. 31.100 /  6. 31.100
  libswscale      4.  0.100 /  4.  0.100
  libswresample   2.  0.101 /  2.  0.101
  libpostproc    54.  0.100 / 54.  0.100
[mp3 @ 0xb20ef40] Skipping 0 bytes of junk at 184464.
[mjpeg @ 0xb210580] Changing bps to 8
Input #0, mp3, from '/home/subsonic/data/music/02 - Weed Card [Explicit].mp3':
  Metadata:
    title           : Weed Card [Explicit]
    artist          : Garfunkel and Oates
    album           : All Over Your Face [Explicit]
    genre           : Folk
    track           : 2/10
    disc            : 1/1
    album_artist    : Garfunkel and Oates
    copyright       : 2011 Garfunkel and Oates
    date            : 2011
  Duration: 00:01:55.93, start: 0.025056, bitrate: 238 kb/s
    Stream #0:0: Audio: mp3, 44100 Hz, stereo, s16p, 225 kb/s
    Metadata:
      encoder         : LAME3.97
    Side data:
      replaygain: track gain - -8.300000, track peak - unknown, album gain - unknown, album peak - unknown,
    Stream #0:1: Video: mjpeg, yuvj420p(pc, bt470bg/unknown/unknown), 600x600 [SAR 1:1 DAR 1:1], 90k tbr, 90k tbn, 90k tbc
    Metadata:
      comment         : Cover (front)
At least one output file must be specified


Last ten log file lines:

Code: Select all
[2019-09-15 20:52:33,960] WARN RESTFilter - Error in REST API: Access denied to file PartyLabz (JoLabz)
java.lang.SecurityException: Access denied to file PartyLabz (JoLabz)
        at net.sourceforge.subsonic.service.MediaFileService.getMediaFile(MediaFileService.java:142)
        at net.sourceforge.subsonic.controller.RESTController.createPlaylist(RESTController.java:1071)
        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
        at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
        at java.lang.reflect.Method.invoke(Method.java:498)
        at org.springframework.web.servlet.mvc.multiaction.MultiActionController.invokeNamedMethod(MultiActionController.java:473)
        at org.springframework.web.servlet.mvc.multiaction.MultiActionController.handleRequestInternal(MultiActionController.java:410)
        at org.springframework.web.servlet.mvc.AbstractController.handleRequest(AbstractController.java:153)
        at org.springframework.web.servlet.mvc.SimpleControllerHandlerAdapter.handle(SimpleControllerHandlerAdapter.java:48)
        at org.springframework.web.servlet.DispatcherServlet.doDispatch(DispatcherServlet.java:875)
        at org.springframework.web.servlet.DispatcherServlet.doService(DispatcherServlet.java:807)
        at org.springframework.web.servlet.FrameworkServlet.processRequest(FrameworkServlet.java:571)
        at org.springframework.web.servlet.FrameworkServlet.doGet(FrameworkServlet.java:501)
        at javax.servlet.http.HttpServlet.service(HttpServlet.java:707)
        at javax.servlet.http.HttpServlet.service(HttpServlet.java:820)
        at org.mortbay.jetty.servlet.ServletHolder.handle(ServletHolder.java:487)
        at org.mortbay.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1093)
        at org.mortbay.servlet.UserAgentFilter.doFilter(UserAgentFilter.java:81)
        at org.mortbay.servlet.GzipFilter.doFilter(GzipFilter.java:148)
        at org.mortbay.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1084)
        at org.acegisecurity.util.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:265)
        at org.acegisecurity.intercept.web.FilterSecurityInterceptor.invoke(FilterSecurityInterceptor.java:107)
        at org.acegisecurity.intercept.web.FilterSecurityInterceptor.doFilter(FilterSecurityInterceptor.java:72)
        at org.acegisecurity.util.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:275)
        at org.acegisecurity.ui.ExceptionTranslationFilter.doFilter(ExceptionTranslationFilter.java:166)
        at org.acegisecurity.util.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:275)
        at org.acegisecurity.providers.anonymous.AnonymousProcessingFilter.doFilter(AnonymousProcessingFilter.java:125)
        at org.acegisecurity.util.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:275)
        at org.acegisecurity.ui.rememberme.RememberMeProcessingFilter.doFilter(RememberMeProcessingFilter.java:142)
        at org.acegisecurity.util.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:275)
        at org.acegisecurity.wrapper.SecurityContextHolderAwareRequestFilter.doFilter(SecurityContextHolderAwareRequestFilter.java:81)
        at org.acegisecurity.util.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:275)
        at net.sourceforge.subsonic.security.RESTRequestParameterProcessingFilter.doFilter(RESTRequestParameterProcessingFilter.java:95)
        at org.acegisecurity.util.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:275)
        at org.acegisecurity.ui.basicauth.BasicProcessingFilter.doFilter(BasicProcessingFilter.java:173)
        at org.acegisecurity.util.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:275)
        at org.acegisecurity.ui.logout.LogoutFilter.doFilter(LogoutFilter.java:110)
        at org.acegisecurity.util.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:275)
        at org.acegisecurity.context.HttpSessionContextIntegrationFilter.doFilter(HttpSessionContextIntegrationFilter.java:249)
        at org.acegisecurity.util.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:275)
        at org.acegisecurity.util.FilterChainProxy.doFilter(FilterChainProxy.java:149)
        at org.acegisecurity.util.FilterToBeanProxy.doFilter(FilterToBeanProxy.java:98)
        at org.mortbay.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1084)
        at net.sourceforge.subsonic.filter.RequestEncodingFilter.doFilter(RequestEncodingFilter.java:25)
        at org.mortbay.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1084)
        at net.sourceforge.subsonic.filter.RESTFilter.doFilter(RESTFilter.java:42)
        at org.mortbay.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1084)
        at net.sourceforge.subsonic.filter.ParameterDecodingFilter.doFilter(ParameterDecodingFilter.java:36)
        at org.mortbay.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1084)
        at net.sourceforge.subsonic.filter.BootstrapVerificationFilter.doFilter(BootstrapVerificationFilter.java:41)
        at org.mortbay.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1084)
        at org.mortbay.jetty.servlet.ServletHandler.handle(ServletHandler.java:360)
        at org.mortbay.jetty.security.SecurityHandler.handle(SecurityHandler.java:216)
        at org.mortbay.jetty.servlet.SessionHandler.handle(SessionHandler.java:181)
        at org.mortbay.jetty.handler.ContextHandler.handle(ContextHandler.java:712)
        at org.mortbay.jetty.webapp.WebAppContext.handle(WebAppContext.java:405)
        at org.mortbay.jetty.handler.HandlerWrapper.handle(HandlerWrapper.java:139)
        at org.mortbay.jetty.Server.handle(Server.java:313)
        at org.mortbay.jetty.HttpConnection.handleRequest(HttpConnection.java:506)
        at org.mortbay.jetty.HttpConnection$RequestHandler.headerComplete(HttpConnection.java:830)
        at org.mortbay.jetty.HttpParser.parseNext(HttpParser.java:514)
        at org.mortbay.jetty.HttpParser.parseAvailable(HttpParser.java:211)
        at org.mortbay.jetty.HttpConnection.handle(HttpConnection.java:381)
        at org.mortbay.jetty.bio.SocketConnector$Connection.run(SocketConnector.java:227)
        at org.mortbay.jetty.security.SslSocketConnector$SslConnection.run(SslSocketConnector.java:626)
        at org.mortbay.thread.BoundedThreadPool$PoolThread.run(BoundedThreadPool.java:442)

<-------------------------Subsonic Help Request---------------------->
tyral
 
Posts: 8
Joined: Fri Mar 24, 2017 8:48 pm

Return to Help

Who is online

Users browsing this forum: No registered users and 61 guests