Jump to content

api call stopped working out of the blue


psybertech

Recommended Posts

psybertech

Greetings.

 

I have a script triggered via cron that checks a network mount and sees if there are new files in specific directories and if so, it would use the API to run the Scan Media Library scheduled task.

It ran fine for months and now I noticed it was working starting two days ago I think.

 

The API call is returning "Unable to find the specified file." - Chrome Dev Tools shows status of 404 Not Found.

 

The log (attached - restarted Emby, ran the API call and then shut down, so it is small.

 

API call being used:

curl -d 'StartScheduledTask' http://192.168.0.11:8096/emby/ScheduledTasks/Running/6330ee8fb4a957f33981f89aa78b030f?api_key=MYAPIKEY

Emby version 3.6.0.2 and has been on that for a little while now and it was working with it (I am fairly certain - my main Emby server was offline for a week while my NAS was rebuilding so the script didn't run during that time). I guess its possible that it didn't and I just didn't notice, so I guess don't rule that out.

 

relevant bits of the log:

2018-09-12 14:43:11.430 Info HttpServer: HTTP GET http://192.168.0.11:8096/emby/ScheduledTasks/Running/6330ee8fb4a957f33981f89aa78b030f. UserAgent: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/69.0.3497.81 Safari/537.36
2018-09-12 14:43:11.430 Error HttpServer: Could not find handler for /emby/ScheduledTasks/Running/6330ee8fb4a957f33981f89aa78b030f
2018-09-12 14:43:11.432 Info HttpServer: HTTP Response 404 to 192.168.0.151. Time: 2ms. http://192.168.0.11:8096/emby/ScheduledTasks/Running/6330ee8fb4a957f33981f89aa78b030f 

I've tried the Swagger API tool and some things are working (like it will return item counts and list scheduled tasks) but when I try the one that always worked before but now trying in Swagger, the responses area quickly shows a spinning 'Loading' graphic and then goes away. In Chrome Dev Tools, it is saying 204 No Content:

Request URL: http://192.168.0.11:8096/emby/ScheduledTasks/Running/6330ee8fb4a957f33981f89aa78b030f?api_key=APIKEY
Request Method: POST
Status Code: 204 No Content
Remote Address: 192.168.0.11:8096
Referrer Policy: no-referrer-when-downgrade

Any idea what happened or what I can try next?

 

Thanks

 

J

Edited by psybertech
Link to comment
Share on other sites

This is going to be specific to your environment or specific to the way you are constructing your request. If the api were truly not working, then the scheduled task buttons in the web app wouldn't work. But they do work. I would suggest comparing your requests to what the web app is sending out. Thanks.

Link to comment
Share on other sites

psybertech

Weird... OK... It first seemed that all the POST options in Swagger did the same thing, meaning didn't work, while all the GET ones were fine.

 

But, for whatever reason, I rebooted everything for the 10th time and now it is working. So I have no clue what happened and why it wasn't triggering the scans.

 

Anyway.... Sorry about that... False alarm.

 

All is well.  :D

 

J

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...