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

BUG: patch a project/node requires wallet access #6443

Closed
pcrespov opened this issue Sep 25, 2024 · 0 comments · Fixed by #6602
Closed

BUG: patch a project/node requires wallet access #6443

pcrespov opened this issue Sep 25, 2024 · 0 comments · Fixed by #6602
Assignees
Labels
a:director-v2 issue related with the director-v2 service a:webserver issue related to the webserver service bug buggy, it does not work as expected

Comments

@pcrespov
Copy link
Member

pcrespov commented Sep 25, 2024

  • share a project (not wallet)
  • edit some metadata: e.g. title
  • PATCH responds with 500 because shared user does not have access to the owner wallet
  • This situation is correctly handled with open because the front-end queries user to link shared project with his wallet
log_source=servicelib.aiohttp.monitoring:middleware_handler(227) | log_uid=None | log_msg=Unexpected server error "<class 'aiohttp.web_exceptions.HTTPInternalServerError'>" from access: 172.16.4.27 "PATCH /v0/projects/0b8d735a-7673-11ef-aa23-0242ac17038e/nodes/71e9832b-4a47-54c9-ab9d-a18f2678da88" done in 0.16 secs. Responding with status 500



  File "/home/scu/.venv/lib/python3.11/site-packages/simcore_service_webserver/projects/_nodes_handlers.py", line 97, in wrapper
    return await handler(request)
           ^^^^^^^^^^^^^^^^^^^^^^
  File "/home/scu/.venv/lib/python3.11/site-packages/simcore_service_webserver/projects/_nodes_handlers.py", line 229, in patch_project_node
    await projects_api.patch_project_node(
  File "/home/scu/.venv/lib/python3.11/site-packages/simcore_service_webserver/projects/projects_api.py", line 1034, in patch_project_node
    await director_v2_api.create_or_update_pipeline(
  File "/home/scu/.venv/lib/python3.11/site-packages/servicelib/logging_utils.py", line 287, in _async_wrapper
    result = await func_or_coro(*args, **kwargs)
             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/scu/.venv/lib/python3.11/site-packages/simcore_service_webserver/director_v2/_core_computations.py", line 126, in create_or_update_pipeline
    "wallet_info": await get_wallet_info(
                   ^^^^^^^^^^^^^^^^^^^^^^
  File "/home/scu/.venv/lib/python3.11/site-packages/simcore_service_webserver/director_v2/_api_utils.py", line 50, in get_wallet_info
    wallet = await wallets_api.get_wallet_with_available_credits_by_user_and_wallet(
             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/scu/.venv/lib/python3.11/site-packages/simcore_service_webserver/wallets/_api.py", line 90, in get_wallet_with_available_credits_by_user_and_wallet
    user_wallet_db: UserWalletDB = await db.get_wallet_for_user(
                                   ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/scu/.venv/lib/python3.11/site-packages/simcore_service_webserver/wallets/_db.py", line 157, in get_wallet_for_user
    raise WalletAccessForbiddenError(
simcore_service_webserver.wallets.errors.WalletAccessForbiddenError: Wallet access forbidden. User does not have access to the wallet 61. Or wallet does not exist.

Caused by

  • rquired wallet info in calls to directorv2 pipeline API entrypoint

Solutions:

  • granulate directorv2 pipeline API entrypoint to avoid this requirement
  • improve poor error handling in those responses
@pcrespov pcrespov added bug buggy, it does not work as expected a:webserver issue related to the webserver service a:director-v2 issue related with the director-v2 service labels Sep 25, 2024
@pcrespov pcrespov self-assigned this Sep 25, 2024
@pcrespov pcrespov added this to the MartinKippenberger milestone Sep 25, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
a:director-v2 issue related with the director-v2 service a:webserver issue related to the webserver service bug buggy, it does not work as expected
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants