urlopen error [Errno 110] Connection timed out

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
7 messages Options
Reply | Threaded
Open this post in threaded view
|

urlopen error [Errno 110] Connection timed out

suase9303

I use pythonanywhere. At this time, "urlopen error [Errno 110] Connection timed out" occurs. So I set CACHES TIMEOUT to None in Django settings.py. However, error 110 still occurs. Do I need to change the timeout value in urllib / request.py? I would really appreciate your help in this matter.

--
You received this message because you are subscribed to the Google Groups "Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
To post to this group, send email to [hidden email].
Visit this group at https://groups.google.com/group/django-users.
To view this discussion on the web visit https://groups.google.com/d/msgid/django-users/2a798988-c7ab-4ec8-b967-e4f00af5b27b%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
Reply | Threaded
Open this post in threaded view
|

Re: urlopen error [Errno 110] Connection timed out

Julio Biason-3
Hello,

Where does this happen? Do you do urlopen somewhere? (IIRC, changing Django settings doesn't affect internal Python objects).

urllib.request has a timeout, it's the second parameter after the data: https://docs.python.org/3/library/urllib.request.html?highlight=urllib#urllib.request.urlopen

But you shouldn't do anything long while answering a request. You should probalby use something like Celery to retrieve information in the background, freeing the request (and later show the proper response).

On Mon, Jan 8, 2018 at 2:30 PM, <[hidden email]> wrote:

I use pythonanywhere. At this time, "urlopen error [Errno 110] Connection timed out" occurs. So I set CACHES TIMEOUT to None in Django settings.py. However, error 110 still occurs. Do I need to change the timeout value in urllib / request.py? I would really appreciate your help in this matter.

--
You received this message because you are subscribed to the Google Groups "Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
To post to this group, send email to [hidden email].
Visit this group at https://groups.google.com/group/django-users.
To view this discussion on the web visit https://groups.google.com/d/msgid/django-users/2a798988-c7ab-4ec8-b967-e4f00af5b27b%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.



--
Julio Biason, Sofware Engineer
AZION  |  Deliver. Accelerate. Protect.
Office: <a href="callto:+555130838101" value="+555130838101" style="color:rgb(17,85,204);font-family:arial,sans-serif;font-size:12.8px" target="_blank">+55 51 3083 8101  |  Mobile: <a href="callto:+5551996209291" style="color:rgb(17,85,204)" target="_blank">+55 51 99907 0554

--
You received this message because you are subscribed to the Google Groups "Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
To post to this group, send email to [hidden email].
Visit this group at https://groups.google.com/group/django-users.
To view this discussion on the web visit https://groups.google.com/d/msgid/django-users/CAEM7gE2w3%2BCHPhhXdpohd1Y8t5ejjvE4Q_s%3DRt4XsOhAAuRSDQ%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.
Reply | Threaded
Open this post in threaded view
|

Re: urlopen error [Errno 110] Connection timed out

suase9303
In reply to this post by suase9303
yes, i use a urlopen to crawl the some site. 
like this:
   html = urlopen(page)
   bs0bj = BeautifulSoup(html, "html.parser")

and error happen  in " /usr/lib/python3.5/urllib/request.py in do_open, "

when i open 'the site', the loading time is longer than others. then others which i crawl dont happen error 110.
so i think the site loading time is the source of error. maybe the loading time exceed the timeout deadline.

i want to length the timeout deadline, like timeout = None...


2018년 1월 9일 화요일 오전 1시 49분 56초 UTC+9, [hidden email] 님의 말:

I use pythonanywhere. At this time, "urlopen error [Errno 110] Connection timed out" occurs. So I set CACHES TIMEOUT to None in Django settings.py. However, error 110 still occurs. Do I need to change the timeout value in urllib / request.py? I would really appreciate your help in this matter.

--
You received this message because you are subscribed to the Google Groups "Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
To post to this group, send email to [hidden email].
Visit this group at https://groups.google.com/group/django-users.
To view this discussion on the web visit https://groups.google.com/d/msgid/django-users/7838022c-886f-4cf9-8da7-5dc44c41551f%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
Reply | Threaded
Open this post in threaded view
|

Re: urlopen error [Errno 110] Connection timed out

Jason-6
You really should use an async task worker like Celery for this, to get the scraping outside of Django's request-response loop.

Is the urlopen happening with any specific URL or seemingly at random?

--
You received this message because you are subscribed to the Google Groups "Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
To post to this group, send email to [hidden email].
Visit this group at https://groups.google.com/group/django-users.
To view this discussion on the web visit https://groups.google.com/d/msgid/django-users/5fe18bd7-4501-4ac9-9a44-fa536dafdd8b%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
Reply | Threaded
Open this post in threaded view
|

Re: urlopen error [Errno 110] Connection timed out

suase9303
Thanks.!

I had better use an async task worker! i need to study the worker...

the error happens with a specific URL.



2018년 1월 9일 화요일 오후 8시 7분 15초 UTC+9, Jason 님의 말:
You really should use an async task worker like Celery for this, to get the scraping outside of Django's request-response loop.

Is the urlopen happening with any specific URL or seemingly at random?

--
You received this message because you are subscribed to the Google Groups "Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
To post to this group, send email to [hidden email].
Visit this group at https://groups.google.com/group/django-users.
To view this discussion on the web visit https://groups.google.com/d/msgid/django-users/57576a10-fa38-4817-8afa-7fec87ec8f28%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
Reply | Threaded
Open this post in threaded view
|

Re: urlopen error [Errno 110] Connection timed out

Jason-6
Are you able to load the URL directly in the browser without issue?  How about using an API client like Postman?  

--
You received this message because you are subscribed to the Google Groups "Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
To post to this group, send email to [hidden email].
Visit this group at https://groups.google.com/group/django-users.
To view this discussion on the web visit https://groups.google.com/d/msgid/django-users/166363d5-578a-4ac2-8151-b478ddf62d6a%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
Reply | Threaded
Open this post in threaded view
|

Re: urlopen error [Errno 110] Connection timed out

suase9303
Yes! i can load the Url ("http://www.aaasports.co.kr/front/productlist.php?code=001000000000&brandcode=2&listnum=30&sort=&block=0&gotopage=1") 
without issue. I think the time to load the URL is longer than any other URL, but it does not take much long.

I searched for the Postman you suggested. I do not know how to solve this problem through Postman...


2018년 1월 9일 화요일 오후 10시 50분 4초 UTC+9, Jason 님의 말:
Are you able to load the URL directly in the browser without issue?  How about using an API client like Postman?  

--
You received this message because you are subscribed to the Google Groups "Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
To post to this group, send email to [hidden email].
Visit this group at https://groups.google.com/group/django-users.
To view this discussion on the web visit https://groups.google.com/d/msgid/django-users/51686f84-61d7-45b6-b7cc-b8548c749d10%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.