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

Ensure api_token is not included in the response on error #469

Open
tgaddair opened this issue May 15, 2024 · 3 comments
Open

Ensure api_token is not included in the response on error #469

tgaddair opened this issue May 15, 2024 · 3 comments
Assignees
Labels
bug Something isn't working

Comments

@tgaddair
Copy link
Contributor

No description provided.

@tgaddair tgaddair added the bug Something isn't working label May 15, 2024
@noyoshi
Copy link
Collaborator

noyoshi commented May 16, 2024

Would also be good to remove it from server logs as well

@tgaddair
Copy link
Contributor Author

Hmm, not able to repro. This is the error I get when using a bad token:

Traceback (most recent call last):
  File "/data/lorax/clients/python/lorax/client.py", line 342, in generate_stream
    response = StreamResponse(**json_payload)
  File "/opt/conda/lib/python3.10/site-packages/pydantic/main.py", line 176, in __init__
    self.__pydantic_validator__.validate_python(data, self_instance=self)
pydantic_core._pydantic_core.ValidationError: 1 validation error for StreamResponse
token
  Field required [type=missing, input_value={'error': 'Request failed...ror_type': 'generation'}, input_type=dict]
    For further information visit https://errors.pydantic.dev/2.7/v/missing

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/data/lorax/test_speculate.py", line 54, in <module>
    for resp in client.generate_stream(
  File "/data/lorax/clients/python/lorax/client.py", line 345, in generate_stream
    raise parse_error(resp.status_code, json_payload)
lorax.errors.GenerationError: Request failed during generation: Server error: 401 Client Error. (Request ID: Root=1-664797a7-3da69d07260da6a91fe42e67;c6bd25da-df19-48cf-bb68-770eb0a94ad7)

Repository Not Found for url: https://huggingface.co/api/models/predibase/test-private-lora.
Please make sure you specified the correct `repo_id` and `repo_type`.
If you are trying to access a private or gated repo, make sure you are authenticated.
Invalid username or password.

@tgaddair
Copy link
Contributor Author

It's true that the token will show up in logs if provided in the request body, but not if it's inserted into the headers.

@magdyksaleh magdyksaleh self-assigned this May 23, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

3 participants