Got this error message when trying to connect gitlab with drone:
time=“2018-08-13T11:01:24Z” level=error msg=“cannot authenticate user. Error exchanging token. Post http://localhost:30080/oauth/token: dial tcp 127.0.0.1:30080: getsockopt: connection refused”
This is my docker-compose.yml file:
#- DRONE_HOST =http://localhost:30080
#- DRONE_SERVER =ws://localhost/ws/broker
Error exchanging token. Post http://localhost:30080/oauth/token: dial tcp 127.0.0.1:30080: getsockopt: connection refused”
It looks like you have your gitlab server address set to
localhost. This will never work because containers have isolated networks.
localhost refers to the network inside the drone container. You need to deploy gitlab with a proper DNS and then configure Drone to connect to gitlab with DNS.
I have another issue.
Drone without HTTPs is working absolutely fine behind an Apache reverse Proxy.
However, when I want to turn into HTTPs, am having some issues.
I cannot expose port 443 for the outside of the container since 443 is already being used by Apache.
I have tried to do it like 8000:443 but i end up with a proxy error.
More, i have done a test using the following setup
RequestHeader set X-Forwarded-Proto “https” in my vhost, i still get a proxy 502 error. It seems that there is something missing to make it work in HTTPs.
For info, in my broswer, i have the green padlock for my domain name.
Can you please help?
I do not have much experience with Apache, so unfortunately I’m not sure there is much I can do to help. Maybe another community member with Apache experience can provide more details. Also consider posting to StackOverflow where you will have access to Apache subject matter experts.
Thanks @bradrydzewski - i will write to StackOverflow and see the outcome.
One quick question - is it mandatory for Drone to communincate onto 443:443 for SSL?
is it mandatory for Drone to communincate onto 443:443 for SSL?
No, you could do something like 8443:443 for example. However I believe the best practice when using a reverse proxy like Apache would be to terminate SSL at Apache and then forward all traffic to Drone over http. Setting up https for Drone if sitting behind Apache is probably possible, but not something we see people do very often.
I should also point out that Drone has built-in support for TLS so there is really no need to run Apache in front of Drone unless you are using a shared server that is running multiple web applications. http://docs.drone.io/configure-ssl/
Yes I have using a shared server running multiple-applications that’s why I need Apache to sit in front as a reverse proxy.
Am currently trying using 8443 to see if it works. Will let you know in a couple of minutes.
This configuration sounds a bit strange, though. Typically you would terminate SSL at Apache and then forward https traffic to Drone via http. Is there are reason you are not taking this approach?
Also note that Drone does not listen on port 443 inside the container unless you have configured SSL. Have you configured SSL as defined here http://docs.drone.io/configure-ssl/ ?
Yes i have configured the certificate as a volume and as environment settings as well.
This is what I am trying to achieve actually. So basically, I have a vhost listening on port 443 with the SSL path. Then inside my docker-compose, I have set 443: 8000. But since Apache is already listening to port 443, I cannot use the port 443 for my docker. If I try with port 8443:8000 inside my docker-compose, I end up having a proxy GET error.
I have been using/reffering to the online doc to configure so far
this won’t work because port 8000 is reserved for http and will not be able to process https connections. You would need to do something like
-p 8080:80 -p 8443:443 and send https from apache to 8443
So i have done the following:
#- DRONE_SERVER =ws://calhost/ws/broker
and in my Apache virtual host
ProxyPass / https://127.0.0.1:8443/ retry=1 acquire=3000 timeout=600 Keepalive=On
I end up having proxy error.
@bradrydzewski - finally I have been able to make it work in https by killing the TLS on Apache before getting into the container.
However, after authentication on Gitlab, am now having this error:
Client authentication failed due to unknown client, no client authentication included, or unsupported authentication method.
This error message comes from gitlab, so I recommend googling and looking in their documentation/forums to try to understand what causes this error. Maybe look at your gitlab server logs. I have never seen this error before, so I cannot really advise.
@bradrydzewski - i managed to get it working without the hassels of a proxying etc…
However, I made a stupid mistake somewhere while trying to get it on HTTPs. Am trying to revert back my changes but constantly getting
“The redirect URI included is not valid.”
I have strictly follow the drone.io documentation and I could manage to get it work at a point in time without https and now when am trying to rollback my changes to get it work again without https am getting this error.
Note that in Gitlab, for the call back, I have used as pattern “http://10...*/authorize”
Thanks @bradrydzewski - manage to resolve the issue.
but however another issue again.
my current scenarion:
drone running on port 80:8000 without Apache in front.
I can logon via OAuth from gitlab
I get my list of repo
When i click upon to active, i have the error Failed to activate…
inside my docker-compose.yml, I have set for the drone host the public IP of the machine. I have came across a post of yours [SOLVED] Failed to activate your repository? where it mention a similar issue.
However when i check in chrome developer tools, I see a 404 errror on the link http://35...*/api/repos/Ag76/MX (ip here is IP address of drone itself).
Can you please help