Giter VIP home page Giter VIP logo

Comments (24)

bassrock avatar bassrock commented on June 11, 2024

@LaoArchAngel what is the user level of the api key that you used in gitlab?

from gitlab-plugin.

LaoArchAngel avatar LaoArchAngel commented on June 11, 2024

Admin for our GitLab installation. I don't think the user is a member of
some of these projects, but the projects are set to internal, so the user
should be able to discover, clone and fetch. I will try adding the user as
a member of the repositories and report back.

On Thu, Feb 19, 2015 at 11:44 AM, bassrock [email protected] wrote:

@LaoArchAngel https://github.com/LaoArchAngel what is the user level of
the api key that you used in gitlab?


Reply to this email directly or view it on GitHub
#58 (comment)
.

from gitlab-plugin.

LaoArchAngel avatar LaoArchAngel commented on June 11, 2024

I have now tried setting the user as a master of a repository with a jenkins job, changed the API key in global jenkins config to the owner of the gitlab repository (my API key), saved, triggered the build, still empty.

from gitlab-plugin.

bassrock avatar bassrock commented on June 11, 2024

@LaoArchAngel if you look at the gitter chat, it looks like some have reported this an issue with the permissions required by gitlab and it being set to internal.

from gitlab-plugin.

LaoArchAngel avatar LaoArchAngel commented on June 11, 2024

@bassrock Sorry for the late response. I tried changing the project to Public visibility. The branch list is still empty. Read / searched gitter chat, but none of the suggestions there helped.

from gitlab-plugin.

JaSei avatar JaSei commented on June 11, 2024

Hi, I have same problem
Jenkins ver. 1.606 (Windows 7 host)
gitlab GitLab 7.8.4

jenkins user have right's developer (but I try change to master, owner and nothing)
some next ideas what is bad?

thx

from gitlab-plugin.

bassrock avatar bassrock commented on June 11, 2024

@LaoArchAngel or @JaSei can you provide some logs?

from gitlab-plugin.

LaoArchAngel avatar LaoArchAngel commented on June 11, 2024

I may be able to. Can you guide me on where to get the logs you need? Would
I have to change log verbosity somewhere?
On Apr 13, 2015 11:30 AM, "bassrock" [email protected] wrote:

@LaoArchAngel https://github.com/LaoArchAngel or @JaSei
https://github.com/JaSei can you provide some logs?


Reply to this email directly or view it on GitHub
#58 (comment)
.

from gitlab-plugin.

bassrock avatar bassrock commented on June 11, 2024

go to JENKINSHOST/log and create a new logger with a high verbosity level.

from gitlab-plugin.

JaSei avatar JaSei commented on June 11, 2024

In log doesn't nothing on this...
If I open configuration of job - nothing new in log...
If I save configuration of job, then:

ScavengerFeeder2-deploy #100 main build action completed: SUCCESS
Dub 16, 2015 9:01:47 DOP. WARNING org.kohsuke.stapler.RequestImpl$TypePair convertJSON
'stapler-class' is deprecated: hudson.tasks.LogRotator
Dub 16, 2015 9:01:47 DOP. WARNING org.kohsuke.stapler.RequestImpl$TypePair convertJSON
'stapler-class' is deprecated: hudson.plugins.git.extensions.impl.PreBuildMerge
Dub 16, 2015 9:01:47 DOP. WARNING org.kohsuke.stapler.RequestImpl$TypePair convertJSON
'stapler-class' is deprecated: hudson.tasks.Shell
Dub 16, 2015 9:01:47 DOP. WARNING org.kohsuke.stapler.RequestImpl$TypePair convertJSON
'stapler-class' is deprecated: hudson.tasks.Mailer

from gitlab-plugin.

notmandatory avatar notmandatory commented on June 11, 2024

I'm having the same issue. Did anyone find a solution? If you still need logs let me know which ones you need. Thanks!

from gitlab-plugin.

valloq avatar valloq commented on June 11, 2024

Looking for a solution to this as well. This is currently stopping us from specifying a production/deployment build in Jenkins.

from gitlab-plugin.

maiksensi avatar maiksensi commented on June 11, 2024

We are suffering from the same problem. Funny thing though, with one Jenkins (host on Windows) it works, and with one (Linux) it doesnt.

UPDATE: We actually found the problem, which was pretty trivial. We added Jenkins as a reporter, but not with the actual repository but rather with the Project (which contains different repositories). After ading Jenkins as a reporter on the repository it started to work.

from gitlab-plugin.

mirupal avatar mirupal commented on June 11, 2024

Same here.

  • GitLab 6.8.2
  • Jenkins ver. 1.609.1 (Ubuntu 14.04)

from gitlab-plugin.

WonderCsabo avatar WonderCsabo commented on June 11, 2024

I am also experiencing this.

  • GitLab 7.9.2
  • Jenkins ver. 1.609

Edit: I just realized, this feature is not what i am looking for. I want to add a list of disallowed branches. This list supposed to contain the allowed branches. Is there any way to achieve what i want? (Real case: i want to build all branches except master.)

from gitlab-plugin.

klausbayrhammer avatar klausbayrhammer commented on June 11, 2024

Same problem here

Gitlab-Plugin 1.1.16
Jenkins: 1.596.2
Gitlab: 7.9.1

from gitlab-plugin.

klausbayrhammer avatar klausbayrhammer commented on June 11, 2024

Is it possible, that the filtered-branches box only works when using key-based auth? I switched the checkout form username/password to ssh-keys and now it works.

from gitlab-plugin.

 avatar commented on June 11, 2024

