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

Application Server crash on certificate upload #46

Closed
devbbc opened this issue Nov 15, 2022 · 3 comments
Closed

Application Server crash on certificate upload #46

devbbc opened this issue Nov 15, 2022 · 3 comments
Assignees
Labels
bug Something isn't working
Milestone

Comments

@devbbc
Copy link

devbbc commented Nov 15, 2022

When POSTing the certificate via M3, the Application Server seems to create / add the certificate successfully as it tries to send response with status 201. But it crashes when sending the response, with the following message. Same error happens when trying to update the certificate through the PUT method.

venv/bin/5gms-application-server -c local.conf
INFO:rt-5gms-as:Getting list of certificates...
INFO:rt-5gms-as:Getting list of content hosting configurations...
DEBUG:rt-5gms-as:Context.haveCertificate('d54a1fcc-d411-4e32-807b-2c60dbaeaf5f:testcert1') = False
INFO:rt-5gms-as:Adding certificate d54a1fcc-d411-4e32-807b-2c60dbaeaf5f:testcert1...
[2022-11-14 18:06:15 +0000] [348937] [ERROR] Error in ASGI Framework
Traceback (most recent call last):
  File "/home/ubuntu/rt-5gms-application-server/venv/lib/python3.8/site-packages/hypercorn/asyncio/task_group.py", line 23, in _handle
    await app(scope, receive, send, sync_spawn, call_soon)
  File "/home/ubuntu/rt-5gms-application-server/venv/lib/python3.8/site-packages/hypercorn/app_wrappers.py", line 33, in __call__
    await self.app(scope, receive, send)
  File "/home/ubuntu/rt-5gms-application-server/venv/lib/python3.8/site-packages/fastapi/applications.py", line 270, in __call__
    await super().__call__(scope, receive, send)
  File "/home/ubuntu/rt-5gms-application-server/venv/lib/python3.8/site-packages/starlette/applications.py", line 124, in __call__
    await self.middleware_stack(scope, receive, send)
  File "/home/ubuntu/rt-5gms-application-server/venv/lib/python3.8/site-packages/starlette/middleware/errors.py", line 184, in __call__
    raise exc
  File "/home/ubuntu/rt-5gms-application-server/venv/lib/python3.8/site-packages/starlette/middleware/errors.py", line 162, in __call__
    await self.app(scope, receive, _send)
  File "/home/ubuntu/rt-5gms-application-server/venv/lib/python3.8/site-packages/starlette/middleware/exceptions.py", line 75, in __call__
    raise exc
  File "/home/ubuntu/rt-5gms-application-server/venv/lib/python3.8/site-packages/starlette/middleware/exceptions.py", line 64, in __call__
    await self.app(scope, receive, sender)
  File "/home/ubuntu/rt-5gms-application-server/venv/lib/python3.8/site-packages/fastapi/middleware/asyncexitstack.py", line 21, in __call__
    raise e
  File "/home/ubuntu/rt-5gms-application-server/venv/lib/python3.8/site-packages/fastapi/middleware/asyncexitstack.py", line 18, in __call__
    await self.app(scope, receive, send)
  File "/home/ubuntu/rt-5gms-application-server/venv/lib/python3.8/site-packages/starlette/routing.py", line 680, in __call__
    await route.handle(scope, receive, send)
  File "/home/ubuntu/rt-5gms-application-server/venv/lib/python3.8/site-packages/starlette/routing.py", line 275, in handle
    await self.app(scope, receive, send)
  File "/home/ubuntu/rt-5gms-application-server/venv/lib/python3.8/site-packages/starlette/routing.py", line 65, in app
    response = await func(request)
  File "/home/ubuntu/rt-5gms-application-server/venv/lib/python3.8/site-packages/fastapi/routing.py", line 231, in app
    raw_response = await run_endpoint_function(
  File "/home/ubuntu/rt-5gms-application-server/venv/lib/python3.8/site-packages/fastapi/routing.py", line 160, in run_endpoint_function
    return await dependant.call(**values)
  File "/home/ubuntu/rt-5gms-application-server/venv/lib/python3.8/site-packages/rt_5gms_as/openapi_5g/apis/default_api.py", line 75, in create_server_certificate
    await rt_5gms_as_svr_ifc.create_server_certificate(provisioningSessionId,certificateId,body, request=request)
  File "/home/ubuntu/rt-5gms-application-server/venv/lib/python3.8/site-packages/rt_5gms_as/server.py", line 90, in create_server_certificate
    raise NoProblemException(status_code=201, media_type='application/json', headers={'Location': request.url.path})
  File "/home/ubuntu/rt-5gms-application-server/venv/lib/python3.8/site-packages/rt_5gms_as/exceptions.py", line 71, in __init__
    headers['Server'] = '5GMSd-AS/'+__pkg_version
NameError: name '_NoProblemException__pkg_version' is not defined
ERROR:hypercorn.error:Error in ASGI Framework
Traceback (most recent call last):
  File "/home/ubuntu/rt-5gms-application-server/venv/lib/python3.8/site-packages/hypercorn/asyncio/task_group.py", line 23, in _handle
    await app(scope, receive, send, sync_spawn, call_soon)
  File "/home/ubuntu/rt-5gms-application-server/venv/lib/python3.8/site-packages/hypercorn/app_wrappers.py", line 33, in __call__
    await self.app(scope, receive, send)
  File "/home/ubuntu/rt-5gms-application-server/venv/lib/python3.8/site-packages/fastapi/applications.py", line 270, in __call__
    await super().__call__(scope, receive, send)
  File "/home/ubuntu/rt-5gms-application-server/venv/lib/python3.8/site-packages/starlette/applications.py", line 124, in __call__
    await self.middleware_stack(scope, receive, send)
  File "/home/ubuntu/rt-5gms-application-server/venv/lib/python3.8/site-packages/starlette/middleware/errors.py", line 184, in __call__
    raise exc
  File "/home/ubuntu/rt-5gms-application-server/venv/lib/python3.8/site-packages/starlette/middleware/errors.py", line 162, in __call__
    await self.app(scope, receive, _send)
  File "/home/ubuntu/rt-5gms-application-server/venv/lib/python3.8/site-packages/starlette/middleware/exceptions.py", line 75, in __call__
    raise exc
  File "/home/ubuntu/rt-5gms-application-server/venv/lib/python3.8/site-packages/starlette/middleware/exceptions.py", line 64, in __call__
    await self.app(scope, receive, sender)
  File "/home/ubuntu/rt-5gms-application-server/venv/lib/python3.8/site-packages/fastapi/middleware/asyncexitstack.py", line 21, in __call__
    raise e
  File "/home/ubuntu/rt-5gms-application-server/venv/lib/python3.8/site-packages/fastapi/middleware/asyncexitstack.py", line 18, in __call__
    await self.app(scope, receive, send)
  File "/home/ubuntu/rt-5gms-application-server/venv/lib/python3.8/site-packages/starlette/routing.py", line 680, in __call__
    await route.handle(scope, receive, send)
  File "/home/ubuntu/rt-5gms-application-server/venv/lib/python3.8/site-packages/starlette/routing.py", line 275, in handle
    await self.app(scope, receive, send)
  File "/home/ubuntu/rt-5gms-application-server/venv/lib/python3.8/site-packages/starlette/routing.py", line 65, in app
    response = await func(request)
  File "/home/ubuntu/rt-5gms-application-server/venv/lib/python3.8/site-packages/fastapi/routing.py", line 231, in app
    raw_response = await run_endpoint_function(
  File "/home/ubuntu/rt-5gms-application-server/venv/lib/python3.8/site-packages/fastapi/routing.py", line 160, in run_endpoint_function
    return await dependant.call(**values)
  File "/home/ubuntu/rt-5gms-application-server/venv/lib/python3.8/site-packages/rt_5gms_as/openapi_5g/apis/default_api.py", line 75, in create_server_certificate
    await rt_5gms_as_svr_ifc.create_server_certificate(provisioningSessionId,certificateId,body, request=request)
  File "/home/ubuntu/rt-5gms-application-server/venv/lib/python3.8/site-packages/rt_5gms_as/server.py", line 90, in create_server_certificate
    raise NoProblemException(status_code=201, media_type='application/json', headers={'Location': request.url.path})
  File "/home/ubuntu/rt-5gms-application-server/venv/lib/python3.8/site-packages/rt_5gms_as/exceptions.py", line 71, in __init__
    headers['Server'] = '5GMSd-AS/'+__pkg_version
NameError: name '_NoProblemException__pkg_version' is not defined

@devbbc devbbc added the bug Something isn't working label Nov 15, 2022
@devbbc devbbc added this to the MWC23 milestone Nov 15, 2022
@davidjwbbc
Copy link
Contributor

@devbbc, that is an old version of the code from my fork. Can you please git pull the latest version and try again?

@devbbc
Copy link
Author

devbbc commented Nov 17, 2022

Obtaining the latest version through git pull and building the Application Server solves the problem. The Application Server does not crash now and can handle certificate requests.

@davidjwbbc
Copy link
Contributor

Ok, the issue was already fixed, closing this.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Development

No branches or pull requests

2 participants