srazer / FindMissing.bundle

Find and list missing files in Plex.
23 stars 6 forks source link

BUG: urllib2 error #4

Open kossboss opened 9 years ago

kossboss commented 9 years ago

urllib2 error (i get this with plex2csv as well - im on latest server and client - using chrome)

Error looks like this in findmissing (grabbed from Plex Media Server\Logs\PMS Plugin Logs\com.plexapp.plugin.finMissing.Log):

2015-01-23 06:54:24,500 (2340) : DEBUG (logkit:13) - Media from database: 'Hannibal/Kō No Mono' exists with a path of: S:\Videos\TvShows\Hannibal\Season 2\Hannibal.S02E11.720p.HDTV.X264-DIMENSION.mkv 2015-01-23 06:54:24,525 (2340) : DEBUG (logkit:13) - Media from database: 'Hannibal/Tome-wan' exists with a path of: S:\Videos\TvShows\Hannibal\Season 2\Hannibal.S02E12.Tome.Wan.1080p.WEB-DL.DD5.1.H.264-NTb.mkv 2015-01-23 06:54:24,589 (2340) : DEBUG (logkit:13) - Media from database: 'Hannibal/Mizumono' exists with a path of: S:\Videos\TvShows\Hannibal\Season 2\Hannibal.S02E13.720p.HDTV.X264-DIMENSION.mkv 2015-01-23 06:54:24,589 (2340) : DEBUG (logkit:13) - Show 27 of 62 with a RatingKey of 86685 at myURL: http://localhost:32400/library/metadata/86685/allLeaves 2015-01-23 06:54:24,589 (2340) : DEBUG (networking:172) - Requesting 'http://localhost:32400/library/metadata/86685/allLeaves' 2015-01-23 06:54:25,611 (2340) : CRITICAL (logkit:25) - Detected an exception in scanShowDB 2015-01-23 06:54:25,611 (2340) : CRITICAL (logkit:25) - Exception happened in backgroundScanThread 2015-01-23 06:54:25,611 (2340) : CRITICAL (core:572) - Exception in thread named 'backgroundScanThread' (most recent call last): File "D:\0Programs\PlexData\Plex Media Server\Plug-ins\Framework.bundle\Contents\Resources\Versions\2\Python\Framework\components\runtime.py", line 1120, in _start_thread f(_args, _kwargs) File "D:\0Programs\PlexData\Plex Media Server\Plug-ins\FindMissing.bundle\Contents\Codeinit.py", line 402, in backgroundScanThread scanShowDB(myMediaURL) File "D:\0Programs\PlexData\Plex Media Server\Plug-ins\FindMissing.bundle\Contents\Codeinit.py", line 257, in scanShowDB myMedias2 = XML.ElementFromURL(myURL).xpath('//Video') File "D:\0Programs\PlexData\Plex Media Server\Plug-ins\Framework.bundle\Contents\Resources\Versions\2\Python\Framework\api\parsekit.py", line 344, in ElementFromURL method=method, File "D:\0Programs\PlexData\Plex Media Server\Plug-ins\Framework.bundle\Contents\Resources\Versions\2\Python\Framework\api\networkkit.py", line 67, in _http_request req = self._core.networking.http_request(url, _args, _kwargs) File "D:\0Programs\PlexData\Plex Media Server\Plug-ins\Framework.bundle\Contents\Resources\Versions\2\Python\Framework\components\networking.py", line 376, in http_request return HTTPRequest(self._core, url, data, h, url_cache, encoding, errors, timeout, immediate, sleep, opener, follow_redirects, method) File "D:\0Programs\PlexData\Plex Media Server\Plug-ins\Framework.bundle\Contents\Resources\Versions\2\Python\Framework\components\networking.py", line 147, in init self.load() File "D:\0Programs\PlexData\Plex Media Server\Plug-ins\Framework.bundle\Contents\Resources\Versions\2\Python\Framework\components\networking.py", line 187, in load f = self._opener.open(req, timeout=self._timeout) File "C:\Program Files (x86)\Plex\Plex Media Server\python27.zip\urllib2.py", line 404, in open response = self._open(req, data) File "C:\Program Files (x86)\Plex\Plex Media Server\python27.zip\urllib2.py", line 422, in _open '_open', req) File "C:\Program Files (x86)\Plex\Plex Media Server\python27.zip\urllib2.py", line 382, in _call_chain result = func(*args) File "C:\Program Files (x86)\Plex\Plex Media Server\python27.zip\urllib2.py", line 1214, in http_open return self.do_open(httplib.HTTPConnection, req) File "C:\Program Files (x86)\Plex\Plex Media Server\python27.zip\urllib2.py", line 1184, in do_open raise URLError(err) URLError: <urlopen error [Errno 10048] Only one usage of each socket address (protocol/network address/port) is normally permitted>

srazer commented 9 years ago

Please PM me a .zip copy of this log in the Plex forums.

ukdtom commented 9 years ago

https://github.com/ukdtom/plex2csv.bundle/issues/54

ukdtom commented 9 years ago

My guess, since this happens for both Find-Unmatched, FindMissing & Plex2CSV is a broken database

srazer commented 9 years ago

That is what I'm thinking too. Or corrupted Plex bundles.

kossboss commented 9 years ago

My Plex library is not curropt, I know this because sometimes those scans would go through without issue.

Well the catch is that sometimes it goes thru the whole library scan without failing. Its only sometimes that it fails. The URL LIB error online mentioned that too many ports where opened. I monitored with cygwin and a netstat grepping for 32400, and I saw that the number of connections sky rocketed while it was doing that scan, and it just kept rising and rising and rising. I assume it should make a connection, grab an xml page, close the page, continue with the next page.. Or if its threaded maybe it can do 8 at a time. Im not sure if your threading it. But according to netstat output it was like there were 1000s at a time.

I did have "netbalancer" installed on my PC at the time of issue, but it was giving most priority to plex, so it should affect it, but it was affecting other communications like samba from pc to the NAS samba server. Now Plex used the mapped drive to communicate to all of my videos which are all o the NAS which also used samba. I assumed since Plex was the sourcing application, the "netbalancer" would give it higher speed.

I uninstalled "netbalancer" after it gave me issues elsewhere, Im going to rerun these apps and see if I get these same issues.

But like I said my plex library is not curropt as far as I know because the 3 mentioned apps (Find-Unmatched, FindMissing and Plex2CSV finish sometimes but not always). It was like a 30% chance for it to be successful with Plex2CSV on the intense scan. If I newely rebooted my Windows PC then it was quicker. My assumption is that its just those URLLIB closed connections. But I guess the connections could of been built up because of "netbalancer" slowing things down.

I will test the 3 now without "netbalancer" and let you all know.

ukdtom commented 9 years ago

@srazer : Check this one out: https://github.com/ukdtom/plex2csv.bundle/issues/58