Skip to content

chore: Upgrade Ralph to 5.0.1#1101

Open
bmtcril wants to merge 2 commits into
mainfrom
bmtcril/update_ralph
Open

chore: Upgrade Ralph to 5.0.1#1101
bmtcril wants to merge 2 commits into
mainfrom
bmtcril/update_ralph

Conversation

@bmtcril

@bmtcril bmtcril commented Aug 13, 2025

Copy link
Copy Markdown
Contributor

Upgrades to the current latest Ralph, which should have some performance benefits.

This can merge in the next round of breaking changes, but shouldn't go in until v2.3.2 goes out. Alternatively we could add the Campus changes back upstream and wait for those to be released which would greatly improve the performance for high volume instances.

@bmtcril

bmtcril commented Aug 13, 2025

Copy link
Copy Markdown
Contributor Author

Here's the error, it looks like a change in credentials format:

2025-08-13 19:52:50,007 INFO:     10.244.0.46:36028 - "POST /xAPI/statements/ HTTP/1.1" 500 Internal Server Error
2025-08-13 19:52:50,008 ERROR:    Exception in ASGI application
Traceback (most recent call last):
  File "/usr/local/lib/python3.12/site-packages/uvicorn/protocols/http/httptools_impl.py", line 399, in run_asgi
    result = await app(  # type: ignore[func-returns-value]
             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.12/site-packages/uvicorn/middleware/proxy_headers.py", line 70, in __call__
    return await self.app(scope, receive, send)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.12/site-packages/fastapi/applications.py", line 1054, in __call__
    await super().__call__(scope, receive, send)
  File "/usr/local/lib/python3.12/site-packages/starlette/applications.py", line 123, in __call__
    await self.middleware_stack(scope, receive, send)
  File "/usr/local/lib/python3.12/site-packages/starlette/middleware/errors.py", line 186, in __call__
    raise exc
  File "/usr/local/lib/python3.12/site-packages/starlette/middleware/errors.py", line 164, in __call__
    await self.app(scope, receive, _send)
  File "/usr/local/lib/python3.12/site-packages/starlette/middleware/exceptions.py", line 65, in __call__
    await wrap_app_handling_exceptions(self.app, conn)(scope, receive, send)
  File "/usr/local/lib/python3.12/site-packages/starlette/_exception_handler.py", line 64, in wrapped_app
    raise exc
  File "/usr/local/lib/python3.12/site-packages/starlette/_exception_handler.py", line 53, in wrapped_app
    await app(scope, receive, sender)
  File "/usr/local/lib/python3.12/site-packages/starlette/routing.py", line 756, in __call__
    await self.middleware_stack(scope, receive, send)
  File "/usr/local/lib/python3.12/site-packages/starlette/routing.py", line 776, in app
    await route.handle(scope, receive, send)
  File "/usr/local/lib/python3.12/site-packages/starlette/routing.py", line 297, in handle
    await self.app(scope, receive, send)
  File "/usr/local/lib/python3.12/site-packages/starlette/routing.py", line 77, in app
    await wrap_app_handling_exceptions(app, request)(scope, receive, send)
  File "/usr/local/lib/python3.12/site-packages/starlette/_exception_handler.py", line 64, in wrapped_app
    raise exc
  File "/usr/local/lib/python3.12/site-packages/starlette/_exception_handler.py", line 53, in wrapped_app
    await app(scope, receive, sender)
  File "/usr/local/lib/python3.12/site-packages/starlette/routing.py", line 72, in app
    response = await func(request)
               ^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.12/site-packages/fastapi/routing.py", line 269, in app
    solved_result = await solve_dependencies(
                    ^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.12/site-packages/fastapi/dependencies/utils.py", line 572, in solve_dependencies
    solved_result = await solve_dependencies(
                    ^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.12/site-packages/fastapi/dependencies/utils.py", line 602, in solve_dependencies
    solved = await run_in_threadpool(call, **sub_values)
             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.12/site-packages/starlette/concurrency.py", line 42, in run_in_threadpool
    return await anyio.to_thread.run_sync(func, *args)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.12/site-packages/anyio/to_thread.py", line 56, in run_sync
    return await get_async_backend().run_sync_in_worker_thread(
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.12/site-packages/anyio/_backends/_asyncio.py", line 2177, in run_sync_in_worker_thread
    return await future
           ^^^^^^^^^^^^
  File "/usr/local/lib/python3.12/site-packages/anyio/_backends/_asyncio.py", line 859, in run
    result = context.run(func, *args)
             ^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.12/site-packages/cachetools/__init__.py", line 756, in wrapper
    v = func(*args, **kwargs)
        ^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.12/site-packages/ralph/api/auth/basic.py", line 136, in get_basic_auth_user
    get_stored_credentials(settings.AUTH_FILE),
    ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.12/site-packages/ralph/api/auth/basic.py", line 99, in get_stored_credentials
    return ServerUsersCredentials.model_validate_json(f.read())
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.12/site-packages/pydantic/main.py", line 597, in model_validate_json
    return cls.__pydantic_validator__.validate_json(json_data, strict=strict, context=context)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
pydantic_core._pydantic_core.ValidationError: 2 validation errors for ServerUsersCredentials
0.scopes.0
  Input should be 'statements/write', 'statements/read/mine', 'statements/read', 'state/write', 'state/read', 'define', 'profile/write', 'profile/read', 'all/read' or 'all' [type=literal_error, input_value='ralph_scope', input_type=str]
    For further information visit https://errors.pydantic.dev/2.8/v/literal_error
1.scopes.0
  Input should be 'statements/write', 'statements/read/mine', 'statements/read', 'state/write', 'state/read', 'define', 'profile/write', 'profile/read', 'all/read' or 'all' [type=literal_error, input_value='ralph_scope', input_type=str]
    For further information visit https://errors.pydantic.dev/2.8/v/literal_error

@bmtcril bmtcril force-pushed the bmtcril/update_ralph branch from b9a6311 to 7e865fb Compare August 14, 2025 20:15
@bmtcril bmtcril force-pushed the bmtcril/update_ralph branch from 7e865fb to 7bc8d5a Compare August 15, 2025 13:30
@bmtcril bmtcril self-assigned this Oct 14, 2025
@bmtcril bmtcril marked this pull request as ready for review October 14, 2025 12:53
@bmtcril bmtcril requested a review from saraburns1 October 22, 2025 12:38
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