Skip to content

403 Client Error: Forbidden for url for Harvard Dataverse link #72

Description

@spaceashley

Hello,

I recently ran into this error below. This error is the same regardless of machine using it. Is there a way around it?

Error looking up DOI "10.7910/DVN/EWCNL5" in the Harvard Dataverse.
<!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML 2.0//EN">
<html><head>
<title>403 Forbidden</title>
</head><body>
<h1>Forbidden</h1>
<p>You don't have permission to access this resource.</p>
</body></html>

---------------------------------------------------------------------------
HTTPError                                 Traceback (most recent call last)
Cell In[2], line 1
----> 1 from radpy.sed_batch_mode import *

File /home/shared_envs/miniconda3/envs/radpy_env/lib/python3.12/site-packages/radpy/sed_batch_mode.py:1
----> 1 from radpy.sedfit import *
      2 from radpy.stellar import *
      3 from radpy.batchmode import extract_id, find_files_for_star, convert_names_to_latex, format_catalog_name, save_plot

File /home/shared_envs/miniconda3/envs/radpy_env/lib/python3.12/site-packages/radpy/sedfit.py:26
     23 from matplotlib.ticker import (MultipleLocator, FormatStrFormatter, AutoMinorLocator)
     25 pyphot.config.set_units_backend('pint')
---> 26 dustmaps.sfd.fetch()
     28 import warnings
     29 warnings.filterwarnings("ignore")

File /home/shared_envs/miniconda3/envs/radpy_env/lib/python3.12/site-packages/dustmaps/sfd.py:161, in fetch()
    157 local_fname = os.path.join(
    158     data_dir(),
    159     'sfd', 'SFD_dust_4096_{}.fits'.format(pole))
    160 print('Downloading SFD data file to {}'.format(local_fname))
--> 161 fetch_utils.dataverse_download_doi(
    162     doi,
    163     local_fname,
    164     file_requirements=requirements)

File /home/shared_envs/miniconda3/envs/radpy_env/lib/python3.12/site-packages/dustmaps/fetch_utils.py:396, in dataverse_download_doi(doi, local_fname, file_requirements, clobber)
    371 def dataverse_download_doi(doi,
    372                            local_fname=None,
    373                            file_requirements={},
    374                            clobber=False):
    375     """
    376     Downloads a file from the Dataverse, using a DOI and set of metadata
    377     parameters to locate the file.
   (...)    394 
    395     """
--> 396     metadata = dataverse_search_doi(doi)
    398     def requirements_match(metadata):
    399         for key in file_requirements.keys():

File /home/shared_envs/miniconda3/envs/radpy_env/lib/python3.12/site-packages/dustmaps/fetch_utils.py:361, in dataverse_search_doi(doi)
    359     print('Error looking up DOI "{}" in the Harvard Dataverse.'.format(doi))
    360     print(r.text)
--> 361     raise error
    363 return json.loads(r.text)

File /home/shared_envs/miniconda3/envs/radpy_env/lib/python3.12/site-packages/dustmaps/fetch_utils.py:357, in dataverse_search_doi(doi)
    354 r = requests.get(url)
    356 try:
--> 357     r.raise_for_status()
    358 except requests.exceptions.HTTPError as error:
    359     print('Error looking up DOI "{}" in the Harvard Dataverse.'.format(doi))

File /home/shared_envs/miniconda3/envs/radpy_env/lib/python3.12/site-packages/requests/models.py:1167, in Response.raise_for_status(self)
   1162     http_error_msg = (
   1163         f"{self.status_code} Server Error: {reason} for url: {self.url}"
   1164     )
   1166 if http_error_msg:
-> 1167     raise HTTPError(http_error_msg, response=self)

HTTPError: 403 Client Error: Forbidden for url: https://dataverse.harvard.edu/api/datasets/:persistentId?persistentId=doi:10.7910/DVN/EWCNL5

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions