Closed kfatehi closed 8 years ago
+1 Any news on this?
:+1: it would be cool if someone checks this error
@Dids @leutrimhusaj do you guys see the same errors? Are you using the hosted gitlab or community edition? What version of gitlab? What version of strider and this plugin, and strider-gitlab plugin.
@knownasilya yep i'm getting the same error Community Edition GitLab 7.7.1 strider 1.6.0-pre.2 strider-gitlab 1.0.5
@leutrimhusaj can you update strider to latest (1.6.3) and give it a try (most likely wont fix it, but worth ruling things out).
@knownasilya tried it out but it doesn't work :/
@knownasilya i'm using strider and gitlab in two docker containers, does it make a difference?
@knownasilya you had time to have a look at this issue?
@leutrimhusaj nope, but if you have them in two docker containers, you need to link them somehow, so that strider has access to the gitlab server..
@knownasilya which one? the strider and gitlab-docker, or the strider-docker-slave and the gitlab-docker? But the error only appears when i use the strider-docker-slave...the standard-runner works, even when the containers are not linked...the sources are checked out just via the url.
I'm running into this issue too. And I changed some code to debug.
/data/strider/data/yangchengwei-strider-demo-55b5ffcb0ce1df3f0529223d
strider-docker-runner/lib/create-container.js
to not kill the container, so I can check if it did git clone ...
into that container.However, after I enter into the container(docker exec -it /data/strider/data/yangchengwei-strider-demo-55b5ffcb0ce1df3f0529223d
where the following git checkout
was trying to work in.
So I'm wondering if git clone
running in the container started by strider-docker-runner
?
update: I found that it did run some commands in the strider-docker-slave container started by strider-docker-runner, however, seems the gitlab clone code
doesn't run in container? See below logs:
strider stdout | 2015-07-28T01:41:44.720Z - info: Tue, 28 Jul 2015 01:41:44 GMT strider-docker-runner:create-container image is already locally
strider stdout | 2015-07-28T01:41:45.055Z - info: Tue, 28 Jul 2015 01:41:45 GMT strider-docker-runner:create-container [runner:docker] container id 7706a19783e46d1d25a0f302bf627df6f9d1e433ce16f5bae24d40e1500e08ed
strider stdout | 2015-07-28T01:41:45.224Z - info: Tue, 28 Jul 2015 01:41:45 GMT strider-docker-runner:create-container running command sh
strider stdout | 2015-07-28T01:41:45.224Z - info: Tue, 28 Jul 2015 01:41:45 GMT strider-docker-runner:create-container with args [ '-e', '-x', '-c', 'env' ]
strider stdout | 2015-07-28T01:41:45.459Z - info: Tue, 28 Jul 2015 01:41:45 GMT strider-docker-runner:create-container got an event { event: 'stdout',
data: 'MAIL=/var/mail/strider\nUSER=strider\nHOSTNAME=7706a19783e4\nSHLVL=1\nHOME=/home/strider\nLOGNAME=strider\n_=/usr/local/bin/strider-docker-slave\nPATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games\nSHELL=/bin/bash\nPWD=/home/strider/workspace\n' }
strider stdout | 2015-07-28T01:41:45.461Z - info: Tue, 28 Jul 2015 01:41:45 GMT strider-docker-runner:create-container got an event { event: 'stderr', data: '+ env\n' }
strider stdout | 2015-07-28T01:41:45.464Z - info: Tue, 28 Jul 2015 01:41:45 GMT strider-docker-runner:create-container got an event { code: 0, event: 'exit' }
strider stdout | 2015-07-28T01:41:45.582Z - info: Git Version:1.9
strider stdout | 2015-07-28T01:41:48.661Z - info: Job 55b6ddd79814ac2c00b7efaf gitlab gitane command done git clone --recursive ssh://git@gitlab.localdomain:10022/yangchengwei/demo.git . --branch master; exit code 0; duration 3179
strider stdout | 2015-07-28T01:41:48.681Z - info: Tue, 28 Jul 2015 01:41:48 GMT strider-docker-runner:create-container running command git
strider stdout | 2015-07-28T01:41:48.681Z - info: Tue, 28 Jul 2015 01:41:48 GMT strider-docker-runner:create-container with args [ 'checkout', '--quiet', '--force', 'master' ]
strider stdout | 2015-07-28T01:41:48.687Z - info: Tue, 28 Jul 2015 01:41:48 GMT strider-docker-runner:create-container got an event { event: 'stderr',
data: 'fatal: Not a git repository (or any of the parent directories): .git\n' }
Thanks for trying to dig into this. I'm not seeing how the logs show that it's not run in the container.
Ah, the environment variables..
I have the same error, I'm using docker + gitlab and the strider/strider-docker-slave image
prepare -1
$ git clone --recursive ssh://git@chev.com:2222/root/ci-sample.git . --branch master gitlab 690ms -1
Cloning into '.'...
$ git checkout --quiet --force master gitlab 18ms -1
fatal: Not a git repository (or any of the parent directories): .git
I did some research on this topic: Initial "git clone" is not executed inside the docker container - as someone mentioned before. Source is cloned to "/home/strider/.strider/data/[job-id]/" (i think mainly, because it uses gitane for ssh checkout, with a different process/spawn context). The following git checkout is executed via the context.cmd function, which is inside the docker container (directory is /home/strider/workspace). Inside the gitaneCmd function context.runCmd is used to set the spawn function for gitane.run, but context.runCmd is undefined in this context.
same error here, but seems to be a problem with private repos.
Seems to be related with https://github.com/Strider-CD/strider-docker-runner/issues/36#issuecomment-162159044
Hi,
git checkout via ssh is currently not working with strider-docker-runner. The reasons for that: In strider-git lib/index.js context.runCmd is passed to gitane as spawn function, but context.runCmd is undefined in this context. Even if it may contain the spawn function from config, it would not work, because the config.spawn API and nodejs spawn API differs. I created a solution, but it requires some packages to be changed:
How to test: In a running strider installation, go to the main strider directory and execute:
# npm dedupe strider-git
# npm dedupe strider-runner-core
# npm install chriz2600/strider-docker-gitane-camo
# npm install chriz2600/strider-git
# npm install chriz2600/strider-runner-core
Restart strider. Setup a project either via 'Manual add' (be sure to choose SSH for 'Repository Authentication') or via gitlab integration. Be sure to choose 'chriz2600/strider-docker-slave' as docker image in 'Runner: Docker' configuration.
Currently the main drawback is, that context.cmd could not be set to 'silent' when invoking, so your ssh private key is shown in build output.
Links: https://github.com/chriz2600/strider-docker-gitane-camo https://github.com/chriz2600/strider-git https://github.com/chriz2600/strider-runner-core https://github.com/chriz2600/strider-docker-slave
@chriz2600 feel free to submit PRs where ever you see necessary.
@chriz2600 what's the status on this issue?
Currently it's just running fine, the only downside still is that the ssh key is visible in the build log.
No changes were necessary to this repo?
The changes made on Dec 9, 2015 should do the job.
Ah, so everything that was changed was in other repos, ok.
@chriz2600 @knownasilya this issue still persists. I reinstalled everything fresh using the latest versions of everything. I think its because the latest release or runner core is outdated: https://github.com/Strider-CD/strider-runner-core/releases
Working on updating that https://github.com/Strider-CD/strider-runner-core/issues/13
@mandoz I published 2.0.1 or runner-core, can you try again?
@knownasilya that fixed it! Thank you very much :)
ive been trying to debug this for awhile -- it's not leading me anywhere fruitful. im thinking @jaredly maybe you'll be able to push me in the right direction on this one. I'm resorting to testing outside of docker for now.