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

Could not retrieve pipeline status #328

Closed
mvineza opened this issue Dec 12, 2024 · 6 comments
Closed

Could not retrieve pipeline status #328

mvineza opened this issue Dec 12, 2024 · 6 comments

Comments

@mvineza
Copy link

mvineza commented Dec 12, 2024

I'm seeing this error from the pod logs.

10:28PM DBG getting pipeline status
10:28PM DBG getting pipeline status
10:28PM DBG getting pipeline status
10:28PM WRN could not retrieve pipeline status after multiple attempts

I confirmed that the token I'm using have the proper permissions to get the pipline status.

❯ curl -s -H 'PRIVATE-TOKEN: glpat-xyz' https://gitlab.local/api/v4/projects/9000/pipelines | jq
[
  {
    "id": 1451727,
    "iid": 7,
    "project_id": 9000,
    "sha": "31287d289aafc8265224af511507fc10a335c90c",
    "ref": "test_mr",
    "status": "success",
    "source": "external",
    "created_at": "2024-12-13T11:28:50.176+13:00",
    "updated_at": "2024-12-13T11:28:50.354+13:00",
    "web_url": "https://gitlab.local/testproject/redacted",
    "name": null
  },
# ...

I'm using the latest version, 0.0.0-pr298.

Based from the warning above, this line is returning errNoPipelineStatus.

Tracing back further, it is calling this GetLastPipelinesForCommit fucntion which is returning nil to the caller. That means it was not able to detect any pipeline for the particular commit sha.

Going further down the functions being called, it originates from this GetPipelinesForCommit which should log gitlab client: could not get pipelines for commit and return an error when it was not able to find a pipeline for the commit. I didn't see that error message on our logs so that means that function was able to detect a pipeline for a particular commit.

So either GetPipelinesForCommit or GetLastPipelinesForCommit is not returning the proper value. I'm curious also how pipelines looks like because GetLastPipelinesForCommit depends on it.

return pipelines, nil

Looking at the curl output above, it should be able to detect pipelines with source set to external.

I didn't perform other debugging other than just reading the code. Let me know if I missed anything.

@djeebus
Copy link
Collaborator

djeebus commented Dec 20, 2024

Ah, it looks like we were swallowing an error there. I started logging it to the PR in #341. Would you mind swapping to that one, and see if the logged error makes sense?

@mvineza
Copy link
Author

mvineza commented Dec 20, 2024

Cool, will try this again after the holiday break. Thanks @djeebus

@mvineza
Copy link
Author

mvineza commented Jan 9, 2025

Hi @djeebus , I tried using ghcr.io/zapier/kubechecks:0.0.0-pr341. I didn't see the message gitlab client: could not get last pipeline for commit being logged on our pod which means err from this line is nil.

So probably that line doesn't return a proper pipeline making it bypass the length check?

@djeebus
Copy link
Collaborator

djeebus commented Jan 9, 2025

Ok, I've added a bunch more fun debugging lines. Take a look when it finishes building, and let's try the new version, see if it spits out any interesting data 🤞

@mvineza
Copy link
Author

mvineza commented Jan 13, 2025

@djeebus , yeah confirmed that it was not able to detect any pipelines.

# ... redacted
11:28PM DBG gitlab client: retrieve pipelines for commit pipline_count=0
11:28PM DBG getting pipeline status
11:28PM DBG gitlab client: retrieve pipelines for commit pipline_count=0
11:28PM DBG getting pipeline status
11:28PM DBG gitlab client: retrieve pipelines for commit pipline_count=0
11:28PM DBG getting pipeline status
11:28PM DBG gitlab client: retrieve pipelines for commit pipline_count=0
11:28PM DBG getting pipeline status
11:28PM DBG gitlab client: retrieve pipelines for commit pipline_count=0
11:28PM DBG getting pipeline status
11:28PM DBG gitlab client: retrieve pipelines for commit pipline_count=0
11:28PM DBG getting pipeline status
11:28PM DBG gitlab client: retrieve pipelines for commit pipline_count=0
11:28PM DBG getting pipeline status
11:28PM DBG gitlab client: retrieve pipelines for commit pipline_count=0
11:29PM DBG getting pipeline status
11:29PM DBG gitlab client: retrieve pipelines for commit pipline_count=0
# ... redacted

And that means this didn't produced any output since the range is empty.

I looked into the implementation of ListProjectPipelines and it looks correct based from this. So at this point not sure yet if why is that not getting the list of pipelines.

Side note, go-gitlab was deprecated in github and moved to gitlab. But it just happened recently so I don't think it affects anything.

@mvineza
Copy link
Author

mvineza commented Feb 17, 2025

Closing this since there is no activity and not a major issue on our end.

@mvineza mvineza closed this as completed Feb 17, 2025
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

No branches or pull requests

2 participants