afeinstein20 / eleanor

A tool for light curve extraction from the TESS FFIs.
MIT License
92 stars 39 forks source link

cannot connect to "https://archive.stsci.edu/missions/tess/ffi/" using urllib.request.urlopen #259

Open cxl4444 opened 2 years ago

cxl4444 commented 2 years ago

Hi, when I used the module eleanor.Update(), the connection to https://archive.stsci.edu/missions/tess/ffi/ was filed, and following is the output when I use urllib.request.urlopen() to visit above page.


TimeoutError Traceback (most recent call last) /opt/anaconda3/lib/python3.7/urllib/request.py in do_open(self, http_class, req, **http_conn_args) 1318 h.request(req.get_method(), req.selector, req.data, headers, -> 1319 encode_chunked=req.has_header('Transfer-encoding')) 1320 except OSError as err: # timeout error

/opt/anaconda3/lib/python3.7/http/client.py in request(self, method, url, body, headers, encode_chunked) 1251 """Send a complete request to the server.""" -> 1252 self._send_request(method, url, body, headers, encode_chunked) 1253

/opt/anaconda3/lib/python3.7/http/client.py in _send_request(self, method, url, body, headers, encode_chunked) 1297 body = _encode(body, 'body') -> 1298 self.endheaders(body, encode_chunked=encode_chunked) 1299

/opt/anaconda3/lib/python3.7/http/client.py in endheaders(self, message_body, encode_chunked) 1246 raise CannotSendHeader() -> 1247 self._send_output(message_body, encode_chunked=encode_chunked) 1248

/opt/anaconda3/lib/python3.7/http/client.py in _send_output(self, message_body, encode_chunked) 1025 del self._buffer[:] -> 1026 self.send(msg) 1027

/opt/anaconda3/lib/python3.7/http/client.py in send(self, data) 965 if self.auto_open: --> 966 self.connect() 967 else:

/opt/anaconda3/lib/python3.7/http/client.py in connect(self) 1413 -> 1414 super().connect() 1415

/opt/anaconda3/lib/python3.7/http/client.py in connect(self) 937 self.sock = self._create_connection( --> 938 (self.host,self.port), self.timeout, self.source_address) 939 self.sock.setsockopt(socket.IPPROTO_TCP, socket.TCP_NODELAY, 1)

/opt/anaconda3/lib/python3.7/socket.py in create_connection(address, timeout, source_address) 727 try: --> 728 raise err 729 finally:

/opt/anaconda3/lib/python3.7/socket.py in create_connection(address, timeout, source_address) 715 sock.bind(source_address) --> 716 sock.connect(sa) 717 # Break explicitly a reference cycle

TimeoutError: [Errno 110] Connection timed out

During handling of the above exception, another exception occurred:

URLError Traceback (most recent call last)

in ----> 1 urlopen(baseurl) /opt/anaconda3/lib/python3.7/urllib/request.py in urlopen(url, data, timeout, cafile, capath, cadefault, context) 220 else: 221 opener = _opener --> 222 return opener.open(url, data, timeout) 223 224 def install_opener(opener): /opt/anaconda3/lib/python3.7/urllib/request.py in open(self, fullurl, data, timeout) 523 req = meth(req) 524 --> 525 response = self._open(req, data) 526 527 # post-process response /opt/anaconda3/lib/python3.7/urllib/request.py in _open(self, req, data) 541 protocol = req.type 542 result = self._call_chain(self.handle_open, protocol, protocol + --> 543 '_open', req) 544 if result: 545 return result /opt/anaconda3/lib/python3.7/urllib/request.py in _call_chain(self, chain, kind, meth_name, *args) 501 for handler in handlers: 502 func = getattr(handler, meth_name) --> 503 result = func(*args) 504 if result is not None: 505 return result /opt/anaconda3/lib/python3.7/urllib/request.py in https_open(self, req) 1360 def https_open(self, req): 1361 return self.do_open(http.client.HTTPSConnection, req, -> 1362 context=self._context, check_hostname=self._check_hostname) 1363 1364 https_request = AbstractHTTPHandler.do_request_ /opt/anaconda3/lib/python3.7/urllib/request.py in do_open(self, http_class, req, **http_conn_args) 1319 encode_chunked=req.has_header('Transfer-encoding')) 1320 except OSError as err: # timeout error -> 1321 raise URLError(err) 1322 r = h.getresponse() 1323 except: URLError:
benmontet commented 2 years ago

Thanks for posting! I am able to run the update script without any problems. Given it was a timeout error, I wonder if the MAST servers happened to be down when you ran it and you got unlucky in your timing? Can you delete (if it exists) your ~/.eleanor/metadata/s00NN directory, where s00NN is the sector you were trying to update, and try again and see if it works now?