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

Better secret error handling. #531

Merged
merged 4 commits into from
Aug 10, 2023
Merged

Conversation

squidarth
Copy link
Collaborator

TODO: Write integration tests

Summary

Currently, if you are missing secrets from your config file, you get this error:


Aug 09 2:11:07pm
Exception while loading model

Traceback (most recent call last):
  File "/app/model_wrapper.py", line 101, in load
    self.try_load()
  File "/app/model_wrapper.py", line 163, in try_load
    retry(
  File "/app/common/retry.py", line 20, in retry
    raise exc
  File "/app/common/retry.py", line 15, in retry
    fn()
  File "/app/model/model.py", line 21, in load
    "pyannote/speaker-diarization@2.1", use_auth_token=self._secrets["hf_access_token"]
  File "/app/shared/secrets_resolver.py", line 37, in __getitem__
    return SecretsResolver._resolve_secret(key, self._base_secrets[key])
KeyError: 'hf_access_token'

Similarly, if your secrets are not mounted, you will just get a silent failure and a None returned from secrets.get().

Fix

I propose fixing this by returning a new exception type with more information.

@squidarth squidarth requested review from bolasim and aspctu August 9, 2023 18:57
@squidarth squidarth merged commit 3638f14 into main Aug 10, 2023
@squidarth squidarth deleted the sshanker/better-secret-error-handling branch August 10, 2023 20:52
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants