stuck at "trying to fetch"

Get help with all aspects of SABnzbd
Forum rules
Help us help you:
  • Are you using the latest stable version of SABnzbd? Downloads page.
  • Tell us what system you run SABnzbd on.
  • Adhere to the forum rules.
  • Do you experience problems during downloading?
    Check your connection in Status and Interface settings window.
    Use Test Server in Config > Servers.
    We will probably ask you to do a test using only basic settings.
  • Do you experience problems during repair or unpacking?
    Enable +Debug logging in the Status and Interface settings window and share the relevant parts of the log here using [ code ] sections.
User avatar
sander
Release Testers
Release Testers
Posts: 9429
Joined: January 22nd, 2008, 2:22 pm

Re: stuck at "trying to fetch"

Post by sander »

@Dewdman42:

In SABnzbd, go to your RSS settings for nzb.is by clicking on "Edit URL" and change the URL from

Code: Select all

https://nzb.is/rss?...
to

Code: Select all

http://nzb.is/rss?
So change "https" to "http". Save, and restart SABnzbd. Post the result here.

FWIW: My SABnzbd has no problem with https://nzb.is/rss?... nor https://nzb.is/rss?..., so my guess there is something wrong on your NAS setup (not in SABnzbd itself)
mogodon
Newbie
Newbie
Posts: 13
Joined: September 3rd, 2015, 10:06 am

Re: stuck at "trying to fetch"

Post by mogodon »

I also just tried the following:

http://nzb.is/ - NZB passed to SABnzbd and downloads
https://nzb.is/ - NZB stuck at fetching

So I guess I need to find out why SABnzbd won't accept the https protocol and how I fix it.
User avatar
sander
Release Testers
Release Testers
Posts: 9429
Joined: January 22nd, 2008, 2:22 pm

Re: stuck at "trying to fetch"

Post by sander »

mogodon wrote:I also just tried the following:

http://nzb.is/ - NZB passed to SABnzbd and downloads
https://nzb.is/ - NZB stuck at fetching

So I guess I need to find out why SABnzbd won't accept the https protocol and how I fix it.
The problem is probably not in SABnzbd, but in your NAS OS or python. Easy way to check: login on your NAS, start python and type:

Code: Select all

import urllib2
f = urllib2.urlopen('http://www.google.com/', timeout=5)
f.read()[:100]
That should work. Post the output here in a code block.

Now with https:

Code: Select all

import urllib2
f = urllib2.urlopen('https://www.google.com/', timeout=5)
f.read()[:100]
Post the output here in a code block. If you have a problem, there is a problem in your NAS OS or python, not SABnzbd (proof: in the above code there is no SABnzbd involved ... :P )

For refence: this is what happens when everything is OK:

Code: Select all

>>> import urllib2
>>> f = urllib2.urlopen('http://www.google.com/', timeout=5)
>>> f.read()[:100]
'<!doctype html><html itemscope="" itemtype="http://schema.org/WebPage" lang="nl"><head><meta content'
>>> 

>>> import urllib2
>>> f = urllib2.urlopen('https://www.google.com/', timeout=5)
>>> f.read()[:100]
'<!doctype html><html itemscope="" itemtype="http://schema.org/WebPage" lang="nl"><head><meta content'
>>>
Dewdman42
Newbie
Newbie
Posts: 16
Joined: September 2nd, 2015, 10:16 pm

Re: stuck at "trying to fetch"

Post by Dewdman42 »

I think I figured out my /tmp had filled up the root partition. Things seem to be working ok now.
mogodon
Newbie
Newbie
Posts: 13
Joined: September 3rd, 2015, 10:06 am

Re: stuck at "trying to fetch"

Post by mogodon »

Well pretty obvious that the python is the issue:

http

Code: Select all

[/usr/bin] # /usr/bin/python
Python 2.7.9 (default, Mar 24 2015, 00:42:24)
[GCC 4.1.3 20070929 (prerelease) (Ubuntu 4.1.2-16ubuntu2)] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> import urllib2
f = urllib2.urlopen('http://www.google.com/', timeout=5)
f.read()[:100]>>> >>>
'<!doctype html><html itemscope="" itemtype="http://schema.org/WebPage" lang="en                                                -GB"><head><meta cont'
https

Code: Select all

>>> import urllib2
f = urllib2.urlopen('https://www.google.com/', timeout=5)
f.read()[:100]>>> Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/share/MD0_DATA/.qpkg/Python/lib/python2.7/urllib2.py", line 154, in urlopen
    return opener.open(url, data, timeout)
  File "/share/MD0_DATA/.qpkg/Python/lib/python2.7/urllib2.py", line 431, in open
    response = self._open(req, data)
  File "/share/MD0_DATA/.qpkg/Python/lib/python2.7/urllib2.py", line 449, in _open
    '_open', req)
  File "/share/MD0_DATA/.qpkg/Python/lib/python2.7/urllib2.py", line 409, in _call_chain
    result = func(*args)
  File "/share/MD0_DATA/.qpkg/Python/lib/python2.7/urllib2.py", line 1240, in https_open
    context=self._context)
  File "/share/MD0_DATA/.qpkg/Python/lib/python2.7/urllib2.py", line 1197, in do_open
    raise URLError(err)
