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][Jenkins] Data too long for column 'primary_view' #8254

Open
2 of 3 tasks
owais-maswala opened this issue Dec 30, 2024 · 2 comments
Open
2 of 3 tasks

[Bug][Jenkins] Data too long for column 'primary_view' #8254

owais-maswala opened this issue Dec 30, 2024 · 2 comments
Labels
component/plugins This issue or PR relates to plugins severity/p1 This bug affects functionality or significantly affect ux type/bug This issue is a bug

Comments

@owais-maswala
Copy link

owais-maswala commented Dec 30, 2024

Search before asking

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

What happened

When running a project sync, the following error appears for certain Jenkins jobs with longer names:

error preparing task data for jenkins (500) Wraps: (2) Error 1406 (22001): Data too long for column 'primary_view' at row 1 (500) Wraps: (3) Error 1406 (22001): Data too long for column 'primary_view' at row 1 Error types: (1) *hintdetail.withDetail (2) *hintdetail.withDetail (3) *mysql.MySQLError

What do you expect to happen

"All Subtasks completed" for all Jenkins jobs and a successful (not partially successful) data collection

How to reproduce

create a Jenkins scope for a Jenkins connection with a long primaryView value, e.g. 255+ chars

Anything else

No response

Version

1.0.2-beta4

Are you willing to submit PR?

  • Yes I am willing to submit a PR!

Code of Conduct

@owais-maswala owais-maswala added the type/bug This issue is a bug label Dec 30, 2024
Copy link

dosubot bot commented Dec 30, 2024

Hey @owais-maswala! 👋 I'm here to help you with any bugs, questions, or contributions you have for the project. Let's work together to resolve this issue!

The error you're encountering is due to the primary_view column in the Jenkins plugin schema having a maximum length of 255 characters [1]. To resolve this issue, you can update the database schema to accommodate longer values for the primary_view field. This involves modifying the migration script to increase the length of the primary_view column.

Here's a general approach to address this:

  1. Modify the Schema: Update the gorm:"type:varchar(255)" annotation for the primary_view field in the relevant struct to a larger value, such as varchar(500).

  2. Update Migration Script: Adjust the migration script to reflect this change. For example, if you want to increase the length to 500 characters, modify the struct definition in the migration script:

    type jenkinsJob20221108 struct {
        Name        string `gorm:"index;type:varchar(500)"`
        Url         string
        Description string
        PrimaryView string `gorm:"type:varchar(500)"`
    }
  3. Run the Migration: Execute the migration to apply the changes to your database schema.

By following these steps, you should be able to handle longer primary_view values without encountering the "Data too long" error.

To continue talking to Dosu, mention @dosu.


Help Dosu learn! Give it feedback: Great Response | Irrelevant Answer | Incorrect Sources | Too Verbose | Hallucination | Other

@dosubot dosubot bot added component/plugins This issue or PR relates to plugins severity/p1 This bug affects functionality or significantly affect ux labels Dec 30, 2024
@tomhaynes
Copy link

@dosu we have explicitly set the PrimaryView field to be just our Jenkins server URL, and inspecting the _tool_jenkins_jobs table shows the primary_view column to be populating with this value. However, we still see the above error, unless we manually increase the varchar max length..

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 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