Re: [go-cd] Help me on this!!! Not able to connect Go-Agent from Go-Server.

2017-10-06 Thread Ketan Padegaonkar
What go server URL have you configured with the agent?

On Sat, Oct 7, 2017, 12:26 AM  wrote:

> I just started with gocd and I am trying to connect agent to server.  I am
> running into the same issue you ran into (log pasted below).
> I am using ec2 instances for both server and agent.  I tried start agent
> on the same host as the server first, which was failing with the same error.
> So, I tried starting agent on different ec2, still getting the same error.
>
> I also tried the suggestion of removing keystore and restarting the server.
> I didnot find guid.txt or agent.jks in /var/lib/go-agent folder or its
> subfolder.
>
> Since this thread is an year old, so I thought of checking if you were
> able to find any resolution.
>
> 2017-10-05 21:52:31,885 ERROR [main] ServerBinaryDownloader:80 - Couldn't
> update admin/agent-launcher.jar. Sleeping for 1m. Error:
> javax.net.ssl.SSLException: Unrecognized SSL message, plaintext connection?
> at
> sun.security.ssl.InputRecord.handleUnknownRecord(InputRecord.java:710)
> at sun.security.ssl.InputRecord.read(InputRecord.java:527)
> at
> sun.security.ssl.SSLSocketImpl.readRecord(SSLSocketImpl.java:983)
> at
> sun.security.ssl.SSLSocketImpl.performInitialHandshake(SSLSocketImpl.java:1385)
> at
> sun.security.ssl.SSLSocketImpl.startHandshake(SSLSocketImpl.java:1413)
> at
> sun.security.ssl.SSLSocketImpl.startHandshake(SSLSocketImpl.java:1397)
> at
> org.apache.http.conn.ssl.SSLConnectionSocketFactory.createLayeredSocket(SSLConnectionSocketFactory.java:394)
> at
> org.apache.http.conn.ssl.SSLConnectionSocketFactory.connectSocket(SSLConnectionSocketFactory.java:353)
> at
> org.apache.http.impl.conn.DefaultHttpClientConnectionOperator.connect(DefaultHttpClientConnectionOperator.java:141)
> at
> org.apache.http.impl.conn.PoolingHttpClientConnectionManager.connect(PoolingHttpClientConnectionManager.java:353)
> at
> org.apache.http.impl.execchain.MainClientExec.establishRoute(MainClientExec.java:380)
> at
> org.apache.http.impl.execchain.MainClientExec.execute(MainClientExec.java:236)
> at
> org.apache.http.impl.execchain.ProtocolExec.execute(ProtocolExec.java:184)
> at
> org.apache.http.impl.execchain.RetryExec.execute(RetryExec.java:88)
> at
> org.apache.http.impl.execchain.RedirectExec.execute(RedirectExec.java:110)
> at
> org.apache.http.impl.client.InternalHttpClient.doExecute(InternalHttpClient.java:184)
> at
> org.apache.http.impl.client.CloseableHttpClient.execute(CloseableHttpClient.java:82)
> at
> org.apache.http.impl.client.CloseableHttpClient.execute(CloseableHttpClient.java:107)
> at
> com.thoughtworks.go.agent.launcher.ServerBinaryDownloader.fetchUpdateCheckHeaders(ServerBinaryDownloader.java:96)
> at
> com.thoughtworks.go.agent.launcher.ServerBinaryDownloader.downloadIfNecessary(ServerBinaryDownloader.java:72)
> at
> com.thoughtworks.go.agent.launcher.AgentLauncherImpl.launch(AgentLauncherImpl.java:79)
> at
> com.thoughtworks.go.agent.bootstrapper.AgentBootstrapper.go(AgentBootstrapper.java:84)
> at
> com.thoughtworks.go.agent.bootstrapper.AgentBootstrapper.main(AgentBootstrapper.java:65)
> at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
> at
> sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
> at
> sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
> at java.lang.reflect.Method.invoke(Method.java:498)
> at com.thoughtworks.gocd.Boot.run(Boot.java:58)
> at com.thoughtworks.gocd.Boot.main(Boot.java:42)
>
> Thank You,
> Ranjith
>
> --
> You received this message because you are subscribed to the Google Groups
> "go-cd" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to go-cd+unsubscr...@googlegroups.com.
> For more options, visit https://groups.google.com/d/optout.
>

-- 
You received this message because you are subscribed to the Google Groups 
"go-cd" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to go-cd+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[go-cd] Help me on this!!! Not able to connect Go-Agent from Go-Server.

2017-10-06 Thread m . kalaranjith
I just started with gocd and I am trying to connect agent to server.  I am 
running into the same issue you ran into (log pasted below).
I am using ec2 instances for both server and agent.  I tried start agent on 
the same host as the server first, which was failing with the same error.
So, I tried starting agent on different ec2, still getting the same error.

I also tried the suggestion of removing keystore and restarting the server.
I didnot find guid.txt or agent.jks in /var/lib/go-agent folder or its 
subfolder.

Since this thread is an year old, so I thought of checking if you were able 
to find any resolution.

2017-10-05 21:52:31,885 ERROR [main] ServerBinaryDownloader:80 - Couldn't 
update admin/agent-launcher.jar. Sleeping for 1m. Error:
javax.net.ssl.SSLException: Unrecognized SSL message, plaintext connection?
at 
sun.security.ssl.InputRecord.handleUnknownRecord(InputRecord.java:710)
at sun.security.ssl.InputRecord.read(InputRecord.java:527)
at sun.security.ssl.SSLSocketImpl.readRecord(SSLSocketImpl.java:983)
at 
sun.security.ssl.SSLSocketImpl.performInitialHandshake(SSLSocketImpl.java:1385)
at 
sun.security.ssl.SSLSocketImpl.startHandshake(SSLSocketImpl.java:1413)
at 
sun.security.ssl.SSLSocketImpl.startHandshake(SSLSocketImpl.java:1397)
at 
org.apache.http.conn.ssl.SSLConnectionSocketFactory.createLayeredSocket(SSLConnectionSocketFactory.java:394)
at 
org.apache.http.conn.ssl.SSLConnectionSocketFactory.connectSocket(SSLConnectionSocketFactory.java:353)
at 
org.apache.http.impl.conn.DefaultHttpClientConnectionOperator.connect(DefaultHttpClientConnectionOperator.java:141)
at 
org.apache.http.impl.conn.PoolingHttpClientConnectionManager.connect(PoolingHttpClientConnectionManager.java:353)
at 
org.apache.http.impl.execchain.MainClientExec.establishRoute(MainClientExec.java:380)
at 
org.apache.http.impl.execchain.MainClientExec.execute(MainClientExec.java:236)
at 
org.apache.http.impl.execchain.ProtocolExec.execute(ProtocolExec.java:184)
at 
org.apache.http.impl.execchain.RetryExec.execute(RetryExec.java:88)
at 
org.apache.http.impl.execchain.RedirectExec.execute(RedirectExec.java:110)
at 
org.apache.http.impl.client.InternalHttpClient.doExecute(InternalHttpClient.java:184)
at 
org.apache.http.impl.client.CloseableHttpClient.execute(CloseableHttpClient.java:82)
at 
org.apache.http.impl.client.CloseableHttpClient.execute(CloseableHttpClient.java:107)
at 
com.thoughtworks.go.agent.launcher.ServerBinaryDownloader.fetchUpdateCheckHeaders(ServerBinaryDownloader.java:96)
at 
com.thoughtworks.go.agent.launcher.ServerBinaryDownloader.downloadIfNecessary(ServerBinaryDownloader.java:72)
at 
com.thoughtworks.go.agent.launcher.AgentLauncherImpl.launch(AgentLauncherImpl.java:79)
at 
com.thoughtworks.go.agent.bootstrapper.AgentBootstrapper.go(AgentBootstrapper.java:84)
at 
com.thoughtworks.go.agent.bootstrapper.AgentBootstrapper.main(AgentBootstrapper.java:65)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at 
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at 
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:498)
at com.thoughtworks.gocd.Boot.run(Boot.java:58)
at com.thoughtworks.gocd.Boot.main(Boot.java:42)

Thank You,
Ranjith

-- 
You received this message because you are subscribed to the Google Groups 
"go-cd" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to go-cd+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: [go-cd] Re: Looking for helping debugging a custom authorization plugin

2017-10-06 Thread Chris Northwood
Hi there,

The problem was essentially that my plugin was returning an empty Map to
go.cd.authorization.authenticate-user (which as far as I can tell, is what
you should do if authentication failed, the documentation isn't clear on
this flow), which results in that error message.

The reason authentication was failing in my plugin was because it couldn't
read the headers as discussed above. Hopefully this helps you.

Chris

On 6 October 2017 at 05:28,  wrote:

> The issue#3784  was fixed in
> GoCD release https://www.gocd.org/releases/#17-9-0. GoCD version 17.9.0
> or above will pass request headers to the plugin.
>
>
> On Friday, October 6, 2017 at 1:11:01 AM UTC+5:30,
> ddor...@thoughtworks.com wrote:
>>
>> I'm having a similar problem, were you able to resolve this?
>>
>> On Thursday, July 6, 2017 at 3:39:03 AM UTC-7, Chris Northwood wrote:
>>>
>>> Hi,
>>>
>>> I'm the maintainer of the TLS client auth plugin, and I'm trying to move
>>> it to the new authorization plugin model, but I'm having some difficulty
>>> doing so. I think I've implemented what I need, but Go gives me an error
>>> when I try to log in:
>>>
>>> No AuthenticationProvider found for com.thoughtworks.go.server.sec
>>> urity.tokens.PreAuthenticatedAuthenticationToken Help Topic:
>>> Authentication
>>> 
>>>
>>> Which I'm not sure how to debug. I also get an error in my logs which
>>> I'll include below
>>>
>>> The approach I'm taking is:
>>>
>>> * Do it as a web plugin
>>> * Put Go behind Apache which terminates SSL and adds headers
>>> corresponding to the subject and verification status of the client
>>> certificate
>>> * Instead of using the URL of an external provider, it redirects
>>> directly to the Go app (https://github.com/cnorthwood
>>> /gocd-tls-auth/blob/master/src/main/java/uk/me/cjn/gocd_
>>> tls_auth/TlsAuthorizationPlugin.java#L135), and then uses the headers
>>> Apache has added to get the "tokens" (https://github.com/cnorthwood
>>> /gocd-tls-auth/blob/master/src/main/java/uk/me/cjn/gocd_
>>> tls_auth/TlsAuthorizationPlugin.java#L122)
>>> * Parse the certificate detail in the headers to get the user info:
>>> https://github.com/cnorthwood/gocd-tls-auth/blob/maste
>>> r/src/main/java/uk/me/cjn/gocd_tls_auth/TlsAuthorizationPlugin.java#L162
>>>
>>> If anyone can help me debug that error, or figure out where in my
>>> workflow I'm falling down, that'd be useful.
>>>
>>> Thanks,
>>>
>>> Chris Northwood
>>>
>>> 2017-07-06 10:30:23,195 ERROR [qtp1177096266-26]
>>> BasicAuthenticationFilter:62 - java.lang.IllegalStateException:
>>> Committed
>>>
>>> 2017-07-06 10:30:23,195  WARN [qtp1177096266-26] ServletHandler:628 -
>>> /go/plugin/tls-auth/login
>>>
>>> java.lang.IllegalStateException: Committed
>>>
>>> at org.eclipse.jetty.server.Response.resetBuffer(Response.java:1242)
>>>
>>> at javax.servlet.ServletResponseWrapper.resetBuffer(ServletResp
>>> onseWrapper.java:241)
>>>
>>> at org.eclipse.jetty.servlets.gzip.CompressedResponseWrapper.re
>>> setBuffer(CompressedResponseWrapper.java:272)
>>>
>>> at org.eclipse.jetty.servlets.gzip.CompressedResponseWrapper.se
>>> ndRedirect(CompressedResponseWrapper.java:308)
>>>
>>> at javax.servlet.http.HttpServletResponseWrapper.sendRedirect(H
>>> ttpServletResponseWrapper.java:176)
>>>
>>> at org.springframework.security.context.HttpSessionContextInteg
>>> rationFilter$OnRedirectUpdateSessionResponseWrapper.
>>> sendRedirect(HttpSessionContextIntegrationFilter.java:507)
>>>
>>> at com.thoughtworks.go.server.security.BasicAuthenticationFilte
>>> r.handleException(BasicAuthenticationFilter.java:76)
>>>
>>> at com.thoughtworks.go.server.security.BasicAuthenticationFilte
>>> r.doFilterHttp(BasicAuthenticationFilter.java:64)
>>>
>>> at org.springframework.security.ui.SpringSecurityFilter.doFilte
>>> r(SpringSecurityFilter.java:53)
>>>
>>> at org.springframework.security.util.FilterChainProxy$VirtualFi
>>> lterChain.doFilter(FilterChainProxy.java:371)
>>>
>>> at org.springframework.security.ui.AbstractProcessingFilter.doF
>>> ilterHttp(AbstractProcessingFilter.java:271)
>>>
>>> at org.springframework.security.ui.SpringSecurityFilter.doFilte
>>> r(SpringSecurityFilter.java:53)
>>>
>>> at org.springframework.security.util.FilterChainProxy$VirtualFi
>>> lterChain.doFilter(FilterChainProxy.java:371)
>>>
>>> at com.thoughtworks.go.server.security.WebBasedAuthenticationFi
>>> lter.doFilterHttp(WebBasedAuthenticationFilter.java:57)
>>>
>>> at org.springframework.security.ui.SpringSecurityFilter.doFilte
>>> r(SpringSecurityFilter.java:53)
>>>
>>> at org.springframework.security.util.FilterChainProxy$VirtualFi
>>> lterChain.doFilter(FilterChainProxy.java:371)
>>>
>>> at com.thoughtworks.go.server.security.OauthAuthenticationFilte
>>> r.doFilterHttp(OauthAuthenticationFilter.java:65)
>>>
>>> at org.springframework.security.ui.SpringSecurityFilter.doFilte