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

aibrix throw AttributeError if the credentials is missed #208

Closed
Jeffwan opened this issue Sep 24, 2024 · 5 comments
Closed

aibrix throw AttributeError if the credentials is missed #208

Jeffwan opened this issue Sep 24, 2024 · 5 comments
Assignees
Labels
area/runtime event/bugbash issues reported at bug bash kind/bug Something isn't working
Milestone

Comments

@Jeffwan
Copy link
Collaborator

Jeffwan commented Sep 24, 2024

🐛 Describe the bug

I forgot setting up credentials before downloading TOS models, it throws such errors. Actually, we should improve it to ask for credentials..

root@2ecb94f62aa8:/tmp# python3 -m aibrix.downloader     --model-uri tos://aibrix-artifact-testing/models/deepseek-ai/deepseek-coder-6.7b-instruct/     --local-dir /tmp/aibrix/models_tos/
Traceback (most recent call last):
  File "/usr/lib/python3.8/runpy.py", line 194, in _run_module_as_main
    return _run_code(code, main_globals, None,
  File "/usr/lib/python3.8/runpy.py", line 87, in _run_code
    exec(code, run_globals)
  File "/usr/local/lib/python3.8/dist-packages/aibrix/downloader/__main__.py", line 26, in <module>
    main()
  File "/usr/local/lib/python3.8/dist-packages/aibrix/downloader/__main__.py", line 22, in main
    download_model(args.model_uri, args.local_dir)
  File "/usr/local/lib/python3.8/dist-packages/aibrix/downloader/__init__.py", line 28, in download_model
    downloader = get_downloader(model_uri)
  File "/usr/local/lib/python3.8/dist-packages/aibrix/downloader/base.py", line 164, in get_downloader
    return TOSDownloader(model_uri)
  File "/usr/local/lib/python3.8/dist-packages/aibrix/downloader/tos.py", line 48, in __init__
    self.client = tos.TosClientV2(
  File "/usr/local/lib/python3.8/dist-packages/tos/clientv2.py", line 935, in __init__
    credentials_provider = StaticCredentialsProvider(ak, sk, security_token)
  File "/usr/local/lib/python3.8/dist-packages/tos/credential.py", line 111, in __init__
    self.credentials = Credentials(access_key_id, access_key_secret, security_token)
  File "/usr/local/lib/python3.8/dist-packages/tos/credential.py", line 20, in __init__
    self.access_key_id = access_key_id.strip()
AttributeError: 'NoneType' object has no attribute 'strip'

Steps to Reproduce

  1. do not set credential but download a TOS model

Expected behavior

No response

Environment

No response

@brosoul
Copy link
Collaborator

brosoul commented Sep 26, 2024

I think this issue has already been resolved in #221 .

Did I misunderstand this issue? Can we discuss it offline.
@Jeffwan

@Jeffwan
Copy link
Collaborator Author

Jeffwan commented Sep 27, 2024

I think the root cause is the missing access_key_id , it should be addressed by #221. But I have side question, if we set credentials to empty string ``, does it still work for anonymous downloads? would it throw any errors? If we are not sure, we should leave a TODO and comment, otherwise, we introduce new bugs and block the anonymous artifact downloads

@brosoul
Copy link
Collaborator

brosoul commented Sep 27, 2024

When credentials are not set, the anonymous download of TOS has already been verified, but the anonymous download of S3 still needs to be verified.
@Jeffwan

  • Verify the anonymous download of TOS
  • Verify the anonymous download of S3

@Jeffwan
Copy link
Collaborator Author

Jeffwan commented Sep 27, 2024

Seems it does need a correct credential.

Case 1: None -> fatal error: Unable to locate credentials

image

Case 2: "" empty string -> 403 Forbidden

image

Case 3: with credential but no s3 permission

image

@Jeffwan
Copy link
Collaborator Author

Jeffwan commented Sep 27, 2024

Seems aws cli (s3) implementation is different from tos client. Most of the case we are visiting private s3 so I suggest to check the existence of AWS credential if user are using S3. @brosoul Let's do a minor change.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/runtime event/bugbash issues reported at bug bash kind/bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants