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

Problem: status_check_fastapi endpoint raising eror #676

Merged
merged 1 commit into from
Aug 21, 2024

Conversation

olethanh
Copy link
Collaborator

Endpoint /status/check/fastapi was raising error when there was no internet inside vm

This was caused by check_internet raising an error instead of just returning False

Note: Contrarely to what was previously understood the diagnostic vm don't return a headers when the result is False.

Previous stacktrace

ValueError: The server cannot connect to Internet
  File "aiohttp/web_app.py", line 537, in _handle
    resp = await handler(request)
  File "aiohttp/web_middlewares.py", line 114, in impl
    return await handler(request)
  File "aleph/vm/orchestrator/supervisor.py", line 70, in server_version_middleware
    resp: web.StreamResponse = await handler(request)
  File "aleph/vm/orchestrator/views/__init__.py", line 215, in status_check_fastapi
    "internet": await status.check_internet(session, fastapi_vm_id),
  File "aleph/vm/orchestrator/status.py", line 124, in check_internet
    raise ValueError("The server cannot connect to Internet")

Sentry issue : https://alephim.sentry.io/issues/5654330290/

Endpoint `/status/check/fastapi` was raising error when there was no
internet inside vm

This was caused by `check_internet` raising an error instead of just
returning False

Note: Contrarely to what was previously understood the diagnostic vm don't
return a headers when the result is False.

Previous stacktrace
```
ValueError: The server cannot connect to Internet
  File "aiohttp/web_app.py", line 537, in _handle
    resp = await handler(request)
  File "aiohttp/web_middlewares.py", line 114, in impl
    return await handler(request)
  File "aleph/vm/orchestrator/supervisor.py", line 70, in server_version_middleware
    resp: web.StreamResponse = await handler(request)
  File "aleph/vm/orchestrator/views/__init__.py", line 215, in status_check_fastapi
    "internet": await status.check_internet(session, fastapi_vm_id),
  File "aleph/vm/orchestrator/status.py", line 124, in check_internet
    raise ValueError("The server cannot connect to Internet")
```

Sentry issue : https://alephim.sentry.io/issues/5654330290/
@olethanh olethanh requested review from hoh and nesitor August 21, 2024 12:24
@olethanh olethanh merged commit 5e7d686 into main Aug 21, 2024
24 of 25 checks passed
@nesitor nesitor deleted the ol-fix-fastapi-no-internet branch August 21, 2024 14:44
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.

2 participants