Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Trigger fails if gitlab user does not have access to project #276

Closed
pyther opened this issue Apr 28, 2016 · 3 comments
Closed

Trigger fails if gitlab user does not have access to project #276

pyther opened this issue Apr 28, 2016 · 3 comments

Comments

@pyther
Copy link

pyther commented Apr 28, 2016

I have a gitlab user named jenkins. This users API key is set under Manage Jenkins -> Configuration System -> API Token.

I have two projects, website/olcf and website/ncrc. The jenkins (gitlab) user has access to website/olcf only. I can replicate the problem if I remove my jenkins (gitlab) user from the website/olcf project.

When I push a commit to the website/olcf git project, a build is triggered. The build status is not updated in gitlab, but I believe that is a separate issue.

192.168.1.208 - - [28/Apr/2016:09:12:22 -0400] "POST /project/website/olcf HTTP/1.1" 200 - "-" "-"

However when I push a commit to the website/ncrc project, no build is triggered.

192.168.1.208 - - [28/Apr/2016:14:31:22 -0400] "POST /project/website/ncrc HTTP/1.1" 500 13093 "-" "-"

In jenkins.log I see this traceback

Apr 28, 2016 2:34:10 PM com.dabsquared.gitlabjenkins.GitLabWebHook getDynamic
INFO: WebHook called with url: /ncrc
Apr 28, 2016 2:34:10 PM org.eclipse.jetty.util.log.JavaUtilLog warn
WARNING: Error while serving https://jenkins2.ccs.ornl.gov/project/website/ncrc
java.lang.reflect.InvocationTargetException
        at sun.reflect.GeneratedMethodAccessor420.invoke(Unknown Source)
        at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
        at java.lang.reflect.Method.invoke(Method.java:497)
        at org.kohsuke.stapler.Function$InstanceFunction.invoke(Function.java:320)
        at org.kohsuke.stapler.Function.bindAndInvoke(Function.java:163)
        at org.kohsuke.stapler.MetaClass$11.dispatch(MetaClass.java:378)
        at org.kohsuke.stapler.Stapler.tryInvoke(Stapler.java:746)
        at org.kohsuke.stapler.Stapler.invoke(Stapler.java:876)
        at org.kohsuke.stapler.MetaClass$11.dispatch(MetaClass.java:380)
        at org.kohsuke.stapler.Stapler.tryInvoke(Stapler.java:746)
        at org.kohsuke.stapler.Stapler.invoke(Stapler.java:876)
        at org.kohsuke.stapler.Stapler.invoke(Stapler.java:649)
        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:812)
        at org.eclipse.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1669)
        at hudson.util.PluginServletFilter$1.doFilter(PluginServletFilter.java:135)
        at hudson.util.PluginServletFilter.doFilter(PluginServletFilter.java:126)
        at org.eclipse.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1652)
        at hudson.security.csrf.CrumbFilter.doFilter(CrumbFilter.java:49)
        at org.eclipse.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1652)
        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:76)
        at hudson.security.HudsonFilter.doFilter(HudsonFilter.java:171)
        at org.eclipse.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1652)
        at org.kohsuke.stapler.compression.CompressionFilter.doFilter(CompressionFilter.java:49)
        at org.eclipse.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1652)
        at hudson.util.CharacterEncodingFilter.doFilter(CharacterEncodingFilter.java:81)
        at org.eclipse.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1652)
        at org.kohsuke.stapler.DiagnosticThreadNameFilter.doFilter(DiagnosticThreadNameFilter.java:30)
        at org.eclipse.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1652)
        at org.eclipse.jetty.servlet.ServletHandler.doHandle(ServletHandler.java:585)
        at org.eclipse.jetty.server.handler.ScopedHandler.handle(ScopedHandler.java:143)
        at org.eclipse.jetty.security.SecurityHandler.handle(SecurityHandler.java:553)
        at org.eclipse.jetty.server.session.SessionHandler.doHandle(SessionHandler.java:223)
        at org.eclipse.jetty.server.handler.ContextHandler.doHandle(ContextHandler.java:1127)
        at org.eclipse.jetty.servlet.ServletHandler.doScope(ServletHandler.java:515)
        at org.eclipse.jetty.server.session.SessionHandler.doScope(SessionHandler.java:185)
        at org.eclipse.jetty.server.handler.ContextHandler.doScope(ContextHandler.java:1061)
        at org.eclipse.jetty.server.handler.ScopedHandler.handle(ScopedHandler.java:141)
        at org.eclipse.jetty.server.handler.HandlerWrapper.handle(HandlerWrapper.java:97)
        at org.eclipse.jetty.server.Server.handle(Server.java:499)
        at org.eclipse.jetty.server.HttpChannel.handle(HttpChannel.java:311)
        at org.eclipse.jetty.server.HttpConnection.onFillable(HttpConnection.java:257)
        at org.eclipse.jetty.io.AbstractConnection$2.run(AbstractConnection.java:544)
        at winstone.BoundedExecutorService$1.run(BoundedExecutorService.java:77)
        at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
        at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
        at java.lang.Thread.run(Thread.java:745)
Caused by: net.sf.json.JSONException: A JSONObject text must begin with '{' at character 0 of 
        at net.sf.json.util.JSONTokener.syntaxError(JSONTokener.java:499)
        at net.sf.json.JSONObject._fromJSONTokener(JSONObject.java:919)
        at net.sf.json.JSONObject._fromString(JSONObject.java:1145)
        at net.sf.json.JSONObject.fromObject(JSONObject.java:162)
        at net.sf.json.JSONObject.fromObject(JSONObject.java:132)
        at com.dabsquared.gitlabjenkins.GitLabWebHook.generateBuild(GitLabWebHook.java:330)
        at com.dabsquared.gitlabjenkins.GitLabWebHook.getDynamic(GitLabWebHook.java:146)
        ... 64 more
@coder-hugo
Copy link
Contributor

According to the stacktrace you are using an older version of the plugin. Line 330 of GitLabWebHook doesn't exist anymore in version 1.2.0. Please update to this version and try it again. If you still get an error add a Logger for "com.dabsquared.gitlabjenkins" in your Jenkins and paste its content here.

@pyther
Copy link
Author

pyther commented Apr 28, 2016

I'll try to update, but I'm using workflow and if I understand #271 correctly, the 1.2.0 doesn't work with workflows.

@pyther
Copy link
Author

pyther commented Apr 29, 2016

1.2.0 appears to fix this issue, but I am using Jenkins 2.0 and I'm hitting bug #272

@pyther pyther closed this as completed Apr 29, 2016
exceed-alae pushed a commit to exceed-alae/gitlab-plugin that referenced this issue May 20, 2022
update 'githubPullRequest' to 'pullRequest' in Job DSL section of README
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants