Also be aware, loglevel 10 might dump sensitive info in the master log
(secrets, etc.).  Be sure to obfuscate
any information along the lines as needed when you pass it along to us.

On Thu, Aug 24, 2017 at 10:57 AM, Gabe Montero <gmont...@redhat.com> wrote:

> Hey Thorvald,
>
> Running your openshift master at loglevel 10 should include the payload of
> the webhook POST request when it arrives.
> Also, if there were any errors parsing the request, that would show up in
> the log as well.
>
> Go ahead and tag me (@gabemontero) when you open the issue and we'll go
> from there.
>
> thanks!
>
> On Thu, Aug 24, 2017 at 4:25 AM, Thorvald Hallvardsson <
> thorvald.hallvards...@gmail.com> wrote:
>
>> Hi Gabe,
>>
>> I'm more than happy to report that as an issue. If you could only tell me
>> how can I grab the content of the gitlab push event that would be great.
>>
>> Thanks!
>> TH
>>
>> On 23 August 2017 at 16:33, Gabe Montero <gmont...@redhat.com> wrote:
>>
>>>
>>>
>>> On Wed, Aug 23, 2017 at 8:52 AM, Thorvald Hallvardsson <
>>> thorvald.hallvards...@gmail.com> wrote:
>>>
>>>> Hi Ben,
>>>>
>>>> Name:           nodejs-pipeline-master
>>>> Namespace:      jenkins
>>>> Created:        5 days ago
>>>> Labels:         app=nodejs-integration
>>>> Annotations:    pipeline.alpha.openshift.io/uses=[{
>>>> <http://pipeline.alpha.openshift.io/uses=%5B%7B>"name": "nodejsci",
>>>> "namespace": "", "kind": "DeploymentConfig"}]
>>>> Latest Version: 3
>>>>
>>>> Strategy:               JenkinsPipeline
>>>> URL:                    http://gitlab.os.hr4.local/je
>>>> nkins/nodejs-ex-1.git
>>>> Ref:                    manual
>>>> Jenkinsfile path:       Jenkinsfile
>>>>
>>>> Build Run Policy:       Serial
>>>> Triggered by:           <none>
>>>> Webhook GitHub:
>>>>         URL:    https://master.hr4.local:8443
>>>> /oapi/v1/namespaces/jenkins/buildconfigs/nodejs-pipeline-mas
>>>> ter/webhooks/EgXVqyOOobmMzjVzQHSh/github
>>>> Webhook Generic:
>>>>         URL:            https://master.hr4.local:8443
>>>> /oapi/v1/namespaces/jenkins/buildconfigs/nodejs-pipeline-mas
>>>> ter/webhooks/bz6uJc9u-0-58EoYKgL3/generic
>>>>         AllowEnv:       false
>>>>
>>>> Build                           Status  Duration        Creation Time
>>>> nodejs-pipeline-master-3        failed  1s              2017-08-18
>>>> 09:27:00 +0100 BST
>>>> nodejs-pipeline-master-2        failed  1s              2017-08-18
>>>> 09:18:46 +0100 BST
>>>> nodejs-pipeline-master-1        failed  1m2s            2017-08-18
>>>> 09:16:19 +0100 BST
>>>>
>>>> No events.
>>>>
>>>> JSON:
>>>> {
>>>>     "kind": "BuildConfig",
>>>>     "apiVersion": "v1",
>>>>     "metadata": {
>>>>         "name": "nodejs-pipeline-master",
>>>>         "creationTimestamp": null,
>>>>         "labels": {
>>>>             "app": "nodejs-integration"
>>>>         },
>>>>         "annotations": {
>>>>             "pipeline.alpha.openshift.io/uses": "[{\"name\":
>>>> \"nodejsci\", \"namespace\": \"\", \"kind\": \"DeploymentConfig\"}]"
>>>>         }
>>>>     },
>>>>     "spec": {
>>>>         "triggers": [
>>>>             {
>>>>                 "type": "GitHub",
>>>>                 "github": {
>>>>                     "secret": "EgXVqyOOobmMzjVzQHSh"
>>>>                 }
>>>>             },
>>>>             {
>>>>                 "type": "Generic",
>>>>                 "generic": {
>>>>                     "secret": "bz6uJc9u-0-58EoYKgL3"
>>>>                 }
>>>>             }
>>>>         ],
>>>>         "runPolicy": "Serial",
>>>>         "source": {
>>>>             "type": "Git",
>>>>             "git": {
>>>>                 "uri": "http://gitlab.os.hr4.local/je
>>>> nkins/nodejs-ex-1.git",
>>>>                 "ref": "manual"
>>>>             }
>>>>         },
>>>>         "strategy": {
>>>>             "type": "JenkinsPipeline",
>>>>             "jenkinsPipelineStrategy": {
>>>>                 "jenkinsfilePath": "Jenkinsfile"
>>>>             }
>>>>         },
>>>>         "output": {},
>>>>         "resources": {},
>>>>         "postCommit": {},
>>>>         "nodeSelector": {}
>>>>     },
>>>>     "status": {
>>>>         "lastVersion": 0
>>>>     }
>>>> }
>>>>
>>>> Failed build:
>>>> Name:           nodejs-pipeline-master-3
>>>> Namespace:      jenkins
>>>> Created:        5 days ago
>>>> Labels:         app=nodejs-integration
>>>>                 buildconfig=nodejs-pipeline-master
>>>>                 openshift.io/build-config.name=nodejs-pipeline-master
>>>>                 openshift.io/build.start-policy=Serial
>>>> Annotations:    openshift.io/build-config.name=nodejs-pipeline-master
>>>>                 openshift.io/build.number=3
>>>>                 openshift.io/jenkins-build-uri
>>>> =https://jenkins-jenkins.os.hr4.local/job/jenkins-nodejs-pip
>>>> eline-master/3/
>>>>                 openshift.io/jenkins-console-l
>>>> og-url=https://jenkins-jenkins.os.hr4.local/job/jenkins-node
>>>> js-pipeline-master/3/console
>>>>                 openshift.io/jenkins-log-url=h
>>>> ttps://jenkins-jenkins.os.hr4.local/job/jenkins-nodejs-pipel
>>>> ine-master/3/consoleText
>>>>                 openshift.io/jenkins-status-json={
>>>> <http://openshift.io/jenkins-status-json=%7B>"_links":{"self":{"href":"
>>>> https://jenkins-jenkins.os.hr4.local/job/jenkins-nodejs-pipe
>>>> line-master/3/wfapi/describe"}},"id":"3","name":"#3","status
>>>> ":"NOT_EXECUTED","startTimeMillis":1503044820755,"endTimeMil
>>>> lis":0,"durationMillis":0,"queueDurationMillis":0,"pauseDura
>>>> tionMillis":0,"stages":[]}
>>>>
>>>> Status:         Failed
>>>> Started:        Fri, 18 Aug 2017 09:27:00 BST
>>>> Duration:       1s
>>>> Build Config:   nodejs-pipeline-master
>>>> Build Pod:      nodejs-pipeline-master-3-build
>>>>
>>>> Strategy:               JenkinsPipeline
>>>> URL:                    http://gitlab.os.hr4.local/je
>>>> nkins/nodejs-ex-1.git
>>>> Ref:                    manual
>>>> Commit:                  ()
>>>> Jenkinsfile path:       Jenkinsfile
>>>>
>>>> Build trigger cause:    GitHub WebHook
>>>> Commit:                  ()
>>>> Secret:                 EgXVqyOOob***
>>>>
>>>> No events.
>>>>
>>>>
>>>> JSON:
>>>> {
>>>>     "kind": "Build",
>>>>     "apiVersion": "v1",
>>>>     "metadata": {
>>>>         "name": "nodejs-pipeline-master-3",
>>>>         "creationTimestamp": null,
>>>>         "labels": {
>>>>             "app": "nodejs-integration",
>>>>             "buildconfig": "nodejs-pipeline-master",
>>>>             "openshift.io/build-config.name": "nodejs-pipeline-master",
>>>>             "openshift.io/build.start-policy": "Serial"
>>>>         },
>>>>         "annotations": {
>>>>             "openshift.io/build-config.name": "nodejs-pipeline-master",
>>>>             "openshift.io/build.number": "3",
>>>>             "openshift.io/jenkins-build-uri": "
>>>> https://jenkins-jenkins.os.hr4.local/job/jenkins-nodejs-pip
>>>> eline-master/3/",
>>>>             "openshift.io/jenkins-console-log-url": "
>>>> https://jenkins-jenkins.os.hr4.local/job/jenkins-nodejs-pip
>>>> eline-master/3/console",
>>>>             "openshift.io/jenkins-log-url": "
>>>> https://jenkins-jenkins.os.hr4.local/job/jenkins-nodejs-pip
>>>> eline-master/3/consoleText",
>>>>             "openshift.io/jenkins-status-json":
>>>> "{\"_links\":{\"self\":{\"href\":\"https://jenkins-jenkins.o
>>>> s.hr4.local/job/jenkins-nodejs-pipeline-master/3/wfapi/describe\
>>>> "}},\"id\":\"3\",\"name\":\"#3\",\"status\":\"NOT_
>>>> EXECUTED\",\"startTimeMillis\":1503044820755,\"endTimeMillis
>>>> \":0,\"durationMillis\":0,\"queueDurationMillis\":0,\"paus
>>>> eDurationMillis\":0,\"stages\":[]}"
>>>>         }
>>>>     },
>>>>     "spec": {
>>>>         "serviceAccount": "builder",
>>>>         "source": {
>>>>             "type": "Git",
>>>>             "git": {
>>>>                 "uri": "http://gitlab.os.hr4.local/je
>>>> nkins/nodejs-ex-1.git",
>>>>                 "ref": "manual"
>>>>             }
>>>>         },
>>>>         "revision": {
>>>>             "type": "Git",
>>>>             "git": {
>>>>                 "author": {},
>>>>                 "committer": {}
>>>>             }
>>>>         },
>>>>         "strategy": {
>>>>             "type": "JenkinsPipeline",
>>>>             "jenkinsPipelineStrategy": {
>>>>                 "jenkinsfilePath": "Jenkinsfile"
>>>>             }
>>>>         },
>>>>         "output": {},
>>>>         "resources": {},
>>>>         "postCommit": {},
>>>>         "nodeSelector": {},
>>>>         "triggeredBy": [
>>>>             {
>>>>                 "message": "GitHub WebHook",
>>>>                 "githubWebHook": {
>>>>                     "revision": {
>>>>                         "type": "Git",
>>>>                         "git": {
>>>>                             "author": {},
>>>>                             "committer": {}
>>>>                         }
>>>>                     },
>>>>
>>>
>>> OK, the above snippet is the crux of things here, and lines up with the
>>> stack trace you are seeing on the jenkins side.  Essentially, the commit is
>>> not getting retrieved from the gitlab webhook push event.
>>>
>>> At this point, you should probably open an issue at
>>> https://github.com/openshift/origin and we can continue debug /
>>> resolution there.  Among
>>> other things, if you could somehow get the contents of the gitlab push
>>> event json, that would be the most expedient means of determining what is
>>> up.
>>>
>>> Per the gitlab spec/version we are working off of, we would expect a
>>> push event to look something like https://github.com/openshift/o
>>> rigin/blob/master/pkg/build/webhook/gitlab/testdata/pusheven
>>> t-not-master-branch.json
>>>
>>> thanks
>>>
>>>
>>>>                     "secret": "EgXVqyOOob***"
>>>>                 }
>>>>             }
>>>>         ]
>>>>     },
>>>>     "status": {
>>>>         "phase": "New",
>>>>         "config": {
>>>>             "name": "nodejs-pipeline-master"
>>>>         },
>>>>         "output": {}
>>>>     }
>>>> }
>>>>
>>>> Thank you!
>>>>
>>>>
>>>> On 22 August 2017 at 15:27, Ben Parees <bpar...@redhat.com> wrote:
>>>>
>>>>>
>>>>>
>>>>> On Tue, Aug 22, 2017 at 10:25 AM, Gabe Montero <gmont...@redhat.com>
>>>>> wrote:
>>>>>
>>>>>>
>>>>>>
>>>>>> On Mon, Aug 21, 2017 at 8:08 AM, Thorvald Hallvardsson <
>>>>>> thorvald.hallvards...@gmail.com> wrote:
>>>>>>
>>>>>>> Hi Ben,
>>>>>>>
>>>>>>> yes you got right understanding of my problem.
>>>>>>>
>>>>>>> There is no build associated yet, as it doesn't even get to the
>>>>>>> stage when it would fireup any build for the pipeline. It's literally a
>>>>>>> scond after sending the build task to Jenkins....
>>>>>>>
>>>>>>
>>>>>> To tweak Ben's request slightly, can you provide the *buildconfig*
>>>>>> json.  The precise structure of the gitlab webhook will most likely be
>>>>>> helpful for us, especially
>>>>>> in comparison to the gitlab specs  and what the git plugin is
>>>>>> spitting out.
>>>>>>
>>>>>
>>>>> Well, both the buildconfig and build.  What I want to see in the build
>>>>> object is what the revision information shows.  The gitlab webhook should
>>>>> have provided revision information to openshift which should have put that
>>>>> information into the BuildRequest which would have lead to that 
>>>>> information
>>>>> being part of the Build object.
>>>>>
>>>>> Assuming it's there, the next question is how the pipeline job in
>>>>> jenkins is intended to consume that revision information when cloning the
>>>>> repo to extract the Jenkinsfile.
>>>>>
>>>>> Since we have two sources of git revision information in the build
>>>>> object, it's possible that one of them is being ignored by the sync 
>>>>> plugin.
>>>>>
>>>>> Thorvald, can you provide the buildconfig and build json from your
>>>>> openshift environment?
>>>>>
>>>>>
>>>>>
>>>>>>
>>>>>>> OpenShift version is 3.5. Jenkins sync plugin is 0.1.25.
>>>>>>>
>>>>>>> Regards,
>>>>>>> TH
>>>>>>>
>>>>>>>
>>>>>>> On 18 August 2017 at 21:56, Ben Parees <bpar...@redhat.com> wrote:
>>>>>>>
>>>>>>>>
>>>>>>>>
>>>>>>>> On Fri, Aug 18, 2017 at 4:39 AM, Thorvald Hallvardsson <
>>>>>>>> thorvald.hallvards...@gmail.com> wrote:
>>>>>>>>
>>>>>>>>> Hi,
>>>>>>>>>
>>>>>>>>> I configured Gitlab webhook for my test pipeline to fire up a
>>>>>>>>> build. The problem is as soon as I commit something jenkins complains 
>>>>>>>>> with
>>>>>>>>> an error below:
>>>>>>>>>
>>>>>>>>
>>>>>>>> To make sure i understand your scenario, you've defined a pipeline
>>>>>>>> buildconfig in openshift and enabled a gitlab webhook trigger to 
>>>>>>>> trigger
>>>>>>>> the build?  (vs defining a gitlab trigger in jenkins itself).
>>>>>>>>
>>>>>>>>
>>>>>>>>
>>>>>>>>>
>>>>>>>>> OpenShift Build jenkins/nodejs-pipeline-master-3 from
>>>>>>>>> http://gitlab.os.hr4.local/jenkins/nodejs-ex-1.git
>>>>>>>>> Checking out git http://gitlab.os.hr4.local/jen
>>>>>>>>> kins/nodejs-ex-1.git to read Jenkinsfile
>>>>>>>>>  > git rev-parse --is-inside-work-tree # timeout=10
>>>>>>>>> Fetching changes from the remote Git repository
>>>>>>>>>  > git config remote.origin.url http://gitlab.os.hr4.local/jen
>>>>>>>>> kins/nodejs-ex-1.git # timeout=10
>>>>>>>>> Fetching upstream changes from http://gitlab.os.hr4.local/jen
>>>>>>>>> kins/nodejs-ex-1.git
>>>>>>>>>  > git --version # timeout=10
>>>>>>>>>  > git fetch --tags --progress http://gitlab.os.hr4.local/jen
>>>>>>>>> kins/nodejs-ex-1.git +refs/heads/*:refs/remotes/origin/*
>>>>>>>>>  > git rev-parse null^{commit} # timeout=10
>>>>>>>>> hudson.plugins.git.GitException: Command "git rev-parse
>>>>>>>>> null^{commit}" returned status code 128:
>>>>>>>>> stdout: null^{commit}
>>>>>>>>>
>>>>>>>>> stderr: fatal: ambiguous argument 'null^{commit}': unknown
>>>>>>>>> revision or path not in the working tree.
>>>>>>>>> Use '--' to separate paths from revisions, like this:
>>>>>>>>> 'git <command> [<revision>...] -- [<file>...]'
>>>>>>>>>
>>>>>>>>> at org.jenkinsci.plugins.gitclient.CliGitAPIImpl.launchCommandI
>>>>>>>>> n(CliGitAPIImpl.java:1799)
>>>>>>>>> at org.jenkinsci.plugins.gitclient.CliGitAPIImpl.launchCommandI
>>>>>>>>> n(CliGitAPIImpl.java:1772)
>>>>>>>>> at org.jenkinsci.plugins.gitclient.CliGitAPIImpl.launchCommandI
>>>>>>>>> n(CliGitAPIImpl.java:1768)
>>>>>>>>> at org.jenkinsci.plugins.gitclient.CliGitAPIImpl.launchCommand(
>>>>>>>>> CliGitAPIImpl.java:1415)
>>>>>>>>> at org.jenkinsci.plugins.gitclient.CliGitAPIImpl.launchCommand(
>>>>>>>>> CliGitAPIImpl.java:1427)
>>>>>>>>> at org.jenkinsci.plugins.gitclient.CliGitAPIImpl.revParse(CliGi
>>>>>>>>> tAPIImpl.java:686)
>>>>>>>>> at hudson.plugins.git.GitAPI.revParse(GitAPI.java:316)
>>>>>>>>> at hudson.plugins.git.RevisionParameterAction.toRevision(Revisi
>>>>>>>>> onParameterAction.java:98)
>>>>>>>>> at hudson.plugins.git.GitSCM.determineRevisionToBuild(GitSCM.ja
>>>>>>>>> va:991)
>>>>>>>>> at hudson.plugins.git.GitSCM.checkout(GitSCM.java:1108)
>>>>>>>>> at org.jenkinsci.plugins.workflow.steps.scm.SCMStep.checkout(SC
>>>>>>>>> MStep.java:109)
>>>>>>>>> at org.jenkinsci.plugins.workflow.cps.CpsScmFlowDefinition.crea
>>>>>>>>> te(CpsScmFlowDefinition.java:130)
>>>>>>>>> at org.jenkinsci.plugins.workflow.cps.CpsScmFlowDefinition.crea
>>>>>>>>> te(CpsScmFlowDefinition.java:59)
>>>>>>>>> at org.jenkinsci.plugins.workflow.job.WorkflowRun.run(WorkflowR
>>>>>>>>> un.java:232)
>>>>>>>>> at hudson.model.ResourceController.execute(ResourceController.j
>>>>>>>>> ava:97)
>>>>>>>>> at hudson.model.Executor.run(Executor.java:405)
>>>>>>>>> Finished: FAILURE
>>>>>>>>>
>>>>>>>>> It works when I take generic webhook URL however it engages a
>>>>>>>>> build regardless of which branch I'm commiting the change to - which 
>>>>>>>>> is no
>>>>>>>>> ideal.
>>>>>>>>>
>>>>>>>>> Any ideas why commit number in the code above is null ?
>>>>>>>>>
>>>>>>>>
>>>>>>>> can you share the build json associated w/ the build that was
>>>>>>>> kicked off by the webhook trigger?
>>>>>>>>
>>>>>>>> also what version of the openshift sync plugin are you running and
>>>>>>>> what version is your openshift cluster?
>>>>>>>>
>>>>>>>>
>>>>>>>>
>>>>>>>>
>>>>>>>>>
>>>>>>>>> Thanks
>>>>>>>>> TH
>>>>>>>>>
>>>>>>>>> _______________________________________________
>>>>>>>>> users mailing list
>>>>>>>>> users@lists.openshift.redhat.com
>>>>>>>>> http://lists.openshift.redhat.com/openshiftmm/listinfo/users
>>>>>>>>>
>>>>>>>>>
>>>>>>>>
>>>>>>>>
>>>>>>>> --
>>>>>>>> Ben Parees | OpenShift
>>>>>>>>
>>>>>>>>
>>>>>>>
>>>>>>> _______________________________________________
>>>>>>> users mailing list
>>>>>>> users@lists.openshift.redhat.com
>>>>>>> http://lists.openshift.redhat.com/openshiftmm/listinfo/users
>>>>>>>
>>>>>>>
>>>>>>
>>>>>
>>>>>
>>>>> --
>>>>> Ben Parees | OpenShift
>>>>>
>>>>>
>>>>
>>>
>>
>
_______________________________________________
users mailing list
users@lists.openshift.redhat.com
http://lists.openshift.redhat.com/openshiftmm/listinfo/users

Reply via email to