Server tries to pull from old git repo on deployment

11 views
Skip to first unread message

chris

unread,
Apr 23, 2009, 9:18:04 AM4/23/09
to Capistrano
I recently renamed my github account and have been having problems
since. For some reason when I run the cap deploy command the remote
server continues to make calls to old github address.

The old account name no longer exists any where within the project and
I am able to make committals to the remote git server with no issues.

Thanks for the help.

$ cap deploy
* executing `deploy'
* executing `deploy:update'
** transaction: start
* executing `deploy:update_code'
updating the cached checkout on all servers
executing locally: "git ls-remote g...@github.com:greenstem/
NEW_SERVER.git master"
* executing "if [ -d /var/rails/NEW_SERVER/shared/cached-copy ];
then cd /var/rails/NEW_SERVER/shared/cached-copy && git fetch origin
&& git reset --hard 904c8b690ea51115bbcc89dfcb24d67f6963c7b4; else
git clone g...@github.com:greenstem/NEW_SERVER.git /var/rails/
NEW_SERVER/shared/cached-copy && cd /var/rails/NEW_SERVER/shared/
cached-copy && git checkout -b deploy
904c8b690ea51115bbcc89dfcb24d67f6963c7b4; fi"
servers: ["lixx-xx.members.linode.com"]
[lixx-xx.members.linode.com] executing command
** [lixx-xx.members.linode.com :: out] Repository not found. If
you've just created it, please try again in a few seconds.
** [lixx-xx.members.linode.com :: out] fatal: unexpected EOF
** [lixx-xx.members.linode.com :: out] Fetch failure:
g...@github.com:OLD_SERVER/NEW_SERVER.git
** [lixx-xx.members.linode.com :: out] Repository not found. If
you've just created it, please try again in a few seconds.
** [lixx-xx.members.linode.com :: out] fatal:
** [lixx-xx.members.linode.com :: out] unexpected EOF
** [lixx-xx.members.linode.com :: out]
** [lixx-xx.members.linode.com :: out] Failed to find remote refs
** [lixx-xx.members.linode.com :: out] fatal:
** [lixx-xx.members.linode.com :: out] Needed a single revision
** [lixx-xx.members.linode.com :: out]

chris

unread,
Apr 23, 2009, 9:27:22 AM4/23/09
to Capistrano
Oops, a copy and past issue on the previous console output. Here is
the correction.

$ cap deploy
* executing `deploy'
* executing `deploy:update'
** transaction: start
* executing `deploy:update_code'
updating the cached checkout on all servers
executing locally: "git ls-remote g...@github.com:NEW_SERVER/
app_name.git master"
* executing "if [ -d /var/rails/app_name/shared/cached-copy ]; then
cd /var/rails/app_name/shared/cached-copy && git fetch origin && git
reset --hard 904c8b690ea51115bbcc89dfcb24d67f6963c7b4; else git
clone g...@github.com:NEW_SERVER/app_name.git /var/rails/app_name/
shared/cached-copy && cd /var/rails/app_name/shared/cached-copy && git
checkout -b deploy 904c8b690ea51115bbcc89dfcb24d67f6963c7b4; fi"
servers: ["lixx-xx.members.linode.com"]
[lixx-xx.members.linode.com] executing command
** [lixx-xx.members.linode.com :: out] Repository not found. If
you've just created it, please try again in a few seconds.
** [lixx-xx.members.linode.com :: out] fatal: unexpected EOF
** [lixx-xx.members.linode.com :: out] Fetch failure:
g...@github.com:OLD_SERVER/app_name.git
** [lixx-xx.members.linode.com :: out] Repository not found. If
you've just created it, please try again in a few seconds.
** [lixx-xx.members.linode.com :: out] fatal:
** [lixx-xx.members.linode.com :: out] unexpected EOF
** [lixx-xx.members.linode.com :: out]
** [lixx-xx.members.linode.com :: out] Failed to find remote refs
** [lixx-xx.members.linode.com :: out] fatal:
** [lixx-xx.members.linode.com :: out] Needed a single revision
** [lixx-xx.members.linode.com :: out]
command finished
*** [deploy:update_code] rolling back
* executing "rm -rf /var/rails/app_name/releases/20090423131000;
true"
servers: ["lixx-xx.members.linode.com"]
[lixx-xx.members.linode.com] executing command
command finished
failed: "sh -c \"if [ -d /var/rails/app_name/shared/cached-copy ];
then cd /var/rails/app_name/shared/cached-copy && git fetch origin &&
git reset --hard 904c8b690ea51115bbcc89dfcb24d67f6963c7b4; else git
clone g...@github.com:NEW_SERVER/app_name.git /var/rails/app_name/
shared/cached-copy && cd /var/rails/app_name/shared/cached-copy && git
checkout -b deploy 904c8b690ea51115bbcc89dfcb24d67f6963c7b4; fi\"" on
lixx-xx.members.linode.com

