Fetch Failed - Connection reset

Support for Mac OS X users and the Mac App Store package
Post Reply
Meph88
Donor
Posts: 35
Joined: 29 Jun 2014, 15:46

Fetch Failed - Connection reset

Post by Meph88 » 12 Feb 2018, 12:45

Running script:

Code: Select all

/usr/local/bin/filebot -script fn:amc "/Users/MacMini/Documents/Torrent Stuff/Finished - Transmission" --output /Volumes/Media/New --action move --conflict override -non-strict --def subtitles=en music=n artwork=y
Getting failure with output:

Code: Select all

Rename episodes using [TheTVDB]
Auto-detected query: [Black Lightning]
Fetch failed: Try again in 5 seconds (2 more) => java.net.SocketException: Connection reset
Fetch failed: Try again in 10 seconds (1 more) => java.net.SocketException: Connection reset
Fetch failed: http://thetvdb.com/api/GetSeries.php?seriesname=Black+Lightning&language=en
java.net.SocketException: Connection reset
	at net.filebot.web.WebRequest.fetch(WebRequest.java:143)
	at net.filebot.CachedResource.lambda$fetchIfModified$9(CachedResource.java:215)
	at net.filebot.CachedResource.lambda$null$0(CachedResource.java:87)
	at net.filebot.CachedResource.retry(CachedResource.java:121)
	at net.filebot.CachedResource.retry(CachedResource.java:133)
	at net.filebot.CachedResource.retry(CachedResource.java:133)
	at net.filebot.CachedResource.lambda$get$1(CachedResource.java:87)
	at net.filebot.Cache.computeIf(Cache.java:90)
	at net.filebot.CachedResource.get(CachedResource.java:82)
	at net.filebot.web.TheTVDBClientV1.getXmlResource(TheTVDBClientV1.java:269)
	at net.filebot.web.TheTVDBClientV1.fetchSearchResult(TheTVDBClientV1.java:86)
	at net.filebot.WebServices$TheTVDBClientWithLocalSearch.access$001(WebServices.java:129)
	at net.filebot.WebServices$TheTVDBClientWithLocalSearch.lambda$fetchSearchResult$4(WebServices.java:149)
Caused by: java.net.SocketException: Connection reset
	at net.filebot.web.WebRequest.fetch(WebRequest.java:140)
	... 12 more

ExecutionException: java.net.SocketException: Connection reset
Any ideas what is the problem?

User avatar
rednoah
The Source
Posts: 13265
Joined: 16 Nov 2011, 08:59
Location: Taipei
Contact:

Re: Fetch Failed - Connection reset

Post by rednoah » 12 Feb 2018, 13:01

Please run filebot -script fn:sysinfo and post the output.
My (very excellent) support depends on Windows Store and Mac App Store sales and Patreon support. Paying users, donors and everyone who contributes to FileBot in one way or another will get the very best support.

:idea: Please read the FAQ and How to Request Help.

Meph88
Donor
Posts: 35
Joined: 29 Jun 2014, 15:46

Re: Fetch Failed - Connection reset

Post by Meph88 » 12 Feb 2018, 15:10

Code: Select all

FileBot 4.7.9 (r4984)
JNA Native: 5.1.0
MediaInfo: 0.7.93
7-Zip-JBinding: 9.20
Chromaprint: 1.4.2
Extended Attributes: OK
Unicode Filesystem: OK
Script Bundle: 2017-11-21 (r512)
Groovy: 2.4.10
JRE: Java(TM) SE Runtime Environment 1.8.0_121
JVM: 64-bit Java HotSpot(TM) 64-Bit Server VM
CPU/MEM: 2 Core / 455 MB Max Memory / 34 MB Used Memory
OS: Mac OS X (x86_64)
Package: APP
uname: Darwin Kevins-Mac-mini.local 16.7.0 Darwin Kernel Version 16.7.0: Wed Oct  4 00:17:00 PDT 2017; root:xnu-3789.71.6~1/RELEASE_X86_64 x86_64
Done ヾ(@⌒ー⌒@)ノ

