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

feat: Use DBResponse for get_run_ids and get_task_ids #391

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

xychu
Copy link

@xychu xychu commented Sep 11, 2023

Return more specific status code and detail msg when DB got exception.

Return more specific status code and detail msg when DB got exception.
@neksa
Copy link

neksa commented Oct 11, 2023

this PR can possibly fix

"Traceback (most recent call last):
  File \"<frozen runpy>\", line 198, in _run_module_as_main
  File \"<frozen runpy>\", line 88, in _run_code
  File \"/root/services/metadata_service/server.py\", line 54, in <module>
    main()
  File \"/root/services/metadata_service/server.py\", line 48, in main
    loop.run_forever()
  File \"/usr/local/lib/python3.11/asyncio/base_events.py\", line 607, in run_forever
    self._run_once()
  File \"/usr/local/lib/python3.11/asyncio/base_events.py\", line 1922, in _run_once
    handle._run()
  File \"/usr/local/lib/python3.11/asyncio/events.py\", line 80, in _run
    self._context.run(self._callback, self._args)
  File \"/opt/latest/lib/python3.11/site-packages/aiohttp/web_protocol.py\", line 433, in _handle_request
    resp = await request_handler(request)
  File \"/opt/latest/lib/python3.11/site-packages/aiohttp/web_app.py\", line 504, in _handle
    resp = await handler(request)
  File \"/root/services/metadata_service/api/utils.py\", line 23, in wrapper
    db_response = await func(args, kwargs)
  File \"/root/services/metadata_service/api/utils.py\", line 63, in wrapper
    return http_500(str(err))
  File \"/root/services/metadata_service/api/utils.py\", line 43, in http_500
    traceback_str = get_traceback_str()
  File \"/root/services/metadata_service/api/utils.py\", line 61, in wrapper
    return await func(args, kwargs)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File \"/root/services/metadata_service/api/task.py\", line 194, in create_task
    run_number, run_id = await self._db.get_run_ids(flow_id, run_number)
                         ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File \"/root/services/data/postgres_async_db.py\", line 112, in get_run_ids
    return run.body['run_number'], run.body['run_id']
           ~~~~~~~~^^^^^^^^^^^^^^
           TypeError: string indices must be integers, not 'str'

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