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

Instances referencing non existing "platform_aws_m1" platform, leads to 500 error / #286

Closed
bpetit opened this issue Apr 8, 2024 · 1 comment
Labels
bug Something isn't working

Comments

@bpetit
Copy link
Collaborator

bpetit commented Apr 8, 2024

Bug description

"platform_aws_m1" is referenced by instances .m1. in aws.csv, but this platform doesn't exist in server.csv

Querying those instances on cloud/instance route leads to 500 error and this trace in the API :

'NoneType' object is not subscriptable
Traceback (most recent call last):
File "/app/boaviztapi/main.py", line 45, in catch_exceptions_middleware
return await call_next(request)
File "/usr/local/lib/python3.9/site-packages/starlette/middleware/base.py", line 84, in call_next
raise app_exc
File "/usr/local/lib/python3.9/site-packages/starlette/middleware/base.py", line 70, in coro
await self.app(scope, receive_or_disconnect, send_no_error)
File "/usr/local/lib/python3.9/site-packages/starlette/middleware/exceptions.py", line 79, in call
raise exc
File "/usr/local/lib/python3.9/site-packages/starlette/middleware/exceptions.py", line 68, in call
await self.app(scope, receive, sender)
File "/usr/local/lib/python3.9/site-packages/fastapi/middleware/asyncexitstack.py", line 21, in call
raise e
File "/usr/local/lib/python3.9/site-packages/fastapi/middleware/asyncexitstack.py", line 18, in call
await self.app(scope, receive, send)
File "/usr/local/lib/python3.9/site-packages/starlette/routing.py", line 718, in call
await route.handle(scope, receive, send)
File "/usr/local/lib/python3.9/site-packages/starlette/routing.py", line 276, in handle
await self.app(scope, receive, send)
File "/usr/local/lib/python3.9/site-packages/starlette/routing.py", line 66, in app
response = await func(request)
File "/usr/local/lib/python3.9/site-packages/fastapi/routing.py", line 237, in app
raw_response = await run_endpoint_function(
File "/usr/local/lib/python3.9/site-packages/fastapi/routing.py", line 163, in run_endpoint_function
return await dependant.call(**values)
File "/app/boaviztapi/routers/cloud_router.py", line 48, in instance_cloud_impact
instance_model = mapper_cloud_instance(cloud_instance, archetype=instance_archetype)
File "/app/boaviztapi/dto/device/device.py", line 82, in mapper_cloud_instance
complete_components_usage(model_cloud_instance.platform, model_cloud_instance.usage)
File "/app/boaviztapi/dto/device/device.py", line 59, in complete_components_usage
for disk_unit in model.disk:
File "/app/boaviztapi/model/device/server.py", line 53, in disk
if get_arch_component(self.archetype, "SSD")["units"] not in [{}, {'default':0}]:
TypeError: 'NoneType' object is not subscriptable

To Reproduce

Query one of those instances on cloud/instance route : db.m1.medium, m1.medium, db.m1.small, m1.small, db.m1.large, m1.large, db.m1.xlarge

Expected behavior

200 OK with impacts result

@bpetit bpetit added the bug Something isn't working label Apr 8, 2024
@bpetit
Copy link
Collaborator Author

bpetit commented Apr 8, 2024

Closing the issue as we sumed up all missing servers issues in #284

@bpetit bpetit closed this as completed Apr 8, 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

1 participant