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

[Bug][CircleCi] Negative workflow duration #8229

Open
2 of 3 tasks
The0Danktor opened this issue Dec 3, 2024 · 2 comments
Open
2 of 3 tasks

[Bug][CircleCi] Negative workflow duration #8229

The0Danktor opened this issue Dec 3, 2024 · 2 comments
Assignees
Labels
component/plugins This issue or PR relates to plugins devops Something about CI/CD (devops) severity/p1 This bug affects functionality or significantly affect ux type/bug This issue is a bug

Comments

@The0Danktor
Copy link

Search before asking

  • I had searched in the issues and found no similar issues.

What happened

Will collecting and transforming data the crashes on the subtask extractJobs

this happens because for some reason a workflow stopped before it started causing it to have a negative durration

and the field is an bigint unsigned

time="2024-12-03 09:07:05" level=error msg=" [pipeline service] [pipeline #3] [task #16] subtask extractJobs ended unexpectedly\n\tWraps: (2) error adding result to batch (500)\n\tWraps: (3) Error 1264 (22003): Out of range value for column 'duration_sec' at row 262 (500)\n\tWraps: (4) Error 1264 (22003): Out of range value for column 'duration_sec' at row 262\n\tError types: (1) *hintdetail.withDetail (2) *hintdetail.withDetail (3) *hintdetail.withDetail (4) *mysql.MySQLError"

What do you expect to happen

that it would work even with a negative duration
maby by changing them to positive or changing the field type in the database

How to reproduce

import a workflow in circleci that has a negative duration

Anything else

No response

Version

v1.0.1

Are you willing to submit PR?

  • Yes I am willing to submit a PR!

Code of Conduct

@The0Danktor The0Danktor added the type/bug This issue is a bug label Dec 3, 2024
@dosubot dosubot bot added component/plugins This issue or PR relates to plugins devops Something about CI/CD (devops) severity/p1 This bug affects functionality or significantly affect ux labels Dec 3, 2024
Copy link

dosubot bot commented Dec 3, 2024

@The0Danktor Hello there! I'm here to help you with any bugs, questions, or contributions you have in mind. If you need assistance, feel free to ask.

The issue you're encountering is due to the duration_sec field being defined as an unsigned bigint, which cannot store negative values. This results in an "Out of range value" error when a workflow has a negative duration [1].

To address this, you have a couple of options:

  1. Convert Negative Durations to Positive: Modify the logic in the extractJobs subtask to convert negative durations to positive values before storing them. This can be done by taking the absolute value of the duration.

  2. Change the Database Field Type: Alter the database schema to allow negative values by changing the duration_sec field from an unsigned bigint to a signed bigint. This would allow the storage of negative durations without errors.

Both approaches have their pros and cons, and the choice depends on how you want to handle negative durations in your data analysis. If you decide to submit a pull request, ensure that the changes are well-documented and tested to prevent any unintended side effects.

To continue talking to Dosu, mention @dosu.

@The0Danktor The0Danktor changed the title [Bug][CircleCi] Negative wowk [Bug][CircleCi] Negative workflow duration Dec 4, 2024
@klesh klesh self-assigned this Dec 9, 2024
@klesh
Copy link
Contributor

klesh commented Dec 9, 2024

Thanks for reporting the issue.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
component/plugins This issue or PR relates to plugins devops Something about CI/CD (devops) severity/p1 This bug affects functionality or significantly affect ux type/bug This issue is a bug
Projects
None yet
Development

No branches or pull requests

2 participants