Lee Hambley

unread,
Apr 23, 2009, 9:40:31 AM4/23/09
to capis...@googlegroups.com
Chris,

The cloned repository on your server is probably still set to the old path, which deploy strategy (:deploy_via) are you using?

Also, for the sake of the list, please gist or pastie large blocks of output!

- Lee

2009/4/23 chris <olsen...@gmail.com>

Giovanni Intini

unread,
Apr 23, 2009, 9:49:12 AM4/23/09
to capis...@googlegroups.com
You're probably using the remote cache strategy, .git/config on the
server still points to the old github account.

Just manually edit it or remove the cache directory and redeploy.



Il giorno 23/apr/09, alle ore 15:27, chris <olsen...@gmail.com> ha
scritto:

chris

unread,
Apr 23, 2009, 10:26:47 AM4/23/09
to Capistrano
That I am. I have checked the .git/config files on the server, but
the only thing in them is:

[core]
repositoryformatversion = 0
filemode = true

Is there another config file that I am missing?

On Apr 23, 7:49 am, Giovanni Intini <inti...@gmail.com> wrote:
> You're probably using the remote cache strategy, .git/config on the  
> server still points to the old github account.
>
> Just manually edit it or remove the cache directory and redeploy.
>
> Il giorno 23/apr/09, alle ore 15:27, chris <olsen.ch...@gmail.com> ha  

Jamis Buck

unread,
Apr 23, 2009, 10:28:46 AM4/23/09
to capis...@googlegroups.com
The easiest thing to do is to just blow away the cached-copy directory
on all your deployment servers, and redeploy:

rm -rf /var/rails/app_name/shared/cached-copy

Deleting that directory will have no effect on your running application.
It will just cause capistrano to reclone your repository on the next deploy.

- Jamis

On 4/23/09 8:26 AM, chris wrote:
> That I am. I have checked the .git/config files on the server, but
> the only thing in them is:
>
> [core]
> repositoryformatversion = 0
> filemode = true
>
> Is there another config file that I am missing?
>
> On Apr 23, 7:49 am, Giovanni Intini<inti...@gmail.com> wrote:
>> You're probably using the remote cache strategy, .git/config on the
>> server still points to the old github account.
>>
>> Just manually edit it or remove the cache directory and redeploy.
>>
>> Il giorno 23/apr/09, alle ore 15:27, chris<olsen.ch...@gmail.com> ha
>> scritto:
>>
>>
>>
>>
>>
>>> Oops, a copy and past issue on the previous console output. Here is
>>> the correction.
>>> $ cap deploy
>>> * executing `deploy'
>>> * executing `deploy:update'
>>> ** transaction: start
>>> * executing `deploy:update_code'
>>> updating the cached checkout on all servers
>>> executing locally: "git ls-remote g...@github.com:NEW_SERVER/
>>> app_name.git master"
>>> * executing "if [ -d /var/rails/app_name/shared/cached-copy ]; then
>>> cd /var/rails/app_name/shared/cached-copy&& git fetch origin&& git
>>> reset --hard 904c8b690ea51115bbcc89dfcb24d67f6963c7b4; else git
>>> clone g...@github.com:NEW_SERVER/app_name.git /var/rails/app_name/
>>> shared/cached-copy&& cd /var/rails/app_name/shared/cached-copy&& git
>>> shared/cached-copy&& cd /var/rails/app_name/shared/cached-copy&& git
>>> checkout -b deploy 904c8b690ea51115bbcc89dfcb24d67f6963c7b4; fi\"" on
>>> lixx-xx.members.linode.com
>>> On Apr 23, 7:18 am, chris<olsen.ch...@gmail.com> wrote:
>>>> I recently renamed my github account and have been having problems
>>>> since. For some reason when I run the cap deploy command the remote
>>>> server continues to make calls to old github address.
>>>> The old account name no longer exists any where within the project
>>>> and
>>>> I am able to make committals to the remote git server with no issues.
>>>> Thanks for the help.
>>>> $ cap deploy
>>>> * executing `deploy'
>>>> * executing `deploy:update'
>>>> ** transaction: start
>>>> * executing `deploy:update_code'
>>>> updating the cached checkout on all servers
>>>> executing locally: "git ls-remote g...@github.com:greenstem/
>>>> NEW_SERVER.git master"
>>>> * executing "if [ -d /var/rails/NEW_SERVER/shared/cached-copy ];
>>>> then cd /var/rails/NEW_SERVER/shared/cached-copy&& git fetch origin
>>>> && git reset --hard 904c8b690ea51115bbcc89dfcb24d67f6963c7b4; else
>>>> git clone g...@github.com:greenstem/NEW_SERVER.git /var/rails/
>>>> NEW_SERVER/shared/cached-copy&& cd /var/rails/NEW_SERVER/shared/
>>>> cached-copy&& git checkout -b deploy

