galaxyproject / galaxyproject/cloudlaunch
Correct credentials not being used.
- Dominant language
- Python
- Stars
- 42
- Forks
- 36
- PR merge metrics
- No merged PRs in 30d
Description
This error was encountered by Jessica when trying to launch with both saved and temp credentials. Strangely, the keypairs were fetched, but the vm_types always error out.
She had 2 set of credentials saved with none set as default. Using temp credentials also did not help.
Could be related to: https://github.com/galaxyproject/cloudlaunch/issues/115
Setting one set of credentials as default solved the problem. This seems incorrect, since it should always respect selected credentials or temp credentials.
Logs revealed following:
```
ERROR:django.request:Internal Server Error: /cloudlaunch/api/v1/infrastructure/clouds/nectar/regions/melbourne/zones/melbourne-qh2-uom/compute/vm_types/
Traceback (most recent call last):
File "/app/venv/lib/python3.6/site-packages/django/core/handlers/exception.py", line 34, in inner
response = get_response(request)
File "/app/venv/lib/python3.6/site-packages/django/core/handlers/base.py", line 115, in _get_response
response = self.process_exception_by_middleware(e, request)
File "/app/venv/lib/python3.6/site-packages/django/core/handlers/base.py", line 113, in _get_response
response = wrapped_callback(request, *callback_args, **callback_kwargs)
File "/app/venv/lib/python3.6/site-packages/django/views/decorators/csrf.py", line 54, in wrapped_view
return view_func(*args, **kwargs)
File "/app/venv/lib/python3.6/site-packages/rest_framework/viewsets.py", line 114, in view
return self.dispatch(request, *args, **kwargs)
File "/app/venv/lib/python3.6/site-packages/rest_framework/views.py", line 505, in dispatch
response = self.handle_exception(exc)
File "/app/venv/lib/python3.6/site-packages/rest_framework/views.py", line 465, in handle_exception
self.raise_uncaught_exception(exc)
File "/app/venv/lib/python3.6/site-packages/rest_framework/views.py", line 476, in raise_uncaught_exception
raise exc
File "/app/venv/lib/python3.6/site-packages/rest_framework/views.py", line 502, in dispatch
response = handler(request, *args, **kwargs)
File "/app/venv/lib/python3.6/site-packages/rest_framework/mixins.py", line 38, in list
queryset = self.filter_queryset(self.get_queryset())
File "/app/venv/lib/python3.6/site-packages/djcloudbridge/drf_helpers.py", line 34, in get_queryset
return self.list_objects()
File "/app/venv/lib/python3.6/site-packages/djcloudbridge/views.py", line 343, in list_objects
provider = view_helpers.get_cloud_provider(self)
File "/app/venv/lib/python3.6/site-packages/djcloudbridge/view_helpers.py", line 19, in get_cloud_provider
request_creds = get_credentials(cloud, view.request)
File "/app/venv/lib/python3.6/site-packages/djcloudbridge/view_helpers.py", line 33, in get_credentials
return get_credentials_from_profile(cloud, request)
File "/app/venv/lib/python3.6/site-packages/djcloudbridge/view_helpers.py", line 231, in get_credentials_from_profile
raise ValueError("Too many credentials to choose from.")
ValueError: Too many credentials to choose from.
```
Contributor guide
No contributing guide indexed for this repository
Research direction
Start with djcloudbridge/view_helpers.py, especially get_credentials_from_profile, and trace the /cloudlaunch/api/v1/infrastructure/clouds/nectar/regions/melbourne/zones/melbourne-qh2-uom/compute/vm_types/ request. Reproduce the case with multiple saved credentials and temporary credentials. Done means the selected credentials are respected without raising “Too many credentials to choose from.”
Written by the indexing model from the issue text.
Assessment
- Tech stack
- django, python
- Domain
- api, authentication, cloud
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 45/100