Merge request build, simple build
Using: jenkins 1.590. gitlab 7.4, jenkins gitlab plugin 1.1.3.
I set up the project as written here(https://github.com/DABSquared/gitlab-plugin#using-it-with-a-job) Jenkins configuration When i clicked "Build now" on jenkins i have some errors:
Started by GitLab push by trillanewhero
Building in workspace /var/lib/jenkins/jobs/test_merge/workspace
> git rev-parse --is-inside-work-tree # timeout=10
Fetching changes from 2 remote Git repositories
> git config remote.${gitlabSourceRepoName}.url ${gitlabSourceRepoURL} # timeout=10
Fetching upstream changes from ${gitlabSourceRepoURL}
> git --version # timeout=10
using GIT_SSH to set credentials gitlab
> git fetch --tags --progress ${gitlabSourceRepoURL} +refs/heads/*:refs/remotes/${gitlabSourceRepoName}/*
ERROR: Error fetching remote repo '${gitlabSourceRepoName}'
ERROR: Error fetching remote repo '${gitlabSourceRepoName}'
Finished: FAILURE
Did you enable the build with parameters check box on the top of the page and set the parameters. It seems this may have been left out of the instructions.

Thank you, it helped. But there are some other errors. After creating new merge request (from fork repo) on gitlab, in jenkins I have two build:
First(SUCCESS):
GitLab Merge Request #36 : develop => master
GitLab Merge Request #36 : develop => master
Building in workspace /var/lib/jenkins/jobs/test_merge/workspace
> git rev-parse --is-inside-work-tree # timeout=10
Fetching changes from 2 remote Git repositories
> git config remote.origin.url git@gitlab:trilla/test_merge.git # timeout=10
Fetching upstream changes from git@gitlab:trilla/test_merge.git
> git --version # timeout=10
using GIT_SSH to set credentials gitlab
> git fetch --tags --progress git@gitlab:trilla/test_merge.git +refs/heads/*:refs/remotes/origin/*
> git config remote.origin.url git@gitlab:trilla/test_merge.git # timeout=10
Fetching upstream changes from git@gitlab:trilla/test_merge.git
using GIT_SSH to set credentials gitlab
> git fetch --tags --progress git@gitlab:trilla/test_merge.git +refs/heads/*:refs/remotes/origin/*
> git rev-parse origin/develop^{commit} # timeout=10
> git rev-parse refs/remotes/${gitlabSourceRepoName}/origin/develop^{commit} # timeout=10
> git rev-parse refs/remotes/origin/develop^{commit} # timeout=10
> git rev-parse refs/remotes/origin/origin/develop^{commit} # timeout=10
Merging Revision 1a821013cecde10a38c212d65a1b266851b11d6f (origin/develop) onto origin/master using default strategy
> git rev-parse origin/master^{commit} # timeout=10
> git config core.sparsecheckout # timeout=10
> git checkout -f origin/master
> git merge 1a821013cecde10a38c212d65a1b266851b11d6f # timeout=10
> git rev-parse HEAD^{commit} # timeout=10
Seen branch in repository goxoxo/test_merge/develop
Seen branch in repository goxoxo/test_merge/master
Seen branch in repository origin/develop
Seen branch in repository origin/master
Seen branch in repository trilla/test_merge/develop
Seen branch in repository trilla/test_merge/master
Seen 6 remote branches
Multiple candidate revisions
Scheduling another build to catch up with test_merge
Checking out Revision 1a821013cecde10a38c212d65a1b266851b11d6f (trilla/test_merge/develop, origin/develop, origin/master)
> git config core.sparsecheckout # timeout=10
> git checkout -f 1a821013cecde10a38c212d65a1b266851b11d6f
> git rev-list 1a821013cecde10a38c212d65a1b266851b11d6f # timeout=10
> git rev-list 1a821013cecde10a38c212d65a1b266851b11d6f # timeout=10
> git rev-list 1a821013cecde10a38c212d65a1b266851b11d6f # timeout=10
Finished: SUCCESS
Second(FAILURE):
Started by an SCM change
Building in workspace /var/lib/jenkins/jobs/test_merge/workspace
> git rev-parse --is-inside-work-tree # timeout=10
Fetching changes from 2 remote Git repositories
> git config remote.${gitlabSourceRepoName}.url ${gitlabSourceRepoURL} # timeout=10
Fetching upstream changes from ${gitlabSourceRepoURL}
> git --version # timeout=10
using GIT_SSH to set credentials gitlab
> git fetch --tags --progress ${gitlabSourceRepoURL} +refs/heads/*:refs/remotes/${gitlabSourceRepoName}/*
ERROR: Error fetching remote repo '${gitlabSourceRepoName}'
ERROR: Error fetching remote repo '${gitlabSourceRepoName}'
Finished: FAILURE
You need to also add the gitlabSourceRepoName variable. In my screen shot I did not because I do not use that feature.
I added a variable gitlabSourceRepoName (with an empty value by default), but errors didn't disappear, they changed:
FIRST(SUCCESS)
GitLab Merge Request #37 : develop => master
GitLab Merge Request #37 : develop => master
Building in workspace /var/lib/jenkins/jobs/test_merge/workspace
> git rev-parse --is-inside-work-tree # timeout=10
Fetching changes from 2 remote Git repositories
> git config remote.origin.url git@gitlab:trilla/test_merge.git # timeout=10
Fetching upstream changes from git@gitlab:trilla/test_merge.git
> git --version # timeout=10
using GIT_SSH to set credentials gitlab
> git fetch --tags --progress git@gitlab:trilla/test_merge.git +refs/heads/*:refs/remotes/origin/*
> git config remote.origin.url git@gitlab:trilla/test_merge.git # timeout=10
Fetching upstream changes from git@gitlab:trilla/test_merge.git
using GIT_SSH to set credentials gitlab
> git fetch --tags --progress git@gitlab:trilla/test_merge.git +refs/heads/*:refs/remotes/origin/*
> git rev-parse origin/develop^{commit} # timeout=10
> git rev-parse refs/remotes/${gitlabSourceRepoName}/origin/develop^{commit} # timeout=10
> git rev-parse refs/remotes/origin/develop^{commit} # timeout=10
> git rev-parse refs/remotes/origin/origin/develop^{commit} # timeout=10
Merging Revision 1a821013cecde10a38c212d65a1b266851b11d6f (origin/develop) onto origin/master using default strategy
> git rev-parse origin/master^{commit} # timeout=10
> git config core.sparsecheckout # timeout=10
> git checkout -f origin/master
> git merge 1a821013cecde10a38c212d65a1b266851b11d6f # timeout=10
> git rev-parse HEAD^{commit} # timeout=10
Seen branch in repository goxoxo/test_merge/develop
Seen branch in repository goxoxo/test_merge/master
Seen branch in repository origin/develop
Seen branch in repository origin/master
Seen branch in repository trilla/test_merge/develop
Seen branch in repository trilla/test_merge/master
Seen 6 remote branches
Multiple candidate revisions
Scheduling another build to catch up with test_merge
Checking out Revision 1a821013cecde10a38c212d65a1b266851b11d6f (origin/develop, trilla/test_merge/develop, origin/master)
> git config core.sparsecheckout # timeout=10
> git checkout -f 1a821013cecde10a38c212d65a1b266851b11d6f
> git rev-list 1a821013cecde10a38c212d65a1b266851b11d6f # timeout=10
> git rev-list 1a821013cecde10a38c212d65a1b266851b11d6f # timeout=10
> git rev-list 1a821013cecde10a38c212d65a1b266851b11d6f # timeout=10
Finished: SUCCESS
SECOND(FAILURE)
Started by an SCM change
Building in workspace /var/lib/jenkins/jobs/test_merge/workspace
FATAL: Invalid refspec refs/remotes//*
java.lang.IllegalArgumentException: Invalid refspec refs/remotes//*
at org.eclipse.jgit.transport.RefSpec.checkValid(RefSpec.java:446)
at org.eclipse.jgit.transport.RefSpec.<init>(RefSpec.java:149)
at hudson.plugins.git.GitSCM.getRefSpecs(GitSCM.java:443)
at hudson.plugins.git.GitSCM.getParamExpandedRepos(GitSCM.java:395)
at hudson.plugins.git.GitSCM.retrieveChanges(GitSCM.java:912)
at hudson.plugins.git.GitSCM.checkout(GitSCM.java:972)
at hudson.scm.SCM.checkout(SCM.java:484)
at hudson.model.AbstractProject.checkout(AbstractProject.java:1259)
at hudson.model.AbstractBuild$AbstractBuildExecution.defaultCheckout(AbstractBuild.java:622)
at jenkins.scm.SCMCheckoutStrategy.checkout(SCMCheckoutStrategy.java:86)
at hudson.model.AbstractBuild$AbstractBuildExecution.run(AbstractBuild.java:528)
at hudson.model.Run.execute(Run.java:1759)
at hudson.model.FreeStyleBuild.run(FreeStyleBuild.java:43)
at hudson.model.ResourceController.execute(ResourceController.java:89)
at hudson.model.Executor.run(Executor.java:240)
I have the same issue. Have you solved this?
@trillanewhero can you check if the issue is solved with the latest release and close this issue?
@trillanewhero closing due to no response. Comment to get this reopened if it is still an issue.
I followed the instruction as in (https://github.com/DABSquared/gitlab-plugin#using-it-with-a-job). But creating merge request in GitLab is not triggering the build. It shows CI build pending. Any help?
@lambertpan did you create a Webhook to trigger your project?