riboseinc / aws-codecommit-trigger-plugin Goto Github PK
View Code? Open in Web Editor NEWJenkins plugin for triggering jobs with AWS CodeCommit repo updates
Home Page: https://www.ribose.com
License: Apache License 2.0
Jenkins plugin for triggering jobs with AWS CodeCommit repo updates
Home Page: https://www.ribose.com
License: Apache License 2.0
As title. Link here: https://wiki.jenkins.io/display/JENKINS/AWS+CodeCommit+Trigger+Plugin
i.e. Build not trigger, not get SQS notification...
Test access is throwing 504 Gateway timeout error
Versions:
Steps to reproduce:
{
"Version": "2012-10-17",
"Statement": [
{
"Sid": "VisualEditor0",
"Effect": "Allow",
"Action": [
"sqs:DeleteMessage",
"sqs:DeleteMessageBatch",
"sqs:ReceiveMessage",
"sqs:GetQueueAttributes",
"sqs:GetQueueUrl"
],
"Resource": "arn:aws:sqs:myRegion:myAccountID:myQueue"
},
{
"Sid": "VisualEditor1",
"Effect": "Allow",
"Action": "sqs:ListQueues",
"Resource": "*"
}
]
}
I am able to use CLI commands such as aws sqs get-queue-url --queue-name myQueue
from the Jenkins EC2 instance with keys from the user with attached policy, and I am getting replies back, so Jenkins EC2 can definitely reach the queue
Any idea what's wrong here?
io.relution.jenkins
is the namespace of M-Way Solutions. We should use a custom namespace instead to prevent conflicts.
as well as WIKI page
@ronaldtse
ATM, the plugin using custom Credentials
I think we should migrate to CloudBees+AWS+Credentials+Plugin
@ronaldtse Atm the validation of the SQS connection only do one simple task (original version): read queue url from queue selected. It doesnt make sense if the credential has permission to read queue lists but has no access right to read & delete queue items which is required by the plugin, check the SQS permission list http://docs.aws.amazon.com/AWSSimpleQueueService/latest/SQSDeveloperGuide/sqs-api-permissions-reference.html
The plugin should ask user to send an item to the queue. When the item is verified by the user, it should be deleted. The validation should return success value if all operations are successful.
@ronaldtse Travis would listen on a branch "release" or branch "master"... and do deploy if any commit on that branch.
We should grant Travis credentials to do make a new release/deployment.
Currently, only the first matching job will be triggered, then the message deleted and other matching jobs are not even looked at.
The plugin should trigger ALL jobs on an SQS message that matches the subscriptions.
I configured my user with an IAM policy allowing only the following actions:
sqs:ReceiveMessage
sqs:ListQueues (for configure page)
sqs:DeleteMessageBatch
The "Test Access" function reported the following error:
"User not has permission sqs:ReceiveMessage"
Allow also the following actions to resolve the problem:
sqs:GetQueueAttributes
Build Trigger Configuration :
Jenkins Logs :
Aug 14, 2018 5:26:54 PM [c.r.j.p.a.t.SQSQueueMonitorImpl][thread-000096]
WARNING: Monitor for https://sqs.eu-west-2.amazonaws.com/383325518584/aws_codecommit_queue stopped, error: java.lang.NullPointerException
at com.ribose.jenkins.plugin.awscodecommittrigger.model.entities.codecommit.Records.size(Records.java:38)
at com.ribose.jenkins.plugin.awscodecommittrigger.model.CodeCommitMessageParser.parseRecords(CodeCommitMessageParser.java:71)
at com.ribose.jenkins.plugin.awscodecommittrigger.model.CodeCommitMessageParser.parseMessage(CodeCommitMessageParser.java:61)
at com.ribose.jenkins.plugin.awscodecommittrigger.SQSTrigger.handleMessage(SQSTrigger.java:178)
at com.ribose.jenkins.plugin.awscodecommittrigger.SQSTrigger.handleMessages(SQSTrigger.java:153)
at com.ribose.jenkins.plugin.awscodecommittrigger.threading.SQSQueueMonitorImpl.notifyListeners(SQSQueueMonitorImpl.java:166)
at com.ribose.jenkins.plugin.awscodecommittrigger.threading.SQSQueueMonitorImpl.processMessages(SQSQueueMonitorImpl.java:155)
at com.ribose.jenkins.plugin.awscodecommittrigger.threading.SQSQueueMonitorImpl.run(SQSQueueMonitorImpl.java:110)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
at java.lang.Thread.run(Thread.java:748)
Any idea why this issue occurs?
Our wiki info is empty now, "No Information For This Plugin", https://wiki.jenkins.io/display/JENKINS/AWS+CodeCommit+Trigger+Plugin
Test for #4
I have installed the plugin, and deployed my queues and repo's using the provided terraform modules.
aws-codecommit-trigger 2.0.5
reponame: cicd-mgmt
repo url: https://git-codecommit.us-east-1.amazonaws.com/v1/repos/cicd-mgmt
eventSourceARN: arn:aws:codecommit:us-east-1:178164978985:cicd-mgmt
This is from a test Message.
[DEBUG] Parse and do match against events, message: {"Records":[{"awsRegion":"us-east-1","codecommit":{"references":[{"commit":"c013644482f36464045f706bf13be5ed512c326f","ref":"refs/heads/master"}]},"customData":"","eventId":"42b3f81f-6e9a-4385-9c86-2d645a9b8c36","eventName":"TriggerEventTest","eventPartNumber":1,"eventSource":"aws:codecommit","eventSourceARN":"arn:aws:codecommit:us-east-1:178164978985:cicd-mgmt","eventTime":"2018-10-04T14:31:25.717+0000","eventTotalParts":1,"eventTriggerConfigId":"42b3f81f-6e9a-4385-9c86-2d645a9b8c36","eventTriggerName":"notifications","eventVersion":"1.0","userIdentityARN":"arn:aws:sts::178164978985:assumed-role/SAML-CICD-Administrator/jseiser"}]}
Oct 04, 2018 2:32:55 PM CONFIG [c.r.j.p.a.m.CodeCommitMessageParser][thread-00012E]
[DEBUG] Parse message null
Oct 04, 2018 2:32:55 PM WARNING [c.r.j.p.a.m.CodeCommitMessageParser][thread-00012E]
Message contains no text
Oct 04, 2018 2:32:55 PM CONFIG [c.r.j.p.a.m.AndEventTriggerMatcher][thread-00012E]
[DEBUG] Test if any event not match using c.r.j.p.a.m.i.ScmJobEventTriggerMatcher
Oct 04, 2018 2:32:55 PM CONFIG [c.r.j.p.a.m.i.ScmJobEventTriggerMatcher][thread-00012E][job-cicd_cicd-mgmt]
[DEBUG] Events size: 0, SCMs size: 1
Oct 04, 2018 2:32:55 PM CONFIG [c.r.j.p.a.m.i.ScmJobEventTriggerMatcher][thread-00012E][job-cicd_cicd-mgmt]
[DEBUG] No event matched
Oct 04, 2018 2:32:55 PM CONFIG [c.r.j.p.a.m.EventTriggerMatcherImpl][thread-00012E][job-cicd_cicd-mgmt]
[DEBUG] Finally, events match status is false
Oct 04, 2018 2:32:55 PM INFO [c.r.j.p.a.SQSTrigger][thread-00012E][job-cicd_cicd-mgmt]
Any event matched? false. Message: null
Oct 04, 2018 2:32:55 PM CONFIG [c.r.j.p.a.t.SQSQueueMonitorImpl][thread-00012E]
[DEBUG] Received 1 messages, proceed 0 messages
Oct 04, 2018 2:32:55 PM CONFIG [c.r.j.p.a.n.SQSChannelImpl][thread-00012E]
[DEBUG] Send request to delete messages from queue https://sqs.us-east-1.amazonaws.com/178164978985/codecommit-notifications-queue
Oct 04, 2018 2:32:55 PM CONFIG [c.r.j.p.a.n.SQSChannelImpl][thread-00012E]
[DEBUG] Delete 1 message(s) (0 failed) from https://sqs.us-east-1.amazonaws.com/178164978985/codecommit-notifications-queue
This is from a git push
[DEBUG] Start monitor for https://sqs.us-east-1.amazonaws.com/178164978985/codecommit-notifications-queue
Oct 04, 2018 3:24:47 PM CONFIG [c.r.j.p.a.n.SQSChannelImpl][thread-00012E]
[DEBUG] Star polling messages
Oct 04, 2018 3:24:47 PM CONFIG [c.r.j.p.a.n.SQSChannelImpl][thread-00012E]
[DEBUG] Requests count 1658 for https://sqs.us-east-1.amazonaws.com/178164978985/codecommit-notifications-queue
Oct 04, 2018 3:24:52 PM CONFIG [c.r.j.p.a.n.SQSChannelImpl][thread-00012E]
[DEBUG] Send request to receive messages from queue https://sqs.us-east-1.amazonaws.com/178164978985/codecommit-notifications-queue
Oct 04, 2018 3:24:52 PM CONFIG [c.r.j.p.a.SQSTrigger][thread-00012E][job-cicd_cicd-mgmt]
[DEBUG] Parse and do match against events, message: {"Records":[{"awsRegion":"us-east-1","codecommit":{"references":[{"commit":"ee36dc002055a40d9660b2bb19fd8d6ef2d77cd0","ref":"refs/heads/master"}]},"customData":"","eventId":"aa9a9713-ca98-476e-ba25-2bc9938c574b","eventName":"ReferenceChanges","eventPartNumber":1,"eventSource":"aws:codecommit","eventSourceARN":"arn:aws:codecommit:us-east-1:178164978985:cicd-mgmt","eventTime":"2018-10-04T15:23:22.589+0000","eventTotalParts":1,"eventTriggerConfigId":"fc39fcfe-39d6-4634-a51c-f6139d32549d","eventTriggerName":"notifications","eventVersion":"1.0","userIdentityARN":"arn:aws:sts::178164978985:assumed-role/role_idauto_assume_cicd/cicd-mfa-session"}]}
Oct 04, 2018 3:24:52 PM CONFIG [c.r.j.p.a.m.CodeCommitMessageParser][thread-00012E]
[DEBUG] Parse message null
Oct 04, 2018 3:24:52 PM WARNING [c.r.j.p.a.m.CodeCommitMessageParser][thread-00012E]
Message contains no text
Oct 04, 2018 3:24:52 PM CONFIG [c.r.j.p.a.m.AndEventTriggerMatcher][thread-00012E]
[DEBUG] Test if any event not match using c.r.j.p.a.m.i.ScmJobEventTriggerMatcher
Oct 04, 2018 3:24:52 PM CONFIG [c.r.j.p.a.m.i.ScmJobEventTriggerMatcher][thread-00012E][job-cicd_cicd-mgmt]
[DEBUG] Events size: 0, SCMs size: 1
Oct 04, 2018 3:24:52 PM CONFIG [c.r.j.p.a.m.i.ScmJobEventTriggerMatcher][thread-00012E][job-cicd_cicd-mgmt]
[DEBUG] No event matched
Oct 04, 2018 3:24:52 PM CONFIG [c.r.j.p.a.m.EventTriggerMatcherImpl][thread-00012E][job-cicd_cicd-mgmt]
[DEBUG] Finally, events match status is false
Oct 04, 2018 3:24:52 PM INFO [c.r.j.p.a.SQSTrigger][thread-00012E][job-cicd_cicd-mgmt]
Any event matched? false. Message: null
Oct 04, 2018 3:24:52 PM CONFIG [c.r.j.p.a.t.SQSQueueMonitorImpl][thread-00012E]
[DEBUG] Received 1 messages, proceed 0 messages
Oct 04, 2018 3:24:52 PM CONFIG [c.r.j.p.a.n.SQSChannelImpl][thread-00012E]
[DEBUG] Send request to delete messages from queue https://sqs.us-east-1.amazonaws.com/178164978985/codecommit-notifications-queue
Oct 04, 2018 3:24:52 PM CONFIG [c.r.j.p.a.n.SQSChannelImpl][thread-00012E]
[DEBUG] Delete 1 message(s) (0 failed) from https://sqs.us-east-1.amazonaws.com/178164978985/codecommit-notifications-queue
I'm having an issue using aws-codecommit-trigger-plugin
. I'm following the instructions in the README to configure a queue, however when I open the Configure System
menu in jenkins, jenkins presents me the following stack trace: stack trace gist, in the AWS Code Commit Trigger Plugin section.
Currently I have these plugins installed:
Display URL API (display-url-api): 2.0
Gradle Plugin (gradle): 1.27.1
Pipeline: Nodes and Processes (workflow-durable-task-step): 2.14
JUnit Plugin (junit): 1.21
Subversion Plug-in (subversion): 2.9
Git plugin (git): 3.5.1
Pipeline: API (workflow-api): 2.20
Folders Plugin (cloudbees-folder): 6.1.2
JavaScript GUI Lib: Moment.js bundle plugin (momentjs): 1.1.1
Jackson 2 API Plugin (jackson2-api): 2.7.3
Script Security Plugin (script-security): 1.33
Branch API Plugin (branch-api): 2.0.11
Pipeline: Basic Steps (workflow-basic-steps): 2.6
AWS CodeCommit Trigger Plugin (aws-codecommit-trigger): 1.13
Locale plugin (locale): 1.2
Docker Commons Plugin (docker-commons): 1.8
Matrix Project Plugin (matrix-project): 1.11
Resource Disposer Plugin (resource-disposer): 0.7
Timestamper (timestamper): 1.8.8
GitHub plugin (github): 1.28.0
Mailer Plugin (mailer): 1.20
Pipeline: Job (workflow-job): 2.14.1
Email Extension Plugin (email-ext): 2.58
Authentication Tokens API Plugin (authentication-tokens): 1.3
Structs Plugin (structs): 1.10
Pipeline: Model Definition (pipeline-model-definition): 1.1.9
Pipeline: Input Step (pipeline-input-step): 2.8
SSH Credentials Plugin (ssh-credentials): 1.13
Javadoc Plugin (javadoc): 1.4
JavaScript GUI Lib: jQuery bundles (jQuery and jQuery UI) plugin (jquery-detached): 1.2.1
OWASP Markup Formatter Plugin (antisamy-markup-formatter): 1.5
Pipeline: Declarative Agent API (pipeline-model-declarative-agent): 1.1.1
Pipeline: Groovy (workflow-cps): 2.39
Pipeline (workflow-aggregator): 2.5
Pipeline: Declarative Extension Points API (pipeline-model-extensions): 1.1.9
GitHub Branch Source Plugin (github-branch-source): 2.2.3
Pipeline: Shared Groovy Libraries (workflow-cps-global-lib): 2.8
GitHub API Plugin (github-api): 1.86
JavaScript GUI Lib: Handlebars bundle plugin (handlebars): 1.1.1
Pipeline: REST API Plugin (pipeline-rest-api): 2.8
Pipeline: Milestone Step (pipeline-milestone-step): 1.3.1
SSH Slaves plugin (ssh-slaves): 1.21
Pipeline: Build Step (pipeline-build-step): 2.5.1
Pipeline: Stage Step (pipeline-stage-step): 2.2
Pipeline Graph Analysis Plugin (pipeline-graph-analysis): 1.5
Matrix Authorization Strategy Plugin (matrix-auth): 1.7
Credentials Binding Plugin (credentials-binding): 1.13
Ant Plugin (ant): 1.7
Durable Task Plugin (durable-task): 1.14
JavaScript GUI Lib: ACE Editor bundle plugin (ace-editor): 1.1
GIT server Plugin (git-server): 1.7
PAM Authentication plugin (pam-auth): 1.3
Pipeline: Multibranch (workflow-multibranch): 2.16
Pipeline: Supporting APIs (workflow-support): 2.14
bouncycastle API Plugin (bouncycastle-api): 2.16.2
LDAP Plugin (ldap): 1.16
Credentials Plugin (credentials): 2.1.14
Pipeline: Stage View Plugin (pipeline-stage-view): 2.8
build timeout plugin (build-timeout): 1.18
Jackson Databind Plugin (jackson-databind): 1.2
Pipeline: Step API (workflow-step-api): 2.12
Windows Slaves Plugin (windows-slaves): 1.3.1
SCM API Plugin (scm-api): 2.2.1
Pipeline: Stage Tags Metadata (pipeline-stage-tags-metadata): 1.1.9
Docker Pipeline (docker-workflow): 1.12
Token Macro Plugin (token-macro): 2.2
Pipeline: GitHub Groovy Libraries (pipeline-github-lib): 1.0
Pipeline: SCM Step (workflow-scm-step): 2.6
MapDB API Plugin (mapdb-api): 1.0.9.0
Git client plugin (git-client): 2.5.0
External Monitor Job Type Plugin (external-monitor-job): 1.7
Pipeline: Model API (pipeline-model-api): 1.1.9
Plain Credentials Plugin (plain-credentials): 1.4
Amazon Web Services SDK (aws-java-sdk): 1.11.119
Workspace Cleanup Plugin (ws-cleanup): 0.34
Icon Shim Plugin (icon-shim): 2.0.3
Multiple SCMs plugin (multiple-scms): 0.6
Note: I can add the Access Key ID and the Secret Access Key, but the plugin is already broken in the momento that I open the Configure System
page and I can't list my queues.
From: @Kamidu
#58 (comment)
I have noticed time to time the automated builds doesn't trigger as expected. That can be recovered executing a build manually. Then the automation will resume for days as expected. There were one or two times during the last months where we had to trigger a manual job to resume the automation. Any idea what can cause this?
Currently on pipeline jobs the line "Build when a Aws Code Commit SNS is published to an Amazon SQS queue" is not present.
It will be very useful to use this plugin on pipeline jobs too.
Help now link to old repo https://github.com/nickgrealy/aws-sqs-plugin/, this is not correct
Atm the plugin always delete its messages even if there are errors happened during the processing. We need to fix this
From our support email:
Hi Team,
I have configured he aws-codecommit-trigger-plugin in my setup. I have followed the steps which have mentioned in the article in this link https://github.com/riboseinc/aws-codecommit-trigger-plugin/
Have attached the error, Kindly help me to solve the same.
Thanks in advance.
Dhamodharan.
The original one only log activities when Job is triggered, could we fix this? @ronaldtse
Jenkins ver. 2.150.2
Started getting the below errors in my logs.
Error while serving https://jenkins.cicd.domain.com/descriptorByName/com.ribose.jenkins.plugin.awscodecommittrigger.SQSTriggerQueue/fillUrlItems
java.lang.NoClassDefFoundError: Could not initialize class com.amazonaws.auth.internal.AWS4SignerUtils
at com.amazonaws.auth.internal.AWS4SignerRequestParams.<init>(AWS4SignerRequestParams.java:99)
at com.amazonaws.auth.AWS4Signer.sign(AWS4Signer.java:225)
at com.amazonaws.http.AmazonHttpClient$RequestExecutor.executeOneRequest(AmazonHttpClient.java:1209)
at com.amazonaws.http.AmazonHttpClient$RequestExecutor.executeHelper(AmazonHttpClient.java:1055)
at com.amazonaws.http.AmazonHttpClient$RequestExecutor.doExecute(AmazonHttpClient.java:743)
at com.amazonaws.http.AmazonHttpClient$RequestExecutor.executeWithTimer(AmazonHttpClient.java:717)
at com.amazonaws.http.AmazonHttpClient$RequestExecutor.execute(AmazonHttpClient.java:699)
at com.amazonaws.http.AmazonHttpClient$RequestExecutor.access$500(AmazonHttpClient.java:667)
at com.amazonaws.http.AmazonHttpClient$RequestExecutionBuilderImpl.execute(AmazonHttpClient.java:649)
at com.amazonaws.http.AmazonHttpClient.execute(AmazonHttpClient.java:513)
at com.amazonaws.services.sqs.AmazonSQSClient.doInvoke(AmazonSQSClient.java:1740)
at com.amazonaws.services.sqs.AmazonSQSClient.invoke(AmazonSQSClient.java:1716)
at com.amazonaws.services.sqs.AmazonSQSClient.executeListQueues(AmazonSQSClient.java:1185)
at com.amazonaws.services.sqs.AmazonSQSClient.listQueues(AmazonSQSClient.java:1162)
at com.amazonaws.services.sqs.AmazonSQSClient.listQueues(AmazonSQSClient.java:1197)
at com.amazonaws.services.sqs.buffered.AmazonSQSBufferedAsyncClient.listQueues(AmazonSQSBufferedAsyncClient.java:350)
at com.ribose.jenkins.plugin.awscodecommittrigger.SQSTriggerQueue$DescriptorImpl.doFillUrlItems(SQSTriggerQueue.java:380)
at java.lang.invoke.MethodHandle.invokeWithArguments(MethodHandle.java:627)
at org.kohsuke.stapler.Function$MethodFunction.invoke(Function.java:396)
Caused: java.lang.reflect.InvocationTargetException
at org.kohsuke.stapler.Function$MethodFunction.invoke(Function.java:400)
at org.kohsuke.stapler.Function$InstanceFunction.invoke(Function.java:408)
at org.kohsuke.stapler.Function.bindAndInvoke(Function.java:212)
at org.kohsuke.stapler.Function.bindAndInvokeAndServeResponse(Function.java:145)
at org.kohsuke.stapler.MetaClass$11.doDispatch(MetaClass.java:537)
at org.kohsuke.stapler.NameBasedDispatcher.dispatch(NameBasedDispatcher.java:58)
at org.kohsuke.stapler.Stapler.tryInvoke(Stapler.java:739)
at org.kohsuke.stapler.Stapler.invoke(Stapler.java:870)
at org.kohsuke.stapler.MetaClass$4.doDispatch(MetaClass.java:282)
at org.kohsuke.stapler.NameBasedDispatcher.dispatch(NameBasedDispatcher.java:58)
at org.kohsuke.stapler.Stapler.tryInvoke(Stapler.java:739)
at org.kohsuke.stapler.Stapler.invoke(Stapler.java:870)
at org.kohsuke.stapler.Stapler.invoke(Stapler.java:668)
at org.kohsuke.stapler.Stapler.service(Stapler.java:238)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:790)
at org.eclipse.jetty.servlet.ServletHolder.handle(ServletHolder.java:865)
at org.eclipse.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1655)
at hudson.util.PluginServletFilter$1.doFilter(PluginServletFilter.java:154)
at org.jenkinsci.plugins.ssegateway.Endpoint$SSEListenChannelFilter.doFilter(Endpoint.java:243)
at hudson.util.PluginServletFilter$1.doFilter(PluginServletFilter.java:151)
at io.jenkins.blueocean.ResourceCacheControl.doFilter(ResourceCacheControl.java:134)
at hudson.util.PluginServletFilter$1.doFilter(PluginServletFilter.java:151)
at io.jenkins.blueocean.auth.jwt.impl.JwtAuthenticationFilter.doFilter(JwtAuthenticationFilter.java:61)
at hudson.util.PluginServletFilter$1.doFilter(PluginServletFilter.java:151)
at jenkins.telemetry.impl.UserLanguages$AcceptLanguageFilter.doFilter(UserLanguages.java:128)
at hudson.util.PluginServletFilter$1.doFilter(PluginServletFilter.java:151)
at hudson.util.PluginServletFilter.doFilter(PluginServletFilter.java:157)
at org.eclipse.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1642)
at hudson.security.csrf.CrumbFilter.doFilter(CrumbFilter.java:99)
at org.eclipse.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1642)
at hudson.security.ChainedServletFilter$1.doFilter(ChainedServletFilter.java:84)
at hudson.security.UnwrapSecurityExceptionFilter.doFilter(UnwrapSecurityExceptionFilter.java:51)
at hudson.security.ChainedServletFilter$1.doFilter(ChainedServletFilter.java:87)
at jenkins.security.ExceptionTranslationFilter.doFilter(ExceptionTranslationFilter.java:117)
at hudson.security.ChainedServletFilter$1.doFilter(ChainedServletFilter.java:87)
at org.acegisecurity.providers.anonymous.AnonymousProcessingFilter.doFilter(AnonymousProcessingFilter.java:125)
at hudson.security.ChainedServletFilter$1.doFilter(ChainedServletFilter.java:87)
at org.acegisecurity.ui.rememberme.RememberMeProcessingFilter.doFilter(RememberMeProcessingFilter.java:142)
at hudson.security.ChainedServletFilter$1.doFilter(ChainedServletFilter.java:87)
at org.acegisecurity.ui.AbstractProcessingFilter.doFilter(AbstractProcessingFilter.java:271)
at hudson.security.ChainedServletFilter$1.doFilter(ChainedServletFilter.java:87)
at jenkins.security.BasicHeaderProcessor.doFilter(BasicHeaderProcessor.java:93)
at hudson.security.ChainedServletFilter$1.doFilter(ChainedServletFilter.java:87)
at org.acegisecurity.context.HttpSessionContextIntegrationFilter.doFilter(HttpSessionContextIntegrationFilter.java:249)
at hudson.security.HttpSessionContextIntegrationFilter2.doFilter(HttpSessionContextIntegrationFilter2.java:67)
at hudson.security.ChainedServletFilter$1.doFilter(ChainedServletFilter.java:87)
at hudson.security.ChainedServletFilter.doFilter(ChainedServletFilter.java:90)
at hudson.security.HudsonFilter.doFilter(HudsonFilter.java:171)
at org.eclipse.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1642)
at org.kohsuke.stapler.compression.CompressionFilter.doFilter(CompressionFilter.java:49)
at org.eclipse.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1642)
at hudson.util.CharacterEncodingFilter.doFilter(CharacterEncodingFilter.java:82)
at org.eclipse.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1642)
at org.kohsuke.stapler.DiagnosticThreadNameFilter.doFilter(DiagnosticThreadNameFilter.java:30)
at org.eclipse.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1642)
at org.eclipse.jetty.servlet.ServletHandler.doHandle(ServletHandler.java:533)
at org.eclipse.jetty.server.handler.ScopedHandler.handle(ScopedHandler.java:146)
at org.eclipse.jetty.security.SecurityHandler.handle(SecurityHandler.java:524)
at org.eclipse.jetty.server.handler.HandlerWrapper.handle(HandlerWrapper.java:132)
at org.eclipse.jetty.server.handler.ScopedHandler.nextHandle(ScopedHandler.java:257)
at org.eclipse.jetty.server.session.SessionHandler.doHandle(SessionHandler.java:1595)
at org.eclipse.jetty.server.handler.ScopedHandler.nextHandle(ScopedHandler.java:255)
at org.eclipse.jetty.server.handler.ContextHandler.doHandle(ContextHandler.java:1340)
at org.eclipse.jetty.server.handler.ScopedHandler.nextScope(ScopedHandler.java:203)
at org.eclipse.jetty.servlet.ServletHandler.doScope(ServletHandler.java:473)
at org.eclipse.jetty.server.session.SessionHandler.doScope(SessionHandler.java:1564)
at org.eclipse.jetty.server.handler.ScopedHandler.nextScope(ScopedHandler.java:201)
at org.eclipse.jetty.server.handler.ContextHandler.doScope(ContextHandler.java:1242)
at org.eclipse.jetty.server.handler.ScopedHandler.handle(ScopedHandler.java:144)
at org.eclipse.jetty.server.handler.HandlerWrapper.handle(HandlerWrapper.java:132)
at org.eclipse.jetty.server.Server.handle(Server.java:503)
at org.eclipse.jetty.server.HttpChannel.handle(HttpChannel.java:364)
at org.eclipse.jetty.server.HttpConnection.onFillable(HttpConnection.java:260)
at org.eclipse.jetty.io.AbstractConnection$ReadCallback.succeeded(AbstractConnection.java:305)
at org.eclipse.jetty.io.FillInterest.fillable(FillInterest.java:103)
at org.eclipse.jetty.io.ChannelEndPoint$2.run(ChannelEndPoint.java:118)
at org.eclipse.jetty.util.thread.strategy.EatWhatYouKill.runTask(EatWhatYouKill.java:333)
at org.eclipse.jetty.util.thread.strategy.EatWhatYouKill.doProduce(EatWhatYouKill.java:310)
at org.eclipse.jetty.util.thread.strategy.EatWhatYouKill.tryProduce(EatWhatYouKill.java:168)
at org.eclipse.jetty.util.thread.strategy.EatWhatYouKill.run(EatWhatYouKill.java:126)
at org.eclipse.jetty.util.thread.ReservedThreadExecutor$ReservedThread.run(ReservedThreadExecutor.java:366)
at org.eclipse.jetty.util.thread.QueuedThreadPool.runJob(QueuedThreadPool.java:765)
at org.eclipse.jetty.util.thread.QueuedThreadPool$2.run(QueuedThreadPool.java:683)
at java.lang.Thread.run(Thread.java:748)
I have a Jenkins EC2 instance with an IAM role attached to it that has full SQS access. However the CodeCommit Trigger Plugin is forcing me to specify an AWS Key ID and Secret to authenticate against the AWS SQS that I set up. It would be nice if the plugin could somehow check the existing IAM role permissions rather than forcing me to use an AWS key ID and secret when the actual instance already has permissions to access SQS.
Link here
.travis.yml
is already doneSQSTrigger is saving in file io.relution.jenkins.awssqs.SQSTrigger.xml
, this get conflict with the old plugin
After installing the aws-codecommit-trigger-plugin there is no configuration options that appear under Configure System, where I would expect to enter the Queue anme, Access key ID and Secret Key information.
My environment:
AWS EC2 t2.micro instance built from us-west-2 ami-6e1a0117 ubuntu
Linux jenkins 4.4.0-1022-aws #31-Ubuntu SMP Tue Jun 27 11:27:55 UTC 2017 x86_64 x86_64 x86_64 GNU/Linux
Fresh first-time jenkins 2.76 installed with "apt-get install jenkins"
Only plug-in added after fresh install: aws-codecommit-trigger-plugin version 1.15
I tried several things to get it to work:
None of those steps enabled me to see the SQS Queue config options in Configure System. Just to make sure I wasn't having a general Jenkins plug-ins problem, I also installed the older AWS SQS Build Trigger Plugin version 1.005, and I WAS indeed able to see its similar configuration options now appearing in the Configure System screen under a section called "Configuration of Amazon SQS queues". So I seem to have proven that my installation is valid and other plug-ins are able to present their configuration sections under Configure System.
Please let me know if I can take any additional configuration or troubleshooting steps to assist you, I am happy to do so. This was all set up in an automated fashion using packer and terraform so I can easily re-create the environment. I will end my post with my packer configuration used to build my ami. Thank you very much for your assistance.
{
"builders": [{
"type": "amazon-ebs",
"access_key": "",
"secret_key": "",
"region": "us-west-2",
"source_ami": "ami-6e1a0117",
"instance_type": "t2.micro",
"ssh_username": "ubuntu",
"ami_name": "packer-jenkins {{timestamp}}"
}],
"provisioners": [{
"type": "shell",
"inline": [
"sudo apt-get update",
"sudo apt-get install -y openjdk-8-jdk",
"wget -q -O - http://pkg.jenkins-ci.org/debian/jenkins-ci.org.key | sudo apt-key add -",
"sudo sh -c 'echo deb http://pkg.jenkins-ci.org/debian binary/ > /etc/apt/sources.list.d/jenkins.list'",
"sudo apt-get update",
"sudo apt-get install -y jenkins"
]
}]
}
Hi there,
This plugin used to work very well for me. thanks for that.
But somehow, it stops working. When I take a look at the log, it reported:
Any event matched? false. Message: 2f6a712a-6490-5245-bf60-239f7bc4b89f
I found that the message from SQS was delivered. But it cannot be matched in the configured jobs. This happened after I upgraded Jenkins to 2.95 or later.
Can you help?
rgds,
Chris
Sample log messages for one SQS like bellow, INFO level is enabled by default
Which log entries are redundant?
Aug 10, 2017 12:27:59 PM [log]
INFO: [c.r.j.p.a.SQSTrigger][thread-0000B1] [job-testjenkins-pipeline] Parse and do match against events, message: {
"Type" : "Notification",
"MessageId" : "179b21d9-b49d-5d3d-9d22-73dc458228b2",
"TopicArn" : "arn:aws:sns:us-west-2:239062223385:testjenkins-topic",
"Subject" : "UPDATE: AWS CodeCommit us-west-2 push: testjenkins2",
"Message" : "{\"Records\":[{\"awsRegion\":\"us-west-2\",\"codecommit\":{\"references\":[{\"commit\":\"95a0dc394aa840c441d0734fb6f0307e42ebebec\",\"ref\":\"refs/heads/master\"}]},\"eventId\":\"c0646674-cd6a-4095-baea-5888c6a4d829\",\"eventName\":\"ReferenceChanges\",\"eventPartNumber\":1,\"eventSource\":\"aws:codecommit\",\"eventSourceARN\":\"arn:aws:codecommit:us-west-2:239062223385:testjenkins2\",\"eventTime\":\"2017-08-10T05:27:59.217+0000\",\"eventTotalParts\":1,\"eventTriggerConfigId\":\"98c0360d-86ef-495d-a91b-21f6f5294ff7\",\"eventTriggerName\":\"All\",\"eventVersion\":\"1.0\",\"userIdentityARN\":\"arn:aws:iam::239062223385:user/ext-phuong-huynh\"}]}",
"Timestamp" : "2017-08-10T05:27:59.274Z",
"SignatureVersion" : "1",
"Signature" : "DzYsyV6BHaQZei0jJzrCMq4zwAWIjbY3x7qGSSzEm+UiRItMR+fw3nOxkIyvj4zOUyD3HRrydz2SA1DGaOvAoyQKtF3xwEBD/S8QZe/ZcgQ0zkcoNNBOevzRHCPVNCqqcq9XADHys0whrOr7Vl78Pt/hqMd4XxsGP9UFj/GK5TgiQ0BYU6pF21ylsBl7b6k9Sk2k7BKhRVYb33rTY9MGQzZrJmTmrW3ysWUiDvpHz2yvA/l3adATOzboyn+Kxltepn40Yn4HE7ic7/JhaMyhaxIMnuUUhsINbLX6oe5QM6hXL9QlPouIm1mR89DH7i0dDMvm0qMGZlTxnzHFCMSOvw==",
"SigningCertURL" : "https://sns.us-west-2.amazonaws.com/SimpleNotificationService-b95095beb82e8f6a046b3aafc7f4149a.pem",
"UnsubscribeURL" : "https://sns.us-west-2.amazonaws.com/?Action=Unsubscribe&SubscriptionArn=arn:aws:sns:us-west-2:239062223385:testjenkins-topic:cbae7177-c37e-411e-a5e8-ee9a4b871ff8"
}
Aug 10, 2017 12:27:59 PM [log]
INFO: [c.r.j.p.a.m.i.ScmJobEventTriggerMatcher][thread-0000B1] [job-testjenkins-pipeline] Hurray! Event arn:aws:codecommit:us-west-2:239062223385:testjenkins2 matched SCM git https://git-codecommit.us-west-2.amazonaws.com/v1/repos/testjenkins2
Aug 10, 2017 12:27:59 PM [log]
INFO: [c.r.j.p.a.m.i.SubscribeBranchEventTriggerMatcher][thread-0000B1] [job-testjenkins-pipeline] Hurray! Event arn:aws:codecommit:us-west-2:239062223385:testjenkins2 matched branch master
Aug 10, 2017 12:27:59 PM [log]
INFO: [c.r.j.p.a.m.AndEventTriggerMatcher][thread-0000B1] OK! At least one event matched
Aug 10, 2017 12:27:59 PM [log]
INFO: [c.r.j.p.a.m.EventTriggerMatcherImpl][thread-0000B1] [job-testjenkins-pipeline] Finally, events match status is true
Aug 10, 2017 12:27:59 PM [log]
INFO: [c.r.j.p.a.SQSTrigger][thread-0000B1] [job-testjenkins-pipeline] Hurray! Execute it
Aug 10, 2017 12:27:59 PM [log]
INFO: Try to trigger the build for message: 179b21d9-b49d-5d3d-9d22-73dc458228b2
Aug 10, 2017 12:28:00 PM [log]
INFO: [c.r.j.p.a.n.SQSChannelImpl][thread-0000B1] Delete 1 message(s) (0 failed) from https://sqs.us-west-2.amazonaws.com/239062223385/testjenkinssqs
Aug 10, 2017 12:28:02 PM [log]
INFO: Any code changes found in SCM? true
Aug 10, 2017 12:28:02 PM [log]
INFO: Finally! The build is scheduled? true
Hi @phuonghuynh
After creating a new pipeline job, the plugin does not seem to be receiving any events from AWS codecommit (checked via Jenkins's "All Jenkins Log").
Jenkins version: 2.103
Any ideas why? Thanks!
See jenkinsci#25
It would be great if the username that triggered the notification in code commit was part of the BuildCause shortDescription. Right now, it contains the SQS message GUID which isn't useful for anyone no the Jenkins side.
This should be doable as the arn:Username is included in the message body of the SQS notification.
Otherwise, great plugin. It is working seamlessly.
I have created a pipeline in Jenkins which is listing to a queue. Other than the initial commit all the other commit triggers are ignored with the log "INFO: Cancel the build since no change found".
Please find the SQS Activity Log below,
Sep 04, 2018 12:16:34 PM [c.r.j.p.a.SQSTriggerBuilder][thread-0000BA]
INFO: Try to trigger the build for message: d35280d6-ee9f-5faf-8548-d4dea12d490e
no previous build to compare to
Sep 04, 2018 12:16:34 PM [c.r.j.p.a.SQSTriggerBuilder][thread-0000BA]
INFO: The build is scheduled? true by Message: d35280d6-ee9f-5faf-8548-d4dea12d490e
Sep 04, 2018 12:27:04 PM [c.r.j.p.a.SQSTriggerBuilder][thread-0000B6]
INFO: Try to trigger the build for message: f9d43617-0bc1-520e-9540-621f59e931ae
Sep 04, 2018 12:27:04 PM [c.r.j.p.a.SQSTriggerBuilder][thread-0000B6]
INFO: Cancel the build since no change found
Sep 04, 2018 2:18:07 PM [c.r.j.p.a.SQSTriggerBuilder][thread-0000B4]
INFO: Try to trigger the build for message: 29b3b5ff-35aa-55d6-92de-e1f75985a676
Sep 04, 2018 2:18:07 PM [c.r.j.p.a.SQSTriggerBuilder][thread-0000B4]
INFO: Cancel the build since no change found
Sep 04, 2018 2:24:15 PM [c.r.j.p.a.SQSTriggerBuilder][thread-0000BA]
INFO: Try to trigger the build for message: 902b3ff4-6b57-5289-bd42-6bfc06c89856
Sep 04, 2018 2:24:15 PM [c.r.j.p.a.SQSTriggerBuilder][thread-0000BA]
INFO: Cancel the build since no change found
Sep 04, 2018 2:30:42 PM [c.r.j.p.a.SQSTriggerBuilder][thread-0000B4]
INFO: Try to trigger the build for message: 0a9eeeb2-e075-5aef-8717-baba8f57e90a
Sep 04, 2018 2:30:42 PM [c.r.j.p.a.SQSTriggerBuilder][thread-0000B4]
INFO: Cancel the build since no change found
Am I doing something wrong?
Thanks and Best Regards,
Obviously your IAM user also needs the not mentioned sqs:DeleteMessage permission to get it work. Otherwise you will get the wrong error message "User not has permission sqs:DeleteMessageBatch" on test.
This is just a hint.
@phuonghuynh the current version of com.fasterxml.jackson.core:jackson-databind
is getting flagged with a vulnerability. Can you help update it? Thanks!
0005B0 Body of the message:
{ "Records":[
{
"awsRegion":"us-east-1",
"codecommit":{
"references":[{"commit":"7f11f3be165b50cedf920cdb804709af84e621dd","ref":"refs/heads/master"}]
},
"customData":"",
"eventId":"e02cd013-7731-413f-a1de-a3058fffc1f2",
"eventName":"ReferenceChanges",
"eventPartNumber":1,
"eventSource":"aws:codecommit",
"eventSourceARN":"arn:aws:codecommit:us-east-1:MYACCOUNTID:MYREPONAME",
"eventTime":"2017-07-19T06:30:53.404+0000",
"eventTotalParts":1,
"eventTriggerConfigId":"e47f9b31-1347-436c-af84-f0bd89e8fdaf",
"eventTriggerName":"notifications",
"eventVersion":"1.0",
"userIdentityARN":"arn:aws:iam::MYACCOUNTID:user/system/MYUSER"
}]
}
Jul 19, 2017 2:37:23 PM INFO com.ribose.jenkins.plugin.awscodecommittrigger.logging.Log write
0005B0 Job 'MYJOBNAME': test if any event not match by matcher 'ScmJobEventTriggerMatcher'...
Jul 19, 2017 2:37:23 PM INFO com.ribose.jenkins.plugin.awscodecommittrigger.logging.Log write
0005B0 Event(s) did not match job 'MYJOBNAME'
Jul 19, 2017 2:37:23 PM INFO com.ribose.jenkins.plugin.awscodecommittrigger.logging.Log write
0005B0 Job 'MYJOBNAME' matches='false' event(s), ignore message if matches='false'
MYJOBNAME
is configured to subscribe to:
master
and refs/heads/master
but both don't workIf you push a commit to a subscribed repo, but not subscribed branch, it will not trigger any job, but the plugin keeps reading it because it is never deleted.
The plugin should always consume the message from SQS queue (delete it) regardless if it triggers anything.
@ronaldtse The plugin requires SCM to be configured (Git/MultiSCM only for now), we can read value of branches
from Job SCM configuration and use that value to match against CodeCommit Message.
So could we remove this field subscribed_branch?
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.