Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

get_token errors when testing on dev #280

Open
aclum opened this issue Nov 4, 2024 · 2 comments
Open

get_token errors when testing on dev #280

aclum opened this issue Nov 4, 2024 · 2 comments

Comments

@aclum
Copy link
Contributor

aclum commented Nov 4, 2024

Im trying to test microbiomedata/issues#819 and there are errors with get_token when using dev. I am able to get a token from runtime dev with swagger UI using the client credentials for nmdcda.

to reproduce:
(nmdc_automation) nmdcda@perlmutter:login33:/global/cfs/cdirs/m3408/users/nmdcda/repos/nmdc_automation> poetry run python nmdc_automation/run_process/run_import.py import-projects test_import.csv configs/import.yaml configs/site_configuration.toml

where api_url = "https://api-dev.microbimedata.org"

and
cat test_import.csv
nucleotide_sequencing_id project_id project_path
nmdc:omprc-11-ycnhgw23 Ga0597026 /global/cfs/projectdirs/m3408/aim2/dev/bioscales_mapping/neon_analysis_projects/Ga0597026/

@mbthornton-lbl
Copy link
Contributor

Similar result from running run_import.py on Perlmutter:

(nmdc-automation-py3.11) (nersc-python) nmdcda@perlmutter:login34:~/nmdc_automation/dev> python nmdc_automation/nmdc_automation/run_process/run_import.py import-projects import.tsv nmdc_automation/configs/import.yaml ./site_configuration_nersc.toml
INFO:__main__:Importing project from import.tsv
/global/cfs/cdirs/m3408/nmdc_automation/dev/nmdc_automation/nmdc_automation/run_process/run_import.py:104: DeprecationWarning: open_text is deprecated. Use files() instead. Refer to https://importlib-resources.readthedocs.io/en/latest/using.html#migrating-from-legacy for migration advice.
  with importlib.resources.open_text("nmdc_schema", "nmdc_materialized_patterns.yaml") as f:
INFO:__main__:Importing nmdc:omprc-12-hgksne68 from /global/cfs/cdirs/m3408/aim2/dev/1000_soils/1000_soils_analysis_projects/Ga0533572: 65 files
INFO:__main__:Mapping sequencing data
INFO:__main__:Mapping single data files
INFO:__main__:Mapping multiple data files
INFO:__main__:Mapping workflow executions
INFO:root:Processing Reads QC
INFO:root:Processing Metagenome Assembly
INFO:__main__:Validating imported data
INFO:__main__:Validation Passed
INFO:__main__:Applying update to sequencing data generation
ERROR:__main__:Error applying update to sequencing data generation: 401 Client Error: Unauthorized for url: https://api-dev.microbiomedata.org/queries:run
Traceback (most recent call last):
  File "/global/cfs/cdirs/m3408/nmdc_automation/dev/nmdc_automation/nmdc_automation/run_process/run_import.py", line 116, in <module>
    cli()
  File "/global/cfs/cdirs/m3408/nmdc_automation/dev/nmdc_automation/.venv/lib/python3.11/site-packages/click/core.py", line 1157, in __call__
    return self.main(*args, **kwargs)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/global/cfs/cdirs/m3408/nmdc_automation/dev/nmdc_automation/.venv/lib/python3.11/site-packages/click/core.py", line 1078, in main
    rv = self.invoke(ctx)
         ^^^^^^^^^^^^^^^^
  File "/global/cfs/cdirs/m3408/nmdc_automation/dev/nmdc_automation/.venv/lib/python3.11/site-packages/click/core.py", line 1688, in invoke
    return _process_result(sub_ctx.command.invoke(sub_ctx))
                           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/global/cfs/cdirs/m3408/nmdc_automation/dev/nmdc_automation/.venv/lib/python3.11/site-packages/click/core.py", line 1434, in invoke
    return ctx.invoke(self.callback, **ctx.params)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/global/cfs/cdirs/m3408/nmdc_automation/dev/nmdc_automation/.venv/lib/python3.11/site-packages/click/core.py", line 783, in invoke
    return __callback(*args, **kwargs)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/global/cfs/cdirs/m3408/nmdc_automation/dev/nmdc_automation/nmdc_automation/run_process/run_import.py", line 88, in import_projects
    raise e
  File "/global/cfs/cdirs/m3408/nmdc_automation/dev/nmdc_automation/nmdc_automation/run_process/run_import.py", line 85, in import_projects
    runtime.run_query(data_generation_update)
  File "/global/cfs/cdirs/m3408/nmdc_automation/dev/nmdc_automation/nmdc_automation/api/nmdcapi.py", line 68, in _get_token
    return func(self, *args, **kwargs)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/global/cfs/cdirs/m3408/nmdc_automation/dev/nmdc_automation/nmdc_automation/api/nmdcapi.py", line 330, in run_query
    resp.raise_for_status()
  File "/global/cfs/cdirs/m3408/nmdc_automation/dev/nmdc_automation/.venv/lib/python3.11/site-packages/requests/models.py", line 1024, in raise_for_status
    raise HTTPError(http_error_msg, response=self)
requests.exceptions.HTTPError: 401 Client Error: Unauthorized for url: https://api-dev.microbiomedata.org/queries:run

@ssarrafan
Copy link

There is a thread on Slack about this. @mbthornton-lbl @aclum @shreddd assuming this will continue for the next sprint.

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

When branches are created from issues, their pull requests are automatically linked.

3 participants