Where communities thrive


  • Join over 1.5M+ people
  • Join over 100K+ communities
  • Free without limits
  • Create your own community
People
Repo info
Activity
    sunny952
    @sunny952
    sometime pagerduty plugin does not work, throw this exception
    version 0.4.1
    Has anyone ever had this problem?
    Alexander Leibzon
    @alexanderlz
    hi @sunny952 , can you point me to steps to reproduce?
    classnotfound doesn't seem like a random exception
    sunny952
    @sunny952
    I can not reproduce this issue, The problem will be resolved when Jenkins is rebooted
    If you don't restart Jenkins, create a task that contains only the pagerduty plug-in. The same error will be reported
    Alexander Leibzon
    @alexanderlz
    what's your jenkins version?
    and can you share some details about the job that you're running?
    (and if there are any other 3rd party plugins -> please list them here too)
    Kirsey Fam
    @chopain
    how is the auto-resolve option specified in a declarative pipeline?
    in the post section, I have
    post {
            success {
                echo "${currentBuild.result}"
            }
            failure {
                echo "${currentBuild.result}. Sending PagerDuty alert..."
                pagerduty(resolve: false, serviceKey: "${INTEGRATION_KEY}", incDescription: "Pipeline Failure", incDetails: "Build: ${env.BUILD_URL}")
                }
            }
        }
    this works fine for creating the alert, but auto-resolve isn't working with this setup.
    Alexander Leibzon
    @alexanderlz

    @chopain
    did you try to trigger it with resolve: true on success?

    I'm not sure I implemented anything special in pipelines
    you can workaround with a variable that holds the failure, but I guess it's not what you meant.

    if just triggering with resolve on success won't work - do you mind opening me a bug/feature request so I remember to implement it

    Kirsey Fam
    @chopain
    @alexanderlz makes sense, tried adding that to the success case and it's working as expected. thanks for the help!
    Adam Vaughan
    @adamvaughan
    Hello @alexanderlz :wave:. Let me know what I need to do to help with testing the changes to the plugin.
    Michael Davis
    @rodalli

    I'm trying to use the PagerDuty Jenkins plugin as part of a scripted pipeline (I'd like to use declarative, but can't on this particular project), but I'm getting this error when the plugin is triggered:

    [Pipeline] pagerduty
    WARNING: Unknown parameter(s) found for class type 'org.jenkinsci.plugins.pagerduty.pipeline.PagerDutyTriggerStep': incDescription,incDetails,serviceKey
    Triggering pagerDuty with routingKey null
    summary null
    severity critical
    ERROR: Tried to trigger PD with routingKey = [null]
    java.lang.IllegalArgumentException: summary cannot be blank.

    Here's what I'm trying to use in my try/catch/finally block:

        } finally {
            if (currentBuild.result == 'FAILURE') {
              pagerduty(resolve: false, serviceKey: "${integration_key}", incDescription: "pipeline test incident", incDetails: "Build: ${env.BUILD_URL}")
            }

    Looking at the plugin docs, I don't see anything about a "routingKey" parameter. The plugin also doesn't seem to know about the incDescription, incDetails and serviceKey parameters documented here: https://plugins.jenkins.io/pagerduty/
    Any ideas?

    Michael Davis
    @rodalli
    I'm starting to suspect it's just not possible to use the PagerDuty plug-in with scripted pipelines, although it seems like it should work for scripted if it works for declaritive?
    Alexander Leibzon
    @alexanderlz

    hi @rodalli
    the parameter names have changed and I didn't update the docs yet

    the correct param names are:

    routingKey (instead of serviceKey)
    incidentSummary
    incidentSource
    incidentSeverity
    incidentComponent
    incidentGroup
    incidentClass

    I will update the docs (and push another small bug fix) and hopefully release version 6.2 this week
    @rodalli - in the meantime try to modify the params according to what I sent u and tell me if it worked.
    (another possible workaround until I push the change - is to revert to version 4.1 of the plugin)
    Michael Davis
    @rodalli
    That seems to have gotten me past the error, thanks @alexanderlz ! I am getting some other errors, "source cannot be blank", etc. but I think I can work through those. It would be great when the doc update is released to have some info on what these new parameters are. Thanks for your work on this!
    Alexander Leibzon
    @alexanderlz
    @rodalli - I plan to work on it during friday, will let u know when the fix pushed to jenkins update center
    Zbynek Konecny
    @zbynek

    This simple test fails for pagerduty plugin:

    @Test
        public void testChangeEventStepDescriptor(){
            Descriptor<?> d = new PagerDutyChangeEventStep.DescriptorImpl();
            Assert.assertNotNull(d.getDisplayName());
        }

    not being able to instantiate the descriptor breaks the documentation generator (can be fixed in the generator), but I assume it also means the PagerDutyChangeEventStep is not really usable in pipeline
    jenkinsci/pagerduty-plugin#11

    Alexander Leibzon
    @alexanderlz
    @zbynek
    this PR should fix it
    alexanderlz/jenkins-pagerduty-plugin#41
    Zbynek Konecny
    @zbynek
    it does indeed, thanks! It's just confusing that this PR is for your personal repo and the bug is still present in the jenkinsci repo.
    Alexander Leibzon
    @alexanderlz
    @zbynek will let you know when it's in jenkins update center
    Alexander Leibzon
    @alexanderlz

    @rodalli @zbynek

    0.6.2 rolled out to the jenkins update center

    Zbynek Konecny
    @zbynek
    Thanks. Just FYI there are now two Pipeline steps for the change event: https://www.jenkins.io/doc/pipeline/steps/pagerduty/ . You may consider removing the PagerDutyChangeEventStep class and adding @Symbol("pagerdutyChangeEvent") annotation on ChangeEvents descriptor to make it accessible in Pipeline.
    2 replies
    akrapfl
    @akrapfl

    Hello! Long time listener, first time caller! Thank you for releasing 0.6.2 so quickly. That's a big help. As to the confusion over which repo to submit a PR to (I was the submitter). Which repo SHOULD PRs be submitted against? I used the personal repo, as it had issues enabled, so I created the issue and the PR there. What would you like me to do in the future @alexanderlz ?

    Love the plugin, big fan. I hope you're open to a few future feature requests and PRs! I'd like my team to help you out, if you're willing.

    Alexander Leibzon
    @alexanderlz

    Hi @akrapfl ,

    glad to hear and thanks for your help!
    you can submit PR and feature requests to any of the repos, I keep them in sync. (alexanderlz is upstream of jenkinsci).

    Bryan Bishop
    @bjbishop
    Hello! I'm Bryan and I work with @akrapfl above and wanted to say thank you again for this plugin. Looking forward to working with everyone on some new features.
    Rudrasish Pradhan
    @rudrasish27
    Hello @alexanderlz
    I am updating my parameters to the new variables as mentioned in the doc. We have so many scripts which were using incDetails and now those are merged with incidentSummary variable which looks clumsy as well. Do we have any other fields which worked like incDetails variable and will showcase in custom details job in PD?
    Alexander Leibzon
    @alexanderlz
    @rudrasish27 - can you give me an example of what are you trying to achieve?
    Rudrasish Pradhan
    @rudrasish27
    I am trying to achieve something similar to this: https://github.com/alexanderlz/jenkins-pagerduty-plugin/issues/50#issue-797205848
    Not able to integrate custom details section anymore
    Alexander Leibzon
    @alexanderlz
    will take a look at it today
    Rudrasish Pradhan
    @rudrasish27
    Sure @alexanderlz . Will be of great help. Thank you.
    M.Nikolov
    @gitomir

    hi @alexanderlz , how can I persist dedupKey between jobs? I'm trying to resolve using this code :

    post {
            success {
                echo "${currentBuild.result}"
                pagerduty(resolve: true, routingKey: "${PD_INTEGRATION_KEY}", incidentSummary: "Suceeded to start ec2 instance ${params.INST_ID} in ${params.REGN_ID}", incidentSource: "Build: ${env.BUILD_URL}")
            }
            failure {
                echo "${currentBuild.result}. Sending PagerDuty alert..."
                pagerduty(resolve: false, routingKey: "${PD_INTEGRATION_KEY}", incidentSummary: "Failed to start ec2 instance ${params.INST_ID} in ${params.REGN_ID}", incidentSource: "Build: ${env.BUILD_URL}")
            }
        }

    the 1st job which fails I get:

    FAILURE. Sending PagerDuty alert...
    [Pipeline] pagerduty
    Triggering pagerDuty with routingKey 82aff0a5ebce4306d06a2dec3e511aa4
    summary Failed to start ec2 instance i-aa4563ca26ba01a52 in eu-west-1
    severity critical
    PagerDuty Notification Result: success
    Message: Event processed
    Errors: null
    PagerDuty dedupKey: <<ad8ca9c77f2b43c58cf5875039d1106d>>

    the 2nd job which is OK and trying to resolve I get:

    dedupKey not provided, nothing to resolve. (check previous builds for further clues)

    Alexander Leibzon
    @alexanderlz
    I will check
    which version of jenkins/pagerduty plugin do you have?
    @gitomir ^
    M.Nikolov
    @gitomir
    @alexanderlz 0.7.0
    Alexander Leibzon
    @alexanderlz
    thx, I'll check
    Vikas
    @Goga482071661_twitter
    I am trying to integrate Jenkins with pagerduty to get notifications from Jenkins build, Jenkins fail build is creating incident but it is not resolving after build success, getting errors like below:
    dedupKey not provided, nothing to resolve. (check previous builds for further clues)
    [Pipeline] pagerdutyChangeEvent
    Generated payload for PagerDuty Change Events
    {"payload":{"summary":"Simple-Pipeline #50: SUCCESS","source":"Jenkins","custom_details":{"duration":"2.8 sec and counting","result":"SUCCESS","build_number":50,"cause":"Started by user admin"},"timestamp":"2022-04-26T12:31:47.518Z"},"links":[{"href":"http://172.24.217.90:8080/job/Simple-Pipeline/50/display/redirect","text":"View on Jenkins"}],"routing_key":"$PD_INTEGRATION_KEY"}
    ERROR: Server returned HTTP response code: 400 for URL: https://events.pagerduty.com/v2/change/enqueue
    java.io.IOException: Server returned HTTP response code: 400 for URL: https://events.pagerduty.com/v2/change/enqueue
    How Capture dedupKey from faild build and pass it check condition if dedupKey is matching to resolve the incident.
    aah9
    @aah9
    @alexanderlz - Hello! I've created a pull request for a minor improvement in the pagerduty plugin : alexanderlz/jenkins-pagerduty-plugin#60. Please let me know if you have any questions!
    Alexander Leibzon
    @alexanderlz
    @aah9 - I'll take a look, thanks!
    @Goga482071661_twitter - which version are you using?
    you mean dedup is not persisted between builds?
    Mark Diez
    @markediez

    Jenkins version: v2.303.1
    pagerduty plugin: v0.7.0
    (restarted jenkins after installation)

    I keep getting ERROR: Tried to trigger PD with routingKey = [null] when attempting to trigger an incident

    • Tried it with normal Freestyle project, Pipeline, and scripted pipeline

    Anyone else getting this behavior?

    Mark Diez
    @markediez
    ChangeEvents is working properly (tested in a Freestyle project only). I just can't trigger an incident
    Alexander Leibzon
    @alexanderlz
    @markediez - routingKey (a.k.a Integration Key) is a must have (you should get it from your PD account)
    https://plugins.jenkins.io/pagerduty/#plugin-content-getting-started
    @markediez or what you're saying is that you do pass the routing key and it somehow doesn't persist it?
    Mark Diez
    @markediez
    @alexanderlz yes I'm passing the routingKey and it somehow doesn't persist it
    i.e.
    // Pipeline Example - returns error mentioned
    stage('Trigger PD') {
            steps {
                  pagerduty(
                      resolve: false,
                      routingKey: 'myintegrationkey'
                  )
            }
    }
    
    // Scripted Pipeline - returns error mentioned
    stage("Trigger PD") {
                pagerduty(
                    resolve: false,
                    routingKey: 'myintegrationkey'
                )
    }
    
    // Same error when I use the routingKey in a freestyle project