evanlucas / gcr

A node gitlab-ci-runner
MIT License
51 stars 12 forks source link

gcr connection error while registering with gitlab ci #18

Closed dileepkumar06 closed 9 years ago

dileepkumar06 commented 9 years ago

Hi, I am trying to configure a runner for gitlab CI. I have installed the gcr for node and while registering it was showing the following error.

gcr [?] Please enter your GitLab CI url: http://10.188.25.63:7071/ci [?] Please enter your GitLab CI Registration Token: 29cc2f88ba53edb3ce7f gcr http POST http://10.188.25.63:7071/api/v1/runners/register.json gcr http 404 http://10.188.25.63:7071/api/v1/runners/register.json gcr ERR! [client] register runner { status: '404', error: 'Not Found' } gcr ERR! [register] Error: Invalid response gcr ERR! [register] at Request.callback (/root/appinstallables/node-v0.12.0-linux-x64/lib/node_modules/gcr/lib/client.js:79:23) gcr ERR! [register] at Request.self.callback (/root/appinstallables/node-v0.12.0-linux-x64/lib/node_modules/gcr/node_modules/request/request.js:344:22) gcr ERR! [register] at Request.emit (events.js:110:17) gcr ERR! [register] at Request. (/root/appinstallables/node-v0.12.0-linux-x64/lib/node_modules/gcr/node_modules/request/request.js:1239:14) gcr ERR! [register] at Request.emit (events.js:129:20) gcr ERR! [register] at IncomingMessage. (/root/appinstallables/node-v0.12.0-linux-x64/lib/nodemodules/gcr/node_modules/request/request.js:1187:12) gcr ERR! [register] at IncomingMessage.emit (events.js:129:20) gcr ERR! [register] at _stream_readable.js:908:16 gcr ERR! [register] at process._tickCallback (node.js:355:11) gcr ERR! [register] error registering [Error: Invalid response]

Please help me. I don't if this is something related to the configurations that i have done or some other issue. I am able to access the gitlabci on the given url.

but when i am using postman to manualy post a request to gitlab ci, It is accepting the request and generating a token.

Here I can see that the request is getting redirected to http://10.188.25.63:7071/api/v1/runners/register.json instead of http://10.188.25.63:7071/ci/api/v1/runners/register.json

In the gitlab.rb file the external url for ci is configured as http://10.188.25.63:7072. should it be the same as gitlab ?

I am unable to access this in the specified url. But i am able to navigate from gitlab to gitlabci through the UI which is getting redirected to http://10.188.25.63:7071/ci

flipflopsimsommer commented 9 years ago

you parse http://10.188.25.63:7071/ci but get http://10.188.25.63:7071/ try edit your ~/.config/gcr.json file to the right url and delete the token, so you can register again.

update: if you are using gitci version >= 8.0.0 check this out

evanlucas commented 9 years ago

Ah, so >= 8.0.0 adds ci to the url?

evanlucas commented 9 years ago

This should be fixed as of 76636754208d235ef26c893ace891503666f8f20 which was published as v3.0.0 as it is a breaking change. Previously, gcr was using url.resolve which would strip off the /ci from the config url. Please install the latest and try again if you don't mind :]