Strider-CD / strider

Open Source Continuous Integration & Deployment Server
http://strider-cd.github.io/
4.59k stars 432 forks source link

how to manually override strider git fetch/pull #966

Open abbood opened 7 years ago

abbood commented 7 years ago

I have taken over a project that uses strider to

however currently strider is stuck here:

$ git fetch github 784ms -1
error: refs/heads/master does not point to a valid object!
error: refs/remotes/origin/150-employee-filters does not point to a valid object!
error: refs/remotes/origin/158-234-delete-event does not point to a valid object!
error: refs/remotes/origin/190-document-request-hr-direct-notif does not point to a valid object!

.. (truncated)

error: refs/remotes/origin/validation-old-data does not point to a valid object!
error: refs/tags/v2.0.0 does not point to a valid object!
remote: Repository not found.
fatal: repository 'https://92a661bb3eac5c545d09db093643250#####:@github.com/my-repo/my-project.git/' not found
$ git reset --hard origin/master github 8ms -1
$  -1
An unexpected error occurred while executing this job. Please report at https://github.com/Strider-CD/strider/issues

Git pull failed with code 128

Error: Git pull failed with code 128
    at badCode (/home/ubuntu/strider/node_modules/strider-git/worker.js:90:11)
    at updateCache (/home/ubuntu/strider/node_modules/strider-git/worker.js:154:19)
    at ChildProcess.<anonymous> (/home/ubuntu/strider/node_modules/strider-runner-core/lib/job.js:203:9)
    at emitTwo (events.js:100:13)
    at ChildProcess.emit (events.js:185:7)
    at Process.ChildProcess._handle.onexit (internal/child_process.js:200:12)

i have access to the server that's running strider.. how do I manually override this job and do the git fetch trouble shootoing myself.. then restart strider?

oliversalzburg commented 7 years ago

I would first try clearing the project cache through the web UI. If that fails, you can go into the .strider/data directory of the user that runs Strider and check the local repository.

abbood commented 7 years ago

@oliversalzburg:

~/.strider/data/my-project-name-57977338ad69ec767c8dbbdb

and that's it.. what should i do now?

oliversalzburg commented 7 years ago

Did you run another build after clearing the cache? The directory should contain the cloned repo, if I'm not mistaken

abbood commented 7 years ago

yes i did clear the cache then immediately rebuild and deploy.. same git error:

$ git clone --recursive https://[username]:[password]@github.com/Mokus-io/beneple.git . --branch master github 851ms -1
Cloning into '.'...
remote: Repository not found.
fatal: repository 'https://92a661bb3eac5c545d09db093643250936ffc990:@github.com/Mokus-io/beneple.git/' not found
$  -1
An unexpected error occurred while executing this job. Please report at https://github.com/Strider-CD/strider/issues

Git clone failed with code 128

Error: Git clone failed with code 128
    at badCode (/home/ubuntu/strider/node_modules/strider-git/worker.js:90:11)
    at updateCache (/home/ubuntu/strider/node_modules/strider-git/worker.js:154:19)
    at ChildProcess.<anonymous> (/home/ubuntu/strider/node_modules/strider-runner-core/lib/job.js:203:9)
    at emitTwo (events.js:100:13)
    at ChildProcess.emit (events.js:185:7)
    at Process.ChildProcess._handle.onexit (internal/child_process.js:200:12)
knownasilya commented 7 years ago

What happens if you do the clone outside of Strider but on the same box/account?

abbood commented 7 years ago

if i do a git clone without putting username/pwd like so:

git clone --recursive https://my-project.git

it simply prompts me for my username/pwd.. and obviously if i include my username/pwd in the command like so

git clone --recursive https://username:pwd@my-project.git

it works like a charm.

my question is: in this command

$ git clone --recursive https://[username]:[password]@github.com/Mokus-io/beneple.git . --branch master github 851ms -1

does the username/pwd actually replaced by the real username/pwd?

oliversalzburg commented 7 years ago

Well, the problem is already at the remote: Repository not found.. Either the repo was actually moved, or the access key Strider is using is not valid. Check https://github.com/Mokus-io/beneple/settings/keys and replace or add the public key of the Strider project.

knownasilya commented 7 years ago

does the username/pwd actually replaced by the real username/pwd?

Yes, it's just "blurred" so it's not visible in the logs.

abbood commented 7 years ago

odd.. there are no deploy keys in https://github.com/Mokus-io/beneple/settings/keys.. thing is this project was handed over to me without me being able to know what the original authors had in mind.. ok lemme see now..

abbood commented 7 years ago

it didn't work.. i created a new deploy key at github and got the public key from my strider:

mokus-io beneple config - strider brilliant continuous deployment 2016-07-26 21-57-18 png 2016-07-26 21-58-31

deploy keys 2016-07-26 21-59-37

than i reployed.. same git error

knownasilya commented 7 years ago

I would delete the project and re-add it, if that's possible.

abbood commented 7 years ago

@knownasilya it definitely is.. but now i'm wondering what other steps are missing.. for example i was checking out this github integration tutorial and i see that i got no github oAth app registered.. so i guess it's safe to delete everything and start from scratch eh? (ie by following the instructions on that page?)

knownasilya commented 7 years ago

Yes, that should setup your Github settings properly.

abbood commented 7 years ago

one last cheat question.. in my beneple repo root directory i have this strider.json file:

{
    "merge_plugins": true,
    "plugins": [
        {
            "id": "custom",
            "enabled": true,
            "showStatus": true,
            "config": {
                "prepare": "docker build -t beneple/beneple:latest -t beneple/beneple:$(git rev-parse HEAD) .",
                "test": "docker run --link beneple_db:db --rm beneple/beneple:$(git rev-parse HEAD) sh -c \"venv/bin/coverage run ./manage.py test && venv/bin/coverage report\"",
                "deploy": "bash +e -c 'docker stop beneple_strider; docker rm beneple_strider; docker run --link beneple_db:db -p 80:8000 --restart=always --name=beneple_strider -d beneple/beneple:$(git rev-parse HEAD)'",
                "cleanup": "bash -c 'if [[ $(docker ps -a -f status=exited -q) ]] ; then docker rm $(docker ps -a -f status=exited -q); fi; if [[ $(docker images -f dangling=true -q) ]]; then docker rmi $(docker images -q); fi;'"
            }
        }
    ]
}

when i just setup my new github repo.. it asked what kind of project it is and i said it's python.. so now the test script simply runs

pip install -r requirements.txt

to prepare it and

python setup.py test

to test it.. obviously this isn't the case.. how do i instruct strider to run the commands in this strider.json file?

knownasilya commented 7 years ago

Disable the python plugin in the "Plugins" config.

abbood commented 7 years ago

yeah ok? but now no script is run when i push a new commit/branch

screen shot 2016-07-27 at 8 33 03 am

oliversalzburg commented 7 years ago

If you want to run the command mentioned in your previous post, enable the Python plugin. The custom commands should be run regardless (that's what merge_plugins is for). If they aren't run, it's likely that the custom plugin is not installed. The grey status in Strider is usually some pretty fatal error. A look at the Strider logs would be interesting.

xgalen commented 6 years ago

@abbood is this issue still happening or did you fix it?