User avatar
rednoah
The Source
Posts: 13265
Joined: 16 Nov 2011, 08:59
Location: Taipei
Contact:

Re: Fetch Failed - Connection reset

Post by rednoah » 12 Feb 2018, 16:25

I see. That version uses the old TheTVDB API which may occasionally not work. Give it 1-2 days and then try again. They might just have server issues.
My (very excellent) support depends on Windows Store and Mac App Store sales and Patreon support. Paying users, donors and everyone who contributes to FileBot in one way or another will get the very best support.

:idea: Please read the FAQ and How to Request Help.

Meph88
Donor
Posts: 35
Joined: 29 Jun 2014, 15:46

Re: Fetch Failed - Connection reset

Post by Meph88 » 17 Feb 2018, 05:32

This continues to not work.
Is there any change I can make that could get this up and running?
You mentioned my script uses the old TheTVDB API, can I move somehow to the more recent API?

User avatar
rednoah
The Source
Posts: 13265
Joined: 16 Nov 2011, 08:59
Location: Taipei
Contact:

Re: Fetch Failed - Connection reset

Post by rednoah » 17 Feb 2018, 06:13

Is it an intermittent problem or does it generally not work?

You can use curl to make the HTTP request and see what happens:

Code: Select all

curl -v http://thetvdb.com/api/GetSeries.php?seriesname=Black+Lightning
It works for me from my location. You could try a VPN and see if that makes it work. There's a chance that it's a network issue, with your provide somehow blocking requests, or your IP being blocked by TheTVDB.
My (very excellent) support depends on Windows Store and Mac App Store sales and Patreon support. Paying users, donors and everyone who contributes to FileBot in one way or another will get the very best support.

:idea: Please read the FAQ and How to Request Help.

Meph88
Donor
Posts: 35
Joined: 29 Jun 2014, 15:46

Re: Fetch Failed - Connection reset

Post by Meph88 » 17 Feb 2018, 07:35

Fails 100% of the time, with and without a VPN and tested with VPN in different locations.
It only fails to process TV Shows, Movies work fine.

When I run:

Code: Select all

curl -v http://thetvdb.com/api/GetSeries.php?seriesname=Black+Lightning
I get back:

Code: Select all

