Skip to content

Revert "Add status changed by user info to context" #5489

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

Merged
merged 2 commits into from
Dec 9, 2021

Conversation

arm4b
Copy link
Member

@arm4b arm4b commented Dec 8, 2021

Reverts #5459

Looks like there is a regression from the previous PR which failed in e2e st2-self-check tests.

@khushboobhatia01 We can wait for the patch on top of the previous PR from you.
Alternatively, to unblock the builds, we can revert the PR until another iteration on this feature from your side.


Steps to reproduce

After running the st2-self-check which does some pause/resume workflows:

vagrant@stackstorm:~$  sudo ST2_AUTH_TOKEN=$(st2 auth st2admin -p 'Ch@ngeMe' -t) st2-self-check

Things will fail with 500 from API:

vagrant@stackstorm:~$ st2 execution list
ERROR: 500 Server Error: Internal Server Error
MESSAGE: Internal Server Error for url: http://127.0.0.1:9101/v1/executions/?limit=50&parent=null&sort_desc=True&include_attributes=id%2Caction.ref%2Ccontext.user%2Cstatus%2Cstart_timestamp%2Cend_timestamp

st2api.log:

2021-12-08 21:07:08,022 139904180972432 INFO logging [-] 9cbe8e6a-3736-4f3d-b98e-9d758d211a4e - GET /v1/executions/ with query={'limit': ['50'], 'parent': ['null'], 'sort_desc': ['True'], 'include_attributes': ['id,action.ref,context.user,status,start_timestamp,end_timestamp']} (method='GET',path='/v1/executions/',remote_addr='127.0.0.1',query={'limit': ['50'], 'parent': ['null'], 'sort_desc': ['True'], 'include_attributes': ['id,action.ref,context.user,status,start_timestamp,end_timestamp']},request_id='9cbe8e6a-3736-4f3d-b98e-9d758d211a4e')
2021-12-08 21:07:08,072 139904180972432 ERROR router [-] Failed to call controller function "get_all" for operation "st2api.controllers.v1.actionexecutions:action_executions_controller.get_all": Type is not JSON serializable: DBRef
Traceback (most recent call last):
  File "/opt/stackstorm/st2/lib/python3.6/site-packages/st2common/router.py", line 621, in __call__
    resp = func(**kw)
  File "/opt/stackstorm/st2/lib/python3.6/site-packages/st2api/controllers/v1/actionexecutions.py", line 749, in get_all
    requester_user=requester_user,
  File "/opt/stackstorm/st2/lib/python3.6/site-packages/st2api/controllers/v1/actionexecutions.py", line 1145, in _get_action_executions
    requester_user=requester_user,
  File "/opt/stackstorm/st2/lib/python3.6/site-packages/st2api/controllers/resource.py", line 253, in _get_all
    resp = Response(json=result)
  File "/opt/stackstorm/st2/lib/python3.6/site-packages/st2common/router.py", line 192, in __init__
    body = json_encode(json_body).encode("utf-8")
  File "/opt/stackstorm/st2/lib/python3.6/site-packages/st2common/util/jsonify.py", line 116, in json_encode
    return json_encode_orjson(obj=obj, indent=indent, sort_keys=sort_keys)
  File "/opt/stackstorm/st2/lib/python3.6/site-packages/st2common/util/jsonify.py", line 92, in json_encode_orjson
    return orjson.dumps(obj, default=default).decode("utf-8")
TypeError: Type is not JSON serializable: DBRef
2021-12-08 21:07:08,072 139904180972432 ERROR error_handling [-] API call failed: Type is not JSON serializable: DBRef
Traceback (most recent call last):
  File "/opt/stackstorm/st2/lib/python3.6/site-packages/st2common/middleware/error_handling.py", line 49, in __call__
    return self.app(environ, start_response)
  File "/opt/stackstorm/st2/lib/python3.6/site-packages/st2common/middleware/streaming.py", line 46, in __call__
    return self.app(environ, start_response)
  File "/opt/stackstorm/st2/lib/python3.6/site-packages/st2common/router.py", line 735, in as_wsgi
    resp = self(req)
  File "/opt/stackstorm/st2/lib/python3.6/site-packages/st2common/router.py", line 633, in __call__
    raise e
  File "/opt/stackstorm/st2/lib/python3.6/site-packages/st2common/router.py", line 621, in __call__
    resp = func(**kw)
  File "/opt/stackstorm/st2/lib/python3.6/site-packages/st2api/controllers/v1/actionexecutions.py", line 749, in get_all
    requester_user=requester_user,
  File "/opt/stackstorm/st2/lib/python3.6/site-packages/st2api/controllers/v1/actionexecutions.py", line 1145, in _get_action_executions
    requester_user=requester_user,
  File "/opt/stackstorm/st2/lib/python3.6/site-packages/st2api/controllers/resource.py", line 253, in _get_all
    resp = Response(json=result)
  File "/opt/stackstorm/st2/lib/python3.6/site-packages/st2common/router.py", line 192, in __init__
    body = json_encode(json_body).encode("utf-8")
  File "/opt/stackstorm/st2/lib/python3.6/site-packages/st2common/util/jsonify.py", line 116, in json_encode
    return json_encode_orjson(obj=obj, indent=indent, sort_keys=sort_keys)
  File "/opt/stackstorm/st2/lib/python3.6/site-packages/st2common/util/jsonify.py", line 92, in json_encode_orjson
    return orjson.dumps(obj, default=default).decode("utf-8")
TypeError: Type is not JSON serializable: DBRef (_exception_class='TypeError',_exception_message='Type is not JSON serializable: DBRef',_exception_data={})

@pull-request-size pull-request-size bot added the size/M PR that changes 30-99 lines. Good size to review. label Dec 8, 2021
@arm4b arm4b merged commit eb3b4bb into master Dec 9, 2021
@arm4b arm4b deleted the revert-5459-add_user_context branch December 9, 2021 13:58
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug regression size/M PR that changes 30-99 lines. Good size to review.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants