403 Forbidden for Rest API access

2018-05-25 Thread Aoi Kadoya
Hi, 

I have a LDAP account with Admin access to Jenkins and it gets 403 error 
only for REST API accesses.
(I can do everything through Web-UI)

> GET 
/jp-jenkins/job/FOLDER/job/JOB-NAME/304/api/json?tree=result,estimatedDuration 
HTTP/1.1
> Authorization: Basic 
cmFhLXJzX29wczo3NWE1MjE5NjExOGFjMTI5ZTExNGE3NDEyMTMyNWUyNw==
> User-Agent: curl/7.29.0
> Host: 
> Accept: */*
>
< HTTP/1.1 403 Forbidden
< Server: nginx
< Date: Fri, 25 May 2018 19:22:34 GMT
< Content-Type: text/html;charset=utf-8
< Content-Length: 7480
< Connection: close
< X-Content-Type-Options: nosniff
< Set-Cookie: 
JSESSIONID.2303422e=node015vjysep9akuw1gwu2i7dhfp1n4069.node0;Path=/jp-jenkins;HttpOnly
< Expires: 0
< X-You-Are-Authenticated-As: MY-LDAP-USER
< X-You-Are-In-Group-Disabled: JENKINS-39402: use 
-Dhudson.security.AccessDeniedException2.REPORT_GROUP_HEADERS=true or use 
/whoAmI to diagnose
< X-Required-Permission: hudson.model.Hudson.Read
< X-Permission-Implied-By: hudson.security.Permission.GenericRead
< X-Permission-Implied-By: hudson.model.Hudson.Administer
< Cache-Control: no-cache,no-store,must-revalidate
< X-Hudson-Theme: default
< X-Hudson: 1.395
< X-Jenkins: 2.73.3
< X-Jenkins-Session: f21d4522
< X-Hudson-CLI-Port: 5
< X-Jenkins-CLI-Port: 5
< X-Jenkins-CLI2-Port: 5
< X-Frame-Options: sameorigin
< X-Instance-Identity: 
MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAn3UkYxDt4u5EUiFAZDtPQ2hn2cOVDNQIuDhBbskrq38XRJ+4qvfgmKl5zqByuHLtmtdD39VX1C1Q0YPu8/WXkHTlsuHP190To350pGDlpvHgYqbCypcuJ+Ye8FTNcX0BK0vDIGayftatSuH+vc6NxKQsxYLM7h8tBG2RbGh0MUe1dutsWl8rhuOIRgHBFmFzIu9bhVgy9EFg3IOahRmDUeymxpZxeH3TE7dVyv3q21NF8OmrP67VAxgTBv5FVZdjfrce2y9dk1WlPcWjeC4m29bZ5oOgsp7tlyQg2G+M7VI4fSiAWQWuiHo+hS99m5iNuNi+TI+Y8tQPTxIPzEQEhwIDAQAB
< X-SSH-Endpoint: :3000
<

This account was working just fine and it started generating 403 recently 
but we're not sure if it's ldap setting or Jenkins setting.
To debug, we have checked if there is any change or deactivated group in 
LDAP that this user belongs to, but there was none.
Adding this user to Administrator role didn't matter, renewing API token 
didn't matter either.
What would be the issue with this account and how we can fix it?

-- 
You received this message because you are subscribed to the Google Groups 
"Jenkins Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to jenkinsci-users+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/jenkinsci-users/6ace100c-3cb1-4e67-aa73-d5eba721474b%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Need a way to get job configuration data via API

2018-05-25 Thread Sam P
I'm working on finding a way to populate a table in Confluence that will 
show job details including the description, build schedule, etc. There are 
a few scripting macros in confluence that would have made this easier 
however our organization recently disabled said macros and so now I'm left 
with the Confluence "JSON Table Macro". This will allow me to have the 
macro consume a single JSON object representing the table. Unfortunately 
with the native Jenkins API the general idea I've gathered is that you're 
first supposed to get a list of jobs, and then do separate URL calls 
against the resulting list of jobs to get the separate configuration 
information for each job. What I need is a single JSON return result that 
lists the configuration information rather than doing separate calls for 
each job.

I'm not averse to creating a Jenkins plugin to achieve this end, however 
all the documentation I've read regarding the plugins has pointed me to 
search for an existing plugin and/or consult the mailing lists so I figured 
I'd check with the community at large to see if there's a better way to 
approach this. Any insight would be appreciated. Thanks.

Sam

-- 
You received this message because you are subscribed to the Google Groups 
"Jenkins Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to jenkinsci-users+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/jenkinsci-users/ae133588-c093-4d18-b3b2-c6c9f010f611%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: Unlock Jenkins Error - HTTP ERROR 404 - New Bee

2018-05-25 Thread Naresh Manojari
Did you find the solution.even am facing the same situation


On Saturday, 20 August 2016 19:02:12 UTC+5:30, websphere automation wrote:
>
> Hello All,
>
> I am new to Jenkins and I have installed jenkins on Centos using rpm  , it 
> comes up fine and start.
>
> I am able to access jenkins console for first time . 
> http://localhost:8080/jenkins but the first steps looks like to unlock 
> jenkins
>
>
> Unlock Jenkins
>
> To ensure Jenkins is securely set up by the administrator, a password has 
> been written to the log (not sure where to find it? 
> ) and this file on the 
> server:
>
> /var/lib/jenkins/secrets/initialAdminPassword
>
> Please copy the password from either location and paste it below.
> Administrator password
>
> I am copying the password from the file and pasting it there but next page 
> shows below error. I have checked it is not typo , wrong password etc so 
> that is not the case. so I am not sure what is wrong and what are the next 
> steps to fix this.
>
> any help will be appreciated . Thanks
>
> HTTP ERROR 404
>
> Problem accessing /jenkins. Reason:
>
> Not Found
>
> --
> *Powered by Jetty://*
>
>
>
>
>
>
>

-- 
You received this message because you are subscribed to the Google Groups 
"Jenkins Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to jenkinsci-users+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/jenkinsci-users/7ef24cbb-1154-4038-861f-fd9726ffba4f%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: Jenkins multi-instance architecture

2018-05-25 Thread Slide
Why do you want to have it on separate Jenkins instances? It seems like
something you could do with a single Jenkins master and multiple agents as
you already have.

On Fri, May 25, 2018 at 8:22 AM Tomasz Szandała 
wrote:

> Greetings,
>  I am try to scale my Jenkins by splitting the jobs into few, smaller
> Jenkinses.
> The reason: I work in a company that tests software on embedded hardware
> (each device is on slave).
> I'd like to have one prime-master, that gets the requests from user, runs
> pipeline and in pipeline, depends on e.g. node name, it delegates step to
> other Jenkins, dedicated for this case.
>
> I could do it using scripted pipeline, that send http request, but maybe
> there is something better...
>
> --
> You received this message because you are subscribed to the Google Groups
> "Jenkins Users" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to jenkinsci-users+unsubscr...@googlegroups.com.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/jenkinsci-users/9a13a4ef-a786-4918-9d5d-5ce7cb0f0c65%40googlegroups.com
> 
> .
> For more options, visit https://groups.google.com/d/optout.
>

-- 
You received this message because you are subscribed to the Google Groups 
"Jenkins Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to jenkinsci-users+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/jenkinsci-users/CAPiUgVceBtxox2oj3aYm8JDqRsX3En8FmtmTa6cxXOc4gf8QeA%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Jenkins multi-instance architecture

2018-05-25 Thread Tomasz Szandała
Greetings,
 I am try to scale my Jenkins by splitting the jobs into few, smaller 
Jenkinses.
The reason: I work in a company that tests software on embedded hardware 
(each device is on slave).
I'd like to have one prime-master, that gets the requests from user, runs 
pipeline and in pipeline, depends on e.g. node name, it delegates step to 
other Jenkins, dedicated for this case.

I could do it using scripted pipeline, that send http request, but maybe 
there is something better...

-- 
You received this message because you are subscribed to the Google Groups 
"Jenkins Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to jenkinsci-users+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/jenkinsci-users/9a13a4ef-a786-4918-9d5d-5ce7cb0f0c65%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Jenkins plugin list cannot be updated

2018-05-25 Thread Xia Wei


I installed a Jenkins on my laptop, but cannot update the plug-in list. I 
just don't know how to further investigate it.

Here are some information:

   - My laptop have a Windows system.
   - I created a VirtualBox VM with CentOS7 installed.
   - The VM has two network adapters: one is set as NAT (for accessing 
   internet) while the other is set as host only (for me to SSH to that VM). 
   The default route is set on the NAT adapter.
   - I'm working behind my company's proxy so I set proxy information in 
   the 'Advance' tab of Plugin Manager of Jenkins. And when I put '
   https://www.google.com' into 'Test URL' box and click 'Validate Proxy', 
   it shows 'Success' But when I click 'Check now' at the bottom of the page, 
   nothing happened and it always show 'Update information obtained: N/A ago'.
   - I'm able to get the JSON data following the URL in 'Update Site' from 
   my VM with curl (i.e. I'm able to run this command successfully on my VM 
   and get the JSON: curl '
   https://updates.jenkins.io/current/update-center.json')
   - My JRE is the latest one downloaded from Oracle's official site, the 
   version is 1.8.0_171 64-Bit (jre-8u171-linux-x64.rpm).
   - My Jenkins is the latest one downloaded from Jenkins' official site 
   (jenkins-2.107.3-1.1.noarch.rpm)
   
Is there any log of Jenkins that I can check for this issue?

Route on my CentOS:

[root@localhost ~]# ip route
default via 10.0.2.2 dev enp0s3  proto static  metric 100
10.0.2.0/24 dev enp0s3  proto kernel  scope link  src 10.0.2.15  metric 100
192.168.56.0/24 dev enp0s8  proto kernel  scope link  src 192.168.56.80  metric 
100


The server finally displays the following exception:


Caused: javax.net.ssl.SSLException
at sun.security.ssl.Alerts.getSSLException(Unknown Source)
at sun.security.ssl.SSLSocketImpl.fatal(Unknown Source)
at sun.security.ssl.SSLSocketImpl.fatal(Unknown Source)
at sun.security.ssl.SSLSocketImpl.handleException(Unknown Source)
at sun.security.ssl.SSLSocketImpl.handleException(Unknown Source)
at sun.security.ssl.AppInputStream.read(Unknown Source)
at java.io.BufferedInputStream.read1(Unknown Source)
at java.io.BufferedInputStream.read(Unknown Source)
at sun.net.www.MeteredStream.read(Unknown Source)
at java.io.FilterInputStream.read(Unknown Source)
at 
sun.net.www.protocol.http.HttpURLConnection$HttpInputStream.read(Unknown Source)
at sun.nio.cs.StreamDecoder.readBytes(Unknown Source)
at sun.nio.cs.StreamDecoder.implRead(Unknown Source)
at sun.nio.cs.StreamDecoder.read(Unknown Source)
at java.io.InputStreamReader.read(Unknown Source)
at java.io.Reader.read(Unknown Source)
at org.apache.commons.io.IOUtils.copyLarge(IOUtils.java:2001)
at org.apache.commons.io.IOUtils.copyLarge(IOUtils.java:1980)
at org.apache.commons.io.IOUtils.copy(IOUtils.java:1957)
at org.apache.commons.io.IOUtils.copy(IOUtils.java:1907)
at org.apache.commons.io.IOUtils.toString(IOUtils.java:778)
at org.apache.commons.io.IOUtils.toString(IOUtils.java:803)
at hudson.model.DownloadService.loadJSON(DownloadService.java:168)
Caused: javax.net.ssl.SSLException: Connection has been shutdown
at sun.security.ssl.SSLSocketImpl.checkEOF(Unknown Source)
at sun.security.ssl.AppInputStream.available(Unknown Source)
at java.io.BufferedInputStream.available(Unknown Source)
at sun.net.www.MeteredStream.available(Unknown Source)
at sun.net.www.http.KeepAliveStream.close(Unknown Source)
at java.io.FilterInputStream.close(Unknown Source)
at 
sun.net.www.protocol.http.HttpURLConnection$HttpInputStream.close(Unknown 
Source)
at hudson.model.DownloadService.loadJSON(DownloadService.java:176)
java.net.SocketException: Connection reset
at java.net.SocketInputStream.read(Unknown Source)
at java.net.SocketInputStream.read(Unknown Source)
at sun.security.ssl.InputRecord.readFully(Unknown Source)
at sun.security.ssl.InputRecord.readV3Record(Unknown Source)
at sun.security.ssl.InputRecord.read(Unknown Source)
at sun.security.ssl.SSLSocketImpl.readRecord(Unknown Source)
at sun.security.ssl.SSLSocketImpl.readDataRecord(Unknown Source)
at sun.security.ssl.AppInputStream.read(Unknown Source)
at java.io.BufferedInputStream.read1(Unknown Source)
at java.io.BufferedInputStream.read(Unknown Source)
at sun.net.www.MeteredStream.read(Unknown Source)
at java.io.FilterInputStream.read(Unknown Source)
at sun.net.www.protocol.http.HttpURLConnection$HttpInputStream.read(Unknown 
Source)
at sun.nio.cs.StreamDecoder.readBytes(Unknown Source)
at sun.nio.cs.StreamDecoder.implRead(Unknown Source)
at sun.nio.cs.StreamDecoder.read(Unknown Source)
at java.io.InputStreamReader.read(Unknown Source)
at java.io.Reader.read(Unknown Source)
at org.apache.commons.io