-
-
Notifications
You must be signed in to change notification settings - Fork 163
Segfault when invoking glab ci list
#688
Comments
Thanks for opening this issue @matyasrichter. I can't seem to reproduce this issue. Pls provide answers to the ff:
|
Yes, the repo does have a
|
TLDR: I think the issue is with the API version of GitLab, and we expecting fields that are not there. From the docs, it seems that this field has only shown up in ExplantionWe list pipelines here: Line 61 in 8834968
which calls this API https://docs.gitlab.com/ce/api/pipelines.html#list-project-pipelines Then we panic at glab/commands/ci/ciutils/utils.go Line 33 in 8834968
which leads me to believe that the problem is pipeline.CreatedAt being null which leads to runtime panic because we can't dereference null pointer.
If we look at the API docs on the older version https://docs.gitlab.com/11.11/ee/api/pipelines.html#list-project-pipelines we can see that the response doesn't have a [
{
"id": 47,
"status": "pending",
"ref": "new-pipeline",
"sha": "a91957a858320c0e17f3a0eca7cfacbff50ea29a",
"web_url": "https://example.com/foo/bar/pipelines/47"
},
{
"id": 48,
"status": "pending",
"ref": "new-pipeline",
"sha": "eb94b618fb5865b26e80fdd8ae531b7a63ad851a",
"web_url": "https://example.com/foo/bar/pipelines/48"
}
] ConfirmationWe can easily confirm this theory by using the Could you @matyasrichter call [
{
"id": 260268374,
"project_id": 17660397,
"sha": "0b8e76a313766e04eff7f0ba559f9e86681ba396",
"ref": "test-repo-push-not-pushed",
"status": "success",
"created_at": "2021-02-23T07:49:53.196Z",
"updated_at": "2021-02-23T07:51:09.708Z",
"web_url": "https://gitlab.com/zemzale/project/-/pipelines/260268374"
},
...
] If your response doesn't contain the |
You're not wrong,@zemzale. The output looks like this:
|
Okay then. I will try to fix this somewhat soon. But as always everyone is more then welcomed to create PRs issues. |
For gitlab instances running on versions <= 11, the pipeline list api does not return the `created_at` field causing `glab` to panic. This commit checks if the created_at field is available before using it Reolves #688
For gitlab instances running on versions <= 11, the pipeline list api does not return the `created_at` field causing `glab` to panic. This commit checks if the created_at field is available before using it Reolves #688
For gitlab instances running on versions <= 11, the pipeline list api does not return the `created_at` field causing `glab` to panic. This commit checks if the created_at field is available before using it Reolves profclems#688
Description
Expected Behavior vs Actual Behavior
Expected: not a segfault
Got: segfault
Possible Fix
Steps to Reproduce
glab ci list
Logs
Your Environment
glab version 1.16.0 (2021-03-12), the gitlab-glab-bin package from AUR
5.10.30-1-MANJARO #1 SMP Wed Apr 14 08:07:27 UTC 2021 x86_64 GNU/Linux
This only seems to happen on one of my projects. The project is on a self-hosted Gitlab instance, GitLab Community Edition 11.8.10. I'm not sure what my options are to provide more details, but I'll be happy to do so, just tell me how.
The text was updated successfully, but these errors were encountered: