yumorishita / LiCSBAS2

GNU General Public License v3.0
18 stars 2 forks source link

requests.exceptions.TooManyRedirects: Exceeded 30 redirects. in LiCSBAS01_get_geotiff.py #54

Closed yumorishita closed 4 weeks ago

yumorishita commented 4 weeks ago

Everyone suddenly started facing the error below. This does not seem to be a temporary issue. Perhaps the site access policy was recently changed.

Searching latest epoch for mli...
Traceback (most recent call last):
File "/home/gagahap/LiCSBAS2/bin/LiCSBAS01_get_geotiff.py", line 500, in
sys.exit(main())
^^^^^^
File "/home/gagahap/LiCSBAS2/bin/LiCSBAS01_get_geotiff.py", line 213, in main
response = requests.get(url)
^^^^^^^^^^^^^^^^^
File "/home/gagahap/miniconda3/envs/licsbas/lib/python3.12/site-packages/requests/api.py", line 73, in get
return request("get", url, params=params, **kwargs)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/home/gagahap/miniconda3/envs/licsbas/lib/python3.12/site-packages/requests/api.py", line 59, in request
return session.request(method=method, url=url, **kwargs)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/home/gagahap/miniconda3/envs/licsbas/lib/python3.12/site-packages/requests/sessions.py", line 589, in request
resp = self.send(prep, **send_kwargs)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/home/gagahap/miniconda3/envs/licsbas/lib/python3.12/site-packages/requests/sessions.py", line 725, in send
history = [resp for resp in gen]
^^^^^^^^^^^^^^^^^^^^^^
File "/home/gagahap/miniconda3/envs/licsbas/lib/python3.12/site-packages/requests/sessions.py", line 191, in resolve_redirects
raise TooManyRedirects(
requests.exceptions.TooManyRedirects: Exceeded 30 redirects.

https://github.com/yumorishita/LiCSBAS/issues/364#issuecomment-2148598877 https://github.com/yumorishita/LiCSBAS2/issues/53 https://github.com/yumorishita/LiCSBAS/issues/367 https://github.com/yumorishita/LiCSBAS/issues/366

yumorishita commented 4 weeks ago

@espiritocz Suddenly LiCSBAS01_get_geotiff.py became not workable. I wonder if the LiCSAR server's setting could have been changed. Do you have the same issue in your environment or repository? Do you have any idea to fix this issue?

espiritocz commented 4 weeks ago

thank you. as mentioned in the other post, there was a public server maintenance yesterday. Apologies for the inconvenience, it should all work again as usual.

st 5. 6. 2024 v 13:58 odesílatel Yu Morishita @.***> napsal:

@espiritocz https://github.com/espiritocz Suddenly LiCSBAS01_get_geotiff.py became not workable. I wonder if the LiCSAR server's setting could have been changed. Do you have the same issue in your environment or repository? Do you have any idea to fix this issue?

— Reply to this email directly, view it on GitHub https://github.com/yumorishita/LiCSBAS2/issues/54#issuecomment-2149806099, or unsubscribe https://github.com/notifications/unsubscribe-auth/AADYYKWRO63LFRHIBQZCA2LZF4DQRAVCNFSM6AAAAABI2TXVR2VHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDCNBZHAYDMMBZHE . You are receiving this because you were mentioned.Message ID: @.***>

duyhoangatk commented 4 weeks ago

Hi Prof Yumorishita and espiritocz. Sorry to comment in this post Thank you for your information, but I have retried and the problem is still not fixed yet. Do I have to wait until it is fixed or do you have any ideas to fix this ? Waiting for your replies. Thank you very much.

yumorishita commented 4 weeks ago

@espiritocz A different point from the usual maintenance case is that

  1. requests.get(url) for a file can normally work (i.e., https://gws-access.jasmin.ac.uk/public/nceo_geohazards/LiCSAR_products/124/124D_04854_171313/metadata/metadata.txt)
  2. requests.get(url) for a folder returns TooManyRedirects exception (i.e., https://gws-access.jasmin.ac.uk/public/nceo_geohazards/LiCSAR_products/124/124D_04854_171313/epochs)

The 2nd point must be fixed. I wonder if the cause is in the server-side setting. I hope the system team can solve the issue.

espiritocz commented 4 weeks ago

thank you, also noticed this is the issue. solution is actually simple: url = ' https://gws-access.jasmin.ac.uk/public/nceo_geohazards/LiCSAR_products/124/124D_04854_171313/epochs'

will not work

url = ' https://gws-access.jasmin.ac.uk/public/nceo_geohazards/LiCSAR_products/124/124D_04854_171313/epochs/'

will work as usual

must be related to updated version/settings of the web server. will fix this in our fork. cheers!

čt 6. 6. 2024 v 12:12 odesílatel Yu Morishita @.***> napsal:

@espiritocz https://github.com/espiritocz A different point from the usual maintenance case is that

  1. requests.get(url) for a file can normally work (i.e., https://gws-access.jasmin.ac.uk/public/nceo_geohazards/LiCSAR_products/124/124D_04854_171313/metadata/metadata.txt )
  2. requests.get(url) for a folder returns TooManyRedirects exception (i.e., https://gws-access.jasmin.ac.uk/public/nceo_geohazards/LiCSAR_products/124/124D_04854_171313/epochs )

The 2nd point must be fixed. I wonder if the cause is in the server-side setting. I hope the system team can solve the issue.

— Reply to this email directly, view it on GitHub https://github.com/yumorishita/LiCSBAS2/issues/54#issuecomment-2152065300, or unsubscribe https://github.com/notifications/unsubscribe-auth/AADYYKUO7WKA4QX5CYO44MTZGA7Y5AVCNFSM6AAAAABI2TXVR2VHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDCNJSGA3DKMZQGA . You are receiving this because you were mentioned.Message ID: @.***>

yumorishita commented 4 weeks ago

@espiritocz Great! Thank you for your cooperation!