*   Trying 104.16.231.14...
* TCP_NODELAY set
* Connected to thetvdb.com (104.16.231.14) port 80 (#0)
> GET /api/GetSeries.php?seriesname=Black+Lightning HTTP/1.1
> Host: thetvdb.com
> User-Agent: curl/7.54.0
> Accept: */*
> 
* Recv failure: Connection reset by peer
* Closing connection 0
curl: (56) Recv failure: Connection reset by peer

User avatar
rednoah
The Source
Posts: 13265
Joined: 16 Nov 2011, 08:59
Location: Taipei
Contact:

Re: Fetch Failed - Connection reset

Post by rednoah » 17 Feb 2018, 13:46

Here's what it should look like:

Code: Select all

$ curl -v http://thetvdb.com/api/GetSeries.php?seriesname=Black+Lightning
*   Trying 104.16.227.14...
* TCP_NODELAY set
* Connected to thetvdb.com (104.16.227.14) port 80 (#0)
> GET /api/GetSeries.php?seriesname=Black+Lightning HTTP/1.1
> Host: thetvdb.com
> User-Agent: curl/7.54.0
> Accept: */*
>
< HTTP/1.1 200 OK
< Date: Sat, 17 Feb 2018 13:45:17 GMT
< Content-Type: text/xml; charset=utf-8
< Transfer-Encoding: chunked
< Connection: keep-alive
< Set-Cookie: __cfduid=d28a1d6d449c108a04634fd4147a8344f1518875117; expires=Sun, 17-Feb-19 13:45:17 GMT; path=/; domain=.thetvdb.com; HttpOnly
< Vary: Accept-Encoding
< Expires: Sat, 17 Feb 2018 17:45:17 GMT
< Cache-Control: public, max-age=14400
< X-Cache: HIT
< CF-Cache-Status: HIT
< Server: cloudflare
< CF-RAY: 3ee92fabf29749c1-BKK
<
<?xml version="1.0" encoding="UTF-8" ?>
<Data>
<Series>
<seriesid>332525</seriesid>
<language>en</language>
<SeriesName>Black Lightning</SeriesName>
<banner>graphical/332525-g5.jpg</banner>
<Overview>Jefferson Pierce is a man wrestling with a secret. As the father of Anissa and Jennifer, and principal of a charter high school that also serves as a safe-haven for young people in a neighborhood overrun by gang violence, he is a hero in his community. Nine years ago, Pierce was a hero of a different sort. Gifted with the superhuman power to harness and control electricity, he used those powers to keep his hometown streets safe as the masked vigilante Black Lightning, but he left the Superhero days behind. Almost a decade later, Pierce’s crime-fighting days are long behind him…or so he thought.</Overview>
<FirstAired>2018-01-16</FirstAired>
<Network>The CW</Network>
<IMDB_ID>tt6045840</IMDB_ID>
<zap2it_id>EP02698280</zap2it_id>
<id>332525</id>
</Series>
* Connection #0 to host thetvdb.com left intact
</Data>
What happens if you open http://thetvdb.com/api/GetSeries.php?se ... +Lightning in your browser?
My (very excellent) support depends on Windows Store and Mac App Store sales and Patreon support. Paying users, donors and everyone who contributes to FileBot in one way or another will get the very best support.

:idea: Please read the FAQ and How to Request Help.

Meph88
Donor
Posts: 35
Joined: 29 Jun 2014, 15:46

Re: Fetch Failed - Connection reset

Post by Meph88 » 19 Feb 2018, 08:00

It loads a white background and the following text:

Code: Select all

332525 en Black Lightning graphical/332525-g5.jpg Jefferson Pierce is a man wrestling with a secret. As the father of Anissa and Jennifer, and principal of a charter high school that also serves as a safe-haven for young people in a neighborhood overrun by gang violence, he is a hero in his community. Nine years ago, Pierce was a hero of a different sort. Gifted with the superhuman power to harness and control electricity, he used those powers to keep his hometown streets safe as the masked vigilante Black Lightning, but he left the Superhero days behind. Almost a decade later, Pierce’s crime-fighting days are long behind him…or so he thought. 2018-01-16 The CW tt6045840 EP02698280 332525

User avatar
rednoah
The Source
Posts: 13265
Joined: 16 Nov 2011, 08:59
Location: Taipei
Contact:

Re: Fetch Failed - Connection reset

Post by rednoah » 19 Feb 2018, 16:48

That's very strange. Sounds like you get a good response if you make the request with your browser, so it's strange that FileBot doesn't get the same response for some reason.
My (very excellent) support depends on Windows Store and Mac App Store sales and Patreon support. Paying users, donors and everyone who contributes to FileBot in one way or another will get the very best support.

:idea: Please read the FAQ and How to Request Help.

doscrash
Posts: 5
Joined: 22 Feb 2015, 08:54

Re: Fetch Failed - Connection reset

Post by doscrash » 20 Feb 2018, 06:50

Hi, I'm having the exact same issue, including the same error messages. My movies also still and work and I can also access the TVDB api via the web but it says connection reset in the terminal. I'm using Filebot for Synology.

Let me know if anyone has a fix!

User avatar
rednoah
The Source
Posts: 13265
Joined: 16 Nov 2011, 08:59
Location: Taipei
Contact:

Re: Fetch Failed - Connection reset

Post by rednoah » 20 Feb 2018, 07:24

Since it's a network problem, the same error might be caused by a different cause and have a different solution, if there is one.

i.e. Please post the output of curl -v so we can see what the HTTP request / response looks like from your machine:

Code: Select all

curl -v http://thetvdb.com/api/GetSeries.php?seriesname=firefly
My (very excellent) support depends on Windows Store and Mac App Store sales and Patreon support. Paying users, donors and everyone who contributes to FileBot in one way or another will get the very best support.

:idea: Please read the FAQ and How to Request Help.

doscrash
Posts: 5
Joined: 22 Feb 2015, 08:54

Re: Fetch Failed - Connection reset

Post by doscrash » 21 Feb 2018, 01:38

Thanks. Here is what I have:

Code: Select all

*   Trying 104.16.228.14...
* TCP_NODELAY set
* Connected to thetvdb.com (104.16.228.14) port 80 (#0)
> GET /api/GetSeries.php?seriesname=firefly HTTP/1.1
> Host: thetvdb.com
> User-Agent: curl/7.54.0
> Accept: */*
> 
* Recv failure: Connection reset by peer
* stopped the pause stream!
* Closing connection 0
curl: (56) Recv failure: Connection reset by peer

User avatar
rednoah
The Source
Posts: 13265
Joined: 16 Nov 2011, 08:59
Location: Taipei
Contact:

Re: Fetch Failed - Connection reset

Post by rednoah » 21 Feb 2018, 02:28

And you can confirm that at the exact same time opening the exact same URL works on your browser?

104.16.227.14 is a CloudFlare edge cache and it simply ends the connection whenever you try to connect. That tells us the (1) CloudFlare has blocked your IP (2) No tool (curl, Chrome, FileBot, etc) will be able to talk to this server.

If you test with your browser, make sure you're not just getting a cached page. Your browser might give you previously cached data if the request fails.

If it's really just curl and FileBot that can't talk to the server, but Chrome somehow can, then either Chrome is using a Proxy / VPN / etc, or there really is a difference in the communication that makes CloudFlare decide to end the connection. If you're technically-inclined, then you could try to use Fiddler to further debug the problem. There's a chance CloudFlare blocks requests based on HTTP headers, which are different for different tools, and used to CloudFlare to filter out "bad" requests.
My (very excellent) support depends on Windows Store and Mac App Store sales and Patreon support. Paying users, donors and everyone who contributes to FileBot in one way or another will get the very best support.

:idea: Please read the FAQ and How to Request Help.

doscrash
Posts: 5
Joined: 22 Feb 2015, 08:54

Re: Fetch Failed - Connection reset

Post by doscrash » 02 Mar 2018, 20:29

Hi, it opens up in the browser fine and when I ping thetvdb.com, it also successfully goes through. Do you have any other ideas why the connection resets?

User avatar
rednoah
The Source
Posts: 13265
Joined: 16 Nov 2011, 08:59
Location: Taipei
Contact:

Re: Fetch Failed - Connection reset

Post by rednoah » 02 Mar 2018, 20:51

doscrash wrote:
02 Mar 2018, 20:29
Hi, it opens up in the browser fine and when I ping thetvdb.com, it also successfully goes through. Do you have any other ideas why the connection resets?
Can you make a curl call that successfully returns the correct data? When you open a URL in the browser, then your browser will send a request (with certain headers, cookies, etc), just the same as curl. If the request is the same, then the response must be the same.

Your results indicate that CloudFlare uses heuristics to guess if a program is making the request or a browser on behalf of a user (by checking certain headers, cookies, etc) and then block requests based on that.

This indicates that your IP has been auto-blocked (at least for non-human requests) and there's unfortunately nothing you can do other than access the internet from a different IP / location.

If you're using a laptop, then you could just try going to a nearby cafe / restaurant / library / etc with wifi and try from there.
My (very excellent) support depends on Windows Store and Mac App Store sales and Patreon support. Paying users, donors and everyone who contributes to FileBot in one way or another will get the very best support.

:idea: Please read the FAQ and How to Request Help.

Post Reply

Who is online

Users browsing this forum: No registered users and 1 guest