Please see if this can be of any help:
http://stackoverflow.com/questions/31339318/jenkins-filter-branches-empty/31341937#31341937

from gitlab-plugin.

amoreno-Cafpower avatar amoreno-Cafpower commented on June 11, 2024

I have the same problem:

Single (non-clustered) Jenkins and GitLab servers.
GitLab v. 7.8.4 (on
Jenkins v. 1.622
GIT client plugin 1.18.0
GIT plugin 2.4.0
GitLab Plugin 1.1.25

In my global Jenkins configuration, I have set the GitLab section as follows:
Gitlab host URL = http://gitlab.our.domain (I have also tried the IP address for all gitlab.our.domain)
API Token = (Set)
Ignose SSL Certificate Errors = (Checked)
Test Connection = Success when clicked

In my project configuration, I have as follows:
GitHub project = http://gitlab.our.domain/GroupName/ProjectName/
Git Repository URL = [email protected]:GroupName/ProjectName.git
Credentials = (none)
Repository browser = gitlab
URL = http://gitlab.our.domain/GroupName/ProjectName
Version = 7.8

Build when a change is pushed to Gitlab. = (Checked)
Build on Push Events = (Checked)
Set build description to build cause = (Checked)
Add note with build status on merge requests = (Checked)
Filter branches = (Blank)

from gitlab-plugin.

joshtkehoe avatar joshtkehoe commented on June 11, 2024

I had this problem as well and here is how I solved it - though it appears that this may be caused by many different things.

I followed the instructions as specified here, but still did not work: http://stackoverflow.com/questions/31339318/jenkins-filter-branches-empty/31341937#31341937

My build's repository URL was using SSH with 'None' selected for Credentials. I changed this to our HTTPS URL with a GitLab user's credentials with a 'Developer' role (though 'Reporter' may also work), and saved the job. I then had to leave the job configuration page and come back and the list was populated.

This may be all most of you need to do, but our preferred method of authentication is SSH, so I next updated the job setting it back to SSH without credentials and saved it. Leaving the job and coming back in shows the box is now empty again, however, looking at the job's config.xml, the branch setting is still selected and is being used. Or, for that matter, you could probably just modify the config.xml directly by updating the <allowedBranches> element (example below).

  <triggers>
    <com.dabsquared.gitlabjenkins.GitLabPushTrigger plugin="[email protected]">
      <spec></spec>
      <triggerOnPush>true</triggerOnPush>
      <triggerOnMergeRequest>false</triggerOnMergeRequest>
      <triggerOpenMergeRequestOnPush>true</triggerOpenMergeRequestOnPush>
      <ciSkip>true</ciSkip>
      <setBuildDescription>true</setBuildDescription>
      <addNoteOnMergeRequest>true</addNoteOnMergeRequest>
      <addVoteOnMergeRequest>true</addVoteOnMergeRequest>
      <allowAllBranches>false</allowAllBranches>
      <allowedBranches>
        <string>trunk</string>
        <string>whatever-branch</string>
      </allowedBranches>
    </com.dabsquared.gitlabjenkins.GitLabPushTrigger>
  </triggers>

from gitlab-plugin.

WonderCsabo avatar WonderCsabo commented on June 11, 2024

After updating to the latest version, there is no selector box, but a textfield. This field accepts a comma-separated list of branches to be built. (Also there is a similar exclude field).
I added my branch, and it says the branch cannot be found, but works regardless.

So i guess this was fixed by e47e81c ?

from gitlab-plugin.

 avatar commented on June 11, 2024

Hi,
As my contribution to this project I'd like to tell the story of my struggle with this problem. I hope that it will help others to handle it.

At the beginning you have to be shure that you properly set your Jenkins user's account token in global settings. This is because plugin uses GitLab REST API to communicate with GitLab.
You can check that the communication is ok by running i.e.:

curl --header "PRIVATE-TOKEN: 9koXpg98eAheJpvBs5tK" "https://gitlab.example.com/api/v3/user" 

If succeed, the plugin can freely use GitLab API.

The plugin to fetch the available branches do not use anything like git branch -a. It uses the API.

While the documentation does not tell explicitly that you can use the project name as an Id, plugin does not yet use /repository/branches. Plugin needs to find out the project Id.

To achieve that plugin fetches list of all projects and tries to find out with is the one. To do this plugin does not use /projects/all. There is called the /projects

At this stage this is very important to properly configure the Jenkins user. It doesn't matter that user has the admin privileges. The project must be accessible by the Jenkins user. User have to be a member of a group or member of the project or project must be public. And this is probably the place you failed.

To see the list of projects accessible by the user try:

curl --header "PRIVATE-TOKEN: 9koXpg98eAheJpvBs5tK" "https://gitlab.example.com/api/v3/projects"` 

The next step is to find the project. It seems that the only information available to distinguish the projects is the source repository url. So pugin compares the ssh_url_to_repo and http_url_to_repo fields from project object with the source repository url. This must be the exact match. And this is probably the place you failed.

For example if you uses only VPN for SSH connections, and you have to place the IP address as source repository url it will fail.

Few examples that works with git but not with a plugin:

And finally after then plugin uses the project id to call /repository/branches

I hope that this was helpful.

CC: @LaoArchAngel @JaSei @stevemyers @valloq @mirupal @WonderCsabo @klausbayrhammer @amorenopl @joshtkehoe

from gitlab-plugin.

 avatar commented on June 11, 2024

@omehegan: I was going to write a fix for this issue... ;)

from gitlab-plugin.

omehegan avatar omehegan commented on June 11, 2024

@pwl89 oh, I thought it was fixed already. If not, I will reopen.

from gitlab-plugin.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.