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

gitlab: triggering workflow fails with KeyError: 'workflow' #676

Closed
mdonadoni opened this issue Mar 13, 2024 · 0 comments · Fixed by #685 · May be fixed by #679
Closed

gitlab: triggering workflow fails with KeyError: 'workflow' #676

mdonadoni opened this issue Mar 13, 2024 · 0 comments · Fixed by #685 · May be fixed by #679
Assignees

Comments

@mdonadoni
Copy link
Member

Reported to us on mattermost and reproduced on PROD.

When GitLab triggers a new workflow via webhooks, the workflow creation process sometimes fails. This is the response coming from REANA, as shown on GitLab webhook test page (400):

{
  "message": "'workflow'"
}

reana-server logs:

  File "/code/./reana_server/rest/workflows.py", line 531, in create_workflow
    workflow_engine = reana_spec_file["workflow"]["type"]
KeyError: 'workflow'

The issue is probably that we are not checking whether the request to fetch the workflow specification is successful:

yaml_file = requests.get(
gitlab_api.format(project_id, reana_yaml, branch, gitlab_token)
)
return (
yaml.load(yaml_file.content, Loader=yaml.FullLoader),
webhook_data["project"]["path_with_namespace"],
webhook_data["project"]["name"],
branch,
commit_sha,
)

This is the response of the request:

{"error":"invalid_token","error_description":"Token is expired. You can either do re-authorization or token refresh."}
DaanRosendal pushed a commit to DaanRosendal/reana-server that referenced this issue Mar 13, 2024
@mdonadoni mdonadoni self-assigned this Mar 20, 2024
@mdonadoni mdonadoni removed their assignment Mar 20, 2024
@mdonadoni mdonadoni self-assigned this Mar 28, 2024
mdonadoni added a commit to mdonadoni/reana-server that referenced this issue Apr 9, 2024
mdonadoni added a commit to mdonadoni/reana-server that referenced this issue Apr 9, 2024
mdonadoni added a commit to mdonadoni/reana-server that referenced this issue Apr 17, 2024
mdonadoni added a commit to mdonadoni/reana-server that referenced this issue May 28, 2024
mdonadoni added a commit to mdonadoni/reana-server that referenced this issue May 28, 2024
mdonadoni added a commit to mdonadoni/reana-server that referenced this issue May 28, 2024
@mdonadoni mdonadoni added this to 0.95.0 Aug 8, 2024
@mdonadoni mdonadoni moved this to Done in 0.95.0 Aug 8, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: Done
1 participant