HLS Tutorial: HTTPError: HTTP Error 403: Forbidden

Use this Forum to find information on, or ask a question about, NASA Earth Science data.
Post Reply
octopifriends
Posts: 1
Joined: Wed Aug 28, 2024 4:36 pm America/New_York
Answers: 0

HLS Tutorial: HTTPError: HTTP Error 403: Forbidden

by octopifriends » Wed Aug 28, 2024 4:41 pm America/New_York

Hi! I have been using the Getting Started with Cloud-Native HLS Data in Python. I am getting the below error, I don't think it has to do with my .netrc file since I had it running correctly previously. I am unable to open any of these links ['https://data.lpdaac.earthdatacloud.nasa.gov/lp-prod-public/HLSS30.020/HLS.S30.T12SUG.2021152T180919.v2.0/HLS.S30.T12SUG.2021152T180919.v2.0.jpg',
'https://data.lpdaac.earthdatacloud.nasa.gov/lp-prod-public/HLSS30.020/HLS.S30.T12STG.2021152T180919.v2.0/HLS.S30.T12STG.2021152T180919.v2.0.jpg'] and just get {"message":"Forbidden"}.

The tutorial itself errors on the below. Thank you!


###############################
:HTTPError Traceback (most recent call last)
Cell In[17], line 1
----> 1 image = io.imread(browse_urls[2]) # Load jpg browse image into memory
3 # Basic plot of the image
4 plt.figure(figsize=(10,10))

File ~\anaconda3\envs\lpdaac_tutorials\lib\site-packages\skimage\io\_io.py:59, in imread(fname, as_gray, plugin, **plugin_args)
56 if fname.lower().endswith(('.tiff', '.tif')):
57 plugin = 'tifffile'
---> 59 with file_or_url_context(fname) as fname:
60 img = call_plugin('imread', fname, plugin=plugin, **plugin_args)
62 if not hasattr(img, 'ndim'):

File ~\anaconda3\envs\lpdaac_tutorials\lib\contextlib.py:135, in _GeneratorContextManager.__enter__(self)
133 del self.args, self.kwds, self.func
134 try:
--> 135 return next(self.gen)
136 except StopIteration:
137 raise RuntimeError("generator didn't yield") from None

File ~\anaconda3\envs\lpdaac_tutorials\lib\site-packages\skimage\io\util.py:27, in file_or_url_context(resource_name)
25 try:
26 with tempfile.NamedTemporaryFile(delete=False, suffix=ext) as f:
---> 27 with urllib.request.urlopen(resource_name) as u:
28 f.write(u.read())
29 # f must be closed before yielding

File ~\anaconda3\envs\lpdaac_tutorials\lib\urllib\request.py:216, in urlopen(url, data, timeout, cafile, capath, cadefault, context)
214 else:
215 opener = _opener
--> 216 return opener.open(url, data, timeout)

File ~\anaconda3\envs\lpdaac_tutorials\lib\urllib\request.py:525, in OpenerDirector.open(self, fullurl, data, timeout)
523 for processor in self.process_response.get(protocol, []):
524 meth = getattr(processor, meth_name)
--> 525 response = meth(req, response)
527 return response

File ~\anaconda3\envs\lpdaac_tutorials\lib\urllib\request.py:634, in HTTPErrorProcessor.http_response(self, request, response)
631 # According to RFC 2616, "2xx" code indicates that the client's
632 # request was successfully received, understood, and accepted.
633 if not (200 <= code < 300):
--> 634 response = self.parent.error(
635 'http', request, response, code, msg, hdrs)
637 return response

File ~\anaconda3\envs\lpdaac_tutorials\lib\urllib\request.py:563, in OpenerDirector.error(self, proto, *args)
561 if http_err:
562 args = (dict, 'default', 'http_error_default') + orig_args
--> 563 return self._call_chain(*args)

File ~\anaconda3\envs\lpdaac_tutorials\lib\urllib\request.py:496, in OpenerDirector._call_chain(self, chain, kind, meth_name, *args)
494 for handler in handlers:
495 func = getattr(handler, meth_name)
--> 496 result = func(*args)
497 if result is not None:
498 return result

File ~\anaconda3\envs\lpdaac_tutorials\lib\urllib\request.py:643, in HTTPDefaultErrorHandler.http_error_default(self, req, fp, code, msg, hdrs)
642 def http_error_default(self, req, fp, code, msg, hdrs):
--> 643 raise HTTPError(req.full_url, code, msg, hdrs, fp)

HTTPError: HTTP Error 403: Forbidden

Filters:

LP DAAC-EDL - dgolon
Posts: 422
Joined: Mon Sep 30, 2019 10:00 am America/New_York
Answers: 0
Has endorsed: 31 times
Endorsed: 8 times
Contact:

Re: HLS Tutorial: HTTPError: HTTP Error 403: Forbidden

by LP DAAC-EDL - dgolon » Thu Aug 29, 2024 9:58 am America/New_York

Hello @octopifriends We believe this error has been resolved. Could you please try again?
Subscribe to the LP DAAC listserv by sending a blank email to lpdaac-join@lists.nasa.gov.

Sign up for the Landsat listserv to receive the most up to date information about Landsat data: https://public.govdelivery.com/accounts/USDOIGS/subscriber/new#tab1.

Post Reply