openruko / gitmouth

SSH to Git Server for Openruko - Similar to heroku's SSH server
BSD 2-Clause "Simplified" License
19 stars 5 forks source link

Error creating a python project #8

Open srobertson opened 11 years ago

srobertson commented 11 years ago

Slug compilation fails when creating a python project.

How to reproduce:

$ mkdir myproject $ cd myproject $ git init $ ~/openruko/client/openruko create $ echo boto > requirements.txt $ git add -A $ git commit -m "initial commit" $ git push heroku master

Counting objects: 7, done. Delta compression using up to 2 threads. Compressing objects: 100% (3/3), done. Writing objects: 100% (7/7), 525 bytes, done. Total 7 (delta 1), reused 0 (delta 0)

-----> Openruko receiving git push -----> Python app detected remote: rm: cannot remove /app/hooks/.git/branches': Permission denied remote: rm: cannot remove/app/hooks/.git/config': Permission denied remote: rm: cannot remove `/app/hooks/.git/description': Permission denied ... -----> Discovering process types Default process types for Python -> -----> Compiled slug size is 4.0K /tmp/slug.tgz Using slug_id: 1364824011.45576 Uploading: http://openruko.mymachine.me:4567//slugs/21_1364824011.45576.tgz?Expires=1364860011&AWSAccessKeyId=123&Signature=vB%2BhCYMelAhLYC6hbsH9f678cak%3D Uploaded: http://openruko.mymachine.me:4567//slugs/21_1364824011.45576.tgz?Expires=1364860011&AWSAccessKeyId=123&Signature=vB%2BhCYMelAhLYC6hbsH9f678cak%3D -----> Launching... done v 3 http://7d45550ba17723745860986e5eff4e65.mymachine.me/ deployed to Openruko

fatal: protocol error: bad line length character: erro error: error in sideband demultiplexer To git@mymachine.me:7d45550ba17723745860986e5eff4e65.git ! [remote rejected] master -> master (bad pack) error: failed to push some refs to 'git@mymachine.me:7d45550ba17723745860986e5eff4e65.git'

tombh commented 11 years ago

I wouldn't be surprised if this turns out to be a problem in Codonhooks or Dynohost.

progrium commented 11 years ago

Gitmouth should probably have a well defined interface and set of expectations to avoid misfiled issues. I recommend following the interface created by gitreceive [1] ;)

[1] https://github.com/progrium/gitreceive

On Tue, Apr 2, 2013 at 1:55 PM, Thomas Buckley-Houston < notifications@github.com> wrote:

I wouldn't be surprised if this turns out to be a problem in Codonhooks or Dynohost.

— Reply to this email directly or view it on GitHubhttps://github.com/openruko/gitmouth/issues/8#issuecomment-15801948 .

Jeff Lindsay http://progrium.com

natea commented 11 years ago

I'm also interested in trying out OpenRoku for deploying Python/Django apps. Any luck resolving this issue?

Filirom1 commented 11 years ago

Once I have some free time, I will take a look at it.

srobertson commented 11 years ago

Hacking around, I was actually able to get the python build pack to successfully compile the slug. However I broke other things. But at least my debug info might help.

First off this issue probably needs to be moved to apiserver/codon hooks as I think these will be the modules that need to be updated. gitmouth has no issues as far as I can tell.

The problem is because the heroku python buildpack actually moves all the contents of /app to a temporary directory when compiling the slug. See https://github.com/heroku/heroku-buildpack-python/blob/master/bin/compile#L48

Codonhooks treats /app as the root of the git repository when it's receiving the push, due to the above mentioned move it corrupts the git repository and hence you receive these errors when you git push

fatal: protocol error: bad line length character: erro error: error in sideband demultiplexer To git@mymachine.me:7d45550ba17723745860986e5eff4e65.git ! [remote rejected] master -> master (bad pack)

As an experiment I modified apiserver:postgres/openruko_api/functions/handle_git_command.pgsql to mount the empty repo under /tmp/repo and then tweaked codon hooks to mount it's hooks under /tmp/repo/hooks rather than /app/hooks

Making those changes, fixed slug compilation. However actually dyno startup fails now for reasons I have not tracked down yet.

That's as far as I got before I ran out of time. Hopefully this helps someone else who's more familiar with openruko internals.

On Thu, Apr 11, 2013 at 9:00 AM, Nate Aune notifications@github.com wrote:

I'm also interested in trying out OpenRoku for deploying Python/Django apps. Any luck resolving this issue?

— Reply to this email directly or view it on GitHubhttps://github.com/openruko/gitmouth/issues/8#issuecomment-16243817 .

-- Scott

"There was a time when the internet answered all my questions. Now it just repeats them. - SDR"

Filirom1 commented 11 years ago

Thanks for sharing. It will helps

natea commented 11 years ago

@srobertson did you submit that patch as a pull request?

srobertson commented 11 years ago

@natea I hadn't until now.

Here are the changes I made

https://github.com/openruko/apiserver/pull/28 https://github.com/openruko/dynohost/pull/17

Keep in mind, I was only trying to debug the problem, I wouldn't accept those patches "as is"

Filirom1 commented 11 years ago

Ok so it seems that /tmp/repo is needed for slug compilation but /app is needed for running the dyno.

Thanks for the pull requests. It´s quite easy now to fix it