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

jenkins::job does not work when authentication is enabled #259

Closed
Xylakant opened this issue Mar 25, 2015 · 1 comment
Closed

jenkins::job does not work when authentication is enabled #259

Xylakant opened this issue Mar 25, 2015 · 1 comment

Comments

@Xylakant
Copy link

the auth parameter is ignored for jenkins::cli::cmd which is used by jenkins::job::present.

@v1v
Copy link
Contributor

v1v commented Apr 13, 2015

I don't know if this is related to. But I've got some issues too when I run the below configuration:

# -----------------------------------------------------------------------------
class jenkins_king::ess_jobs ()  {
  jenkins::job { 'ess_dolores':
    config => template('jenkins_king/ess_dolores-job.xml.erb'),
  }
}
root@jenkins-dummy:~# puppet agent -t
Info: Retrieving pluginfacts
Info: Retrieving plugin
Info: Loading facts
Info: Caching catalog for jenkins-dummy
Info: Applying configuration version '1428922631'
Notice: /Stage[main]/Jenkins::Cli/Exec[jenkins-cli]/returns: executed successfully
Notice: /Stage[main]/Jenkins_king::Ess_jobs/Jenkins::Job[ess_dolores]/Jenkins::Job::Present[ess_dolores]/File[/tmp/ess_dolores-config.xml]/ensure: defined content as '{md5}5884756141886772b2d1aa91696fd404'
Error: cat /tmp/ess_dolores-config.xml | java -jar /usr/share/jenkins/jenkins-cli.jar -s http://localhost:8080 update-job ess_dolores returned 255 instead of one of [0]
Error: /Stage[main]/Jenkins_king::Ess_jobs/Jenkins::Job[ess_dolores]/Jenkins::Job::Present[ess_dolores]/Exec[jenkins update-job ess_dolores]/returns: change from notrun to 0 failed: cat /tmp/ess_dolores-config.xml | java -jar /usr/share/jenkins/jenkins-cli.jar -s http://localhost:8080 update-job ess_dolores returned 255 instead of one of [0]
Notice: /Stage[main]/Jenkins::Cli/Exec[reload-jenkins]: Dependency Exec[jenkins update-job ess_dolores] has failures: true
Warning: /Stage[main]/Jenkins::Cli/Exec[reload-jenkins]: Skipping because of failed dependencies
Notice: /Stage[main]/Jenkins_king::Ess_jobs/Jenkins::Job[ess_dolores]/Jenkins::Job::Present[ess_dolores]/Exec[jenkins enable-job ess_dolores]: Dependency Exec[jenkins update-job ess_dolores] has failures: true
Warning: /Stage[main]/Jenkins_king::Ess_jobs/Jenkins::Job[ess_dolores]/Jenkins::Job::Present[ess_dolores]/Exec[jenkins enable-job ess_dolores]: Skipping because of failed dependencies
Notice: Finished catalog run in 36.88 seconds
root@jenkins-dummy:/var/lib/jenkins# cat /tmp/ess_dolores-config.xml | java -jar /usr/share/jenkins/jenkins-cli.jar -s http://localhost:8080 update-job ess_dolores
hudson.security.AccessDeniedException2: anonymous is missing the Job/Configure permission
    at hudson.security.ACL.checkPermission(ACL.java:55)
    at hudson.model.AbstractItem.checkPermission(AbstractItem.java:476)
    at hudson.model.AbstractItem.updateByXml(AbstractItem.java:619)
    at hudson.cli.UpdateJobCommand.run(UpdateJobCommand.java:47)
    at hudson.cli.CLICommand.main(CLICommand.java:234)
    at hudson.cli.CliManagerImpl.main(CliManagerImpl.java:92)
    at sun.reflect.GeneratedMethodAccessor385.invoke(Unknown Source)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
    at java.lang.reflect.Method.invoke(Method.java:606)
    at hudson.remoting.RemoteInvocationHandler$RPCRequest.perform(RemoteInvocationHandler.java:309)
    at hudson.remoting.RemoteInvocationHandler$RPCRequest.call(RemoteInvocationHandler.java:290)
    at hudson.remoting.RemoteInvocationHandler$RPCRequest.call(RemoteInvocationHandler.java:249)
    at hudson.remoting.UserRequest.perform(UserRequest.java:118)
    at hudson.remoting.UserRequest.perform(UserRequest.java:48)
    at hudson.remoting.Request$2.run(Request.java:328)
    at hudson.remoting.InterceptingExecutorService$1.call(InterceptingExecutorService.java:72)
    at hudson.cli.CliManagerImpl$1.call(CliManagerImpl.java:63)
    at hudson.remoting.InterceptingExecutorService$2.call(InterceptingExecutorService.java:95)
    at jenkins.util.ContextResettingExecutorService$2.call(ContextResettingExecutorService.java:46)
    at java.util.concurrent.FutureTask.run(FutureTask.java:262)
    at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145)
    at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615)
    at java.lang.Thread.run(Thread.java:745)

I've already tried with two different approaches:

Let me know if you need further details.

Thanks.

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

3 participants