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

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

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

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

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 added this to Ready for work in 0.95.0 Mar 14, 2024
@mdonadoni mdonadoni self-assigned this Mar 20, 2024
@mdonadoni mdonadoni moved this from Ready for work to In work in 0.95.0 Mar 20, 2024
@mdonadoni mdonadoni removed their assignment Mar 20, 2024
@mdonadoni mdonadoni moved this from In work to Ready for work in 0.95.0 Mar 20, 2024
@mdonadoni mdonadoni self-assigned this Mar 28, 2024
@mdonadoni mdonadoni moved this from Ready for work to In work in 0.95.0 Mar 28, 2024
@mdonadoni mdonadoni moved this from In work to In review in 0.95.0 Apr 11, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
0.95.0
In review
Development

Successfully merging a pull request may close this issue.

1 participant