urllib2.URLError: <urlopen error [SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed (_ssl.c:581)>
I reckon a recent firmware update has broken it.
User avatar
sander
Release Testers
Release Testers
Posts: 9429
Joined: January 22nd, 2008, 2:22 pm

Re: stuck at "trying to fetch"

Post by sander »

mogodon wrote:Well pretty obvious that the python is the issue:
...
I reckon a recent firmware update has broken it.
Yes. Probably an upgrade to Python 2.7.9 combined with a incorrect certificate setup on your NAS. See https://forums.sabnzbd.org/viewtopic.php?f=1&t=18565 for a long explanation.

Try this:

Code: Select all

import ssl
ssl._create_default_https_context = ssl._create_unverified_context

import urllib2
f = urllib2.urlopen('https://www.google.com/', timeout=5)
f.read()[:100]
mogodon
Newbie
Newbie
Posts: 13
Joined: September 3rd, 2015, 10:06 am

Re: stuck at "trying to fetch"

Post by mogodon »

Sander, thanks very much for your support, much appreciated. I will read your link and then go try the QNAP forums. Hopefully I can roll back the python version to 2.7.3
User avatar
sander
Release Testers
Release Testers
Posts: 9429
Joined: January 22nd, 2008, 2:22 pm

Re: stuck at "trying to fetch"

Post by sander »

mogodon wrote:Sander, thanks very much for your support, much appreciated. I will read your link and then go try the QNAP forums. Hopefully I can roll back the python version to 2.7.3
OK, but can you first try the code I gave above? If that works, you can make SABnzbd work again with two lines of code ... :)
mogodon
Newbie
Newbie
Posts: 13
Joined: September 3rd, 2015, 10:06 am

Re: stuck at "trying to fetch"

Post by mogodon »

Having read the other thread and also https://forums.sabnzbd.org/viewtopic.ph ... B&start=15 I actually chanced it and used your patch on SABnzbd.py

Code: Select all

opt_out_of_certificate_verification = True
if opt_out_of_certificate_verification:
    try:
        import ssl
        ssl._create_default_https_context = ssl._create_unverified_context
    except:
        pass
Restarted and it's working again!

Thank you!
User avatar
sander
Release Testers
Release Testers
Posts: 9429
Joined: January 22nd, 2008, 2:22 pm

Re: stuck at "trying to fetch"

Post by sander »

Well done!
mogodon
Newbie
Newbie
Posts: 13
Joined: September 3rd, 2015, 10:06 am

Re: stuck at "trying to fetch"

Post by mogodon »

sander wrote:Well done!
No idea why I didn't find the other QNAP post when I searched earlier today. Anyway, I now know how to run python on my NAS, sabnzbd works again and I'm no longer swearing at my NAS, so all good!

I've linked to your posts on the SABnzbd threads in the QNAP forum so hopefully anyone-else with the same issue can sort it.

Thanks again.
User avatar
sander
Release Testers
Release Testers
Posts: 9429
Joined: January 22nd, 2008, 2:22 pm

Re: stuck at "trying to fetch"

Post by sander »

mogodon wrote:
sander wrote:Well done!
No idea why I didn't find the other QNAP post when I searched earlier today. Anyway, I now know how to run python on my NAS, sabnzbd works again and I'm no longer swearing at my NAS, so all good!

I've linked to your posts on the SABnzbd threads in the QNAP forum so hopefully anyone-else with the same issue can sort it.

Thanks again.

FYI:
if you can't access https://www.google.com/, there is something wrong with your NAS' setup. It is preferred to solve that.
The code you implemented now is meant for situations where the the index' https certificate is incorrect.

So ... in the QNAP forum, try to find a solution for your NAS' setup.
mogodon
Newbie
Newbie
Posts: 13
Joined: September 3rd, 2015, 10:06 am

Re: stuck at "trying to fetch"

Post by mogodon »

Yes apparently there is an "issue" with SSL certificates on all of the QNAP models. Apparently they provide a shared certificate which is the same for all users. QNAP have been asked by the community in the past to fix this but nothing had been done. Now that Python 2.7.9 has been implemented on firmware 4.2.0 and browser are becoming stricter more people are finding out about this issue.
Last edited by mogodon on September 9th, 2015, 2:13 pm, edited 1 time in total.
User avatar
sander
Release Testers
Release Testers
Posts: 9429
Joined: January 22nd, 2008, 2:22 pm

Re: stuck at "trying to fetch"

Post by sander »

mogodon wrote:Yes apparently there is an "issue" with SSL certificates on all of the QNAP models. QNAP have been asked by the community in the past to fix this but nothing had been done.
Interesting. Have you got a link for me?
mogodon
Newbie
Newbie
Posts: 13
Joined: September 3rd, 2015, 10:06 am

Re: stuck at "trying to fetch"

Post by mogodon »

It believe it's to do with the fact that they provide a shared certificate rather than an individual one per device that is causing a lot of issues. I'll see if I can dig some links from the QNAP forum.
Post Reply