Lee Hambley

unread,
Apr 23, 2009, 10:28:49 AM4/23/09
to capis...@googlegroups.com
Chris,

I'd honestly just try erasing the cache on the server, and taking the hit of 1 slow(er) deploy and see how you fair, the config file would suggest that it isn't specifically attached to one repository.... but you could also try `git remote show` (I think?)

- Lee

2009/4/23 chris <olsen...@gmail.com>

chris

unread,
Apr 23, 2009, 1:52:55 PM4/23/09
to Capistrano
Thanks for the help. I will give this a go when I get home this
evening.

On Apr 23, 8:28 am, Lee Hambley <lee.hamb...@gmail.com> wrote:
> Chris,
> I'd honestly just try erasing the cache on the server, and taking the hit of
> 1 slow(er) deploy and see how you fair, the config file would suggest that
> it isn't specifically attached to one repository.... but you could also try
> `git remote show` (I think?)
>
> - Lee
>
> 2009/4/23 chris <olsen.ch...@gmail.com>

chris

unread,
Apr 23, 2009, 9:53:57 PM4/23/09
to Capistrano
I have removed the cached-copy dir and tried to deploy again. I am
now getting the following:

[li33-xx.members.linode.com] executing command
[li33-xx.members.linode.com :: out] ERROR: Permission to NEW_NAME/
my_app denied to OLD_NAME/my_app.
[li33-xx.members.linode.com :: out] fatal:
[li33-xx.members.linode.com :: out] unexpected EOF
[li33-xx.members.linode.com :: out] fetch-pack from
'g...@github.com:NEW_NAME/my_app.git' failed. command finished
[deploy:update_code] rolling back

This looks like it may be a github issue, but I am not totally sure.

Any suggestions?

Lee Hambley

unread,
Apr 24, 2009, 5:04:24 AM4/24/09
to capis...@googlegroups.com
Is your server's key on Github ( I assume is hasn't changed? )

- Lee

2009/4/24 chris <olsen...@gmail.com>

chris

unread,
Apr 24, 2009, 9:01:29 AM4/24/09
to Capistrano
It is.

Unsurprisingly, I get the exact same error if I try to manually clone
the repo on my server.

On Apr 24, 3:04 am, Lee Hambley <lee.hamb...@gmail.com> wrote:
> Is your server's key on Github ( I assume is hasn't changed? )
> - Lee
>
> 2009/4/24 chris <olsen.ch...@gmail.com>
>
>
>
>
>
> > I have removed the cached-copy dir and tried to deploy again.  I am
> > now getting the following:
>
> > [li33-xx.members.linode.com] executing command
> > [li33-xx.members.linode.com :: out] ERROR: Permission to NEW_NAME/
> > my_app denied to OLD_NAME/my_app.
> > [li33-xx.members.linode.com :: out] fatal:
> > [li33-xx.members.linode.com :: out] unexpected EOF
> > [li33-xx.members.linode.com :: out] fetch-pack from
> > '...@github.com:NEW_NAME/my_app.git' failed. command finished

Lee Hambley

unread,
Apr 24, 2009, 9:02:28 AM4/24/09
to capis...@googlegroups.com
Your server should have a private/public keypair that is shared with Github, though ?

2009/4/24 chris <olsen...@gmail.com>

chris

unread,
Apr 24, 2009, 9:41:31 AM4/24/09
to Capistrano
Yes it does. I did double check. I have been deploying to the server
for the last 6 months with no issues, until I got m account renamed.

On Apr 24, 7:02 am, Lee Hambley <lee.hamb...@gmail.com> wrote:
> Your server should have a private/public keypair that is shared with Github,
> though ?
>
> 2009/4/24 chris <olsen.ch...@gmail.com>

chris

unread,
Apr 25, 2009, 1:03:09 AM4/25/09
to Capistrano
It seems that the second problem was caused by github not properly
associating the new account name to the previously uploaded ssh key.
Once I re-uploaded the same key all worked well.

Thanks for the help.
Reply all
Reply to author
Forward
0 new messages