GrabzIt / grabzit

GrabzIt enables you to convert HTML and URL's into JPG's, PNG's, DOCX's, videos, PDF's and more. Transform online videos into animated GIF's or convert HTML tables to JSON, CSV and Excel spreadsheets.
https://grabz.it
MIT License
66 stars 34 forks source link

TimeoutError: [WinError 10060] A connection attempt failed because the connected party did not properly respond after a period of time, or established connection failed because connected host has failed to respond #34

Closed laceyrkeller closed 3 years ago

laceyrkeller commented 3 years ago

~\Anaconda3\lib\site-packages\birdcatable\BasicTable.py in toJPG(self, user_local_cred_filepath, save_path, full_filepath, raw_html, width, height) 1082 # Call API's encryption screen capture feature, then decrypt 1083 grabzIt.HTMLToImage(raw_html, options=grabz_options) -> 1084 encrypted_result = grabzIt.SaveTo() 1085 decrypted_result = grabzIt.Decrypt(encrypted_result, encryption_key) 1086 # Use the query's heading as our filename

~\Anaconda3\lib\site-packages\GrabzIt\GrabzItClient.py in SaveTo(self, saveToFile) 279 # 280 def SaveTo(self, saveToFile = ''): --> 281 id = self.Save() 282 283 if (id == None or id == ""):

~\Anaconda3\lib\site-packages\GrabzIt\GrabzItClient.py in Save(self, callBackURL) 253 sig = self.CreateSignature(self.request.options._getSignatureString(self.applicationSecret, callBackURL, self.request._targetUrl())) 254 --> 255 obj = self._take(sig, callBackURL) 256 257 if (obj == None or obj == ""):

~\Anaconda3\lib\site-packages\GrabzIt\GrabzItClient.py in _take(self, sig, callBackURL) 267 return self.HTTPGet(self.request.url + '?' + urlencode(self.request.options._getParameters(self.applicationKey, sig, callBackURL, 'url', self.request.data))) 268 else: --> 269 return self.HTTPPost(self.request.url, self.request.options._getParameters(self.applicationKey, sig, callBackURL, 'html', quote(self.request.data))) 270 271 #

~\Anaconda3\lib\site-packages\GrabzIt\GrabzItClient.py in HTTPPost(self, selector, fields, files) 668 h.putheader('content-type', content_type) 669 h.putheader('content-length', str(len(body))) --> 670 h.endheaders() 671 672 try:

~\Anaconda3\lib\http\client.py in endheaders(self, message_body, encode_chunked) 1248 else: 1249 raise CannotSendHeader() -> 1250 self._send_output(message_body, encode_chunked=encode_chunked) 1251 1252 def request(self, method, url, body=None, headers={}, *,

~\Anaconda3\lib\http\client.py in _send_output(self, message_body, encode_chunked) 1008 msg = b"\r\n".join(self._buffer) 1009 del self._buffer[:] -> 1010 self.send(msg) 1011 1012 if message_body is not None:

~\Anaconda3\lib\http\client.py in send(self, data) 948 if self.sock is None: 949 if self.auto_open: --> 950 self.connect() 951 else: 952 raise NotConnected()

~\Anaconda3\lib\http\client.py in connect(self) 1415 "Connect to a host on a given (SSL) port." 1416 -> 1417 super().connect() 1418 1419 if self._tunnel_host:

~\Anaconda3\lib\http\client.py in connect(self) 919 def connect(self): 920 """Connect to the host and port specified in init.""" --> 921 self.sock = self._create_connection( 922 (self.host,self.port), self.timeout, self.source_address) 923 self.sock.setsockopt(socket.IPPROTO_TCP, socket.TCP_NODELAY, 1)

~\Anaconda3\lib\socket.py in create_connection(address, timeout, source_address) 806 if err is not None: 807 try: --> 808 raise err 809 finally: 810 # Break explicitly a reference cycle

~\Anaconda3\lib\socket.py in create_connection(address, timeout, source_address) 794 if source_address: 795 sock.bind(source_address) --> 796 sock.connect(sa) 797 # Break explicitly a reference cycle 798 err = None

TimeoutError: [WinError 10060] A connection attempt failed because the connected party did not properly respond after a period of time, or established connection failed because connected host has failed to respond

GrabzIt commented 3 years ago

We have just tried the Python API on a local machine and it works fine converting HTML. Are you trying to convert a large amount of HTML? Does it work for smaller amounts of HTML?

laceyrkeller commented 3 years ago

It’s very intermittent. Works for some of our users and not for others. And sometimes works for those users experiencing issues. Html we are converting is about 800x800 pixels

On Wed, Oct 13, 2021 at 16:33 GrabzIt @.***> wrote:

We have just tried the Python API on a local machine and it works fine converting HTML. Are you trying to convert a large amount of HTML? Does it work for smaller amounts of HTML?

GrabzIt commented 3 years ago

Hmm, thats difficult to track down then it could be any number of things. Please could you replace your GrabzItClient.py with this version and see if it makes an improvement: https://github.com/GrabzIt/grabzit/blob/master/python/GrabzIt/GrabzItClient.py

Other things to check are your firewalls and server connectivity.

laceyrkeller commented 3 years ago

Without changing anything, this has resolved itself.