* clone fails: Could not get the current working directory
@ 2008-09-21 0:49 John Freeman
[not found] ` <d3a045300809211012l35b1ec2dq39f4174170d8c926@mail.gmail.com>
2008-09-23 12:39 ` Alex Riesen
0 siblings, 2 replies; 12+ messages in thread
From: John Freeman @ 2008-09-21 0:49 UTC (permalink / raw)
To: git
Howdy,
I'm trying to clone a remote repository. Here's the background:
- The repository is bare, under Bob's home directory on a remote Sun system.
- Bob has set the group permissions for the repo directory to repogroup.
- I have an account on the remote system that is in repogroup.
I am trying to clone the repo on my home machine, using
> git clone ssh://john@remote.system.edu/home/bob/path/to/repo
It fails with
remote: fatal: Could not get the current working directory
error: git-upload-pack: git-pack-objects died with error.
fatal: git-upload-pack: aborting due to possible repository corruption
on the remote side.
remote: aborting due to possible repository corruption on the remote side.
fatal: early EOF
fatal: index-pack failed
Checking the source code, this error is triggered after getcwd() returns
a null pointer in setup.c:set_work_tree(), which is called at only one
place, in setup.c:setup_git_directory_gently().
Can anyone provide any insight as to why am I seeing this error?
Thank you,
John
^ permalink raw reply [flat|nested] 12+ messages in thread
* Re: clone fails: Could not get the current working directory
[not found] ` <d3a045300809211012l35b1ec2dq39f4174170d8c926@mail.gmail.com>
@ 2008-09-21 22:18 ` John Freeman
2008-09-22 18:32 ` John Freeman
0 siblings, 1 reply; 12+ messages in thread
From: John Freeman @ 2008-09-21 22:18 UTC (permalink / raw)
To: Paul Johnston, git
Paul Johnston wrote:
> On the server, where is git installed? I had a similar problem with
> clone when my git installation was not in a PATH known to ssh.
It is installed in a non-standard directory, /opt/csg/bin. This is part
of the system-wide PATH defined in /etc/bashrc. I also added it to my
~/.bashrc before I discovered that fact.
> Try
> creating symlinks from usr/bin (for example) to your git executables
> to see if this solves the problem.
I did create symlinks in $HOME/local/bin which is in the PATH defined in
my ~/.bashrc. I do not have administrator privileges, so I cannot put
symlinks in /usr/bin. I think it is finding the executable just fine,
but that there is some issue with accessing the repo directory. I have
tested with
> ssh user@remote.system.edu -- "git-upload-pack"
and it works as expected.
> Also, search the archives for
> git-upload-pack.
>
I've skimmed it, and I see nothing related to my problem. Specifying
--upload-pack explicitly gives the same error.
Thank you for the response, though. Are there any other ideas?
- John
^ permalink raw reply [flat|nested] 12+ messages in thread
* Re: clone fails: Could not get the current working directory
2008-09-21 22:18 ` John Freeman
@ 2008-09-22 18:32 ` John Freeman
0 siblings, 0 replies; 12+ messages in thread
From: John Freeman @ 2008-09-22 18:32 UTC (permalink / raw)
To: Paul Johnston, git
I have also tried copying the repo to my home directory on the remote
Sun machine, and then cloning to my local machine. This works as expected.
Does anyone know why a call to getcwd() would fail?
I found this in some documentation on getcwd:
http://www.opengroup.org/onlinepubs/009695399/functions/getcwd.html
"If a program is operating in a directory where some (grand)parent
directory does not permit reading, getcwd() may fail, as in most
implementations it must read the directory to determine the name of the
file. This can occur if search, but not read, permission is granted in
an intermediate directory, or if the program is placed in that directory
by some more privileged process (for example, login). Including the
[EACCES] error condition makes the reporting of the error consistent and
warns the application writer that getcwd() can fail for reasons beyond
the control of the application writer or user. Some implementations can
avoid this occurrence (for example, by implementing getcwd() using pwd,
where pwd is a set-user-root process), thus the error was made optional."
Does anyone know for certain if this is true for Sun machines? Would it
be possible to patch / introduce a macro that changes the use of
getcwd() to a use of pwd, like the above documentation suggests?
- John
^ permalink raw reply [flat|nested] 12+ messages in thread
* Re: clone fails: Could not get the current working directory
2008-09-21 0:49 clone fails: Could not get the current working directory John Freeman
[not found] ` <d3a045300809211012l35b1ec2dq39f4174170d8c926@mail.gmail.com>
@ 2008-09-23 12:39 ` Alex Riesen
2008-09-23 13:23 ` John Freeman
1 sibling, 1 reply; 12+ messages in thread
From: Alex Riesen @ 2008-09-23 12:39 UTC (permalink / raw)
To: John Freeman; +Cc: git
2008/9/21 John Freeman <jfreeman@cs.tamu.edu>:
> - The repository is bare, under Bob's home directory on a remote Sun system.
> - Bob has set the group permissions for the repo directory to repogroup.
> - I have an account on the remote system that is in repogroup.
>
> I am trying to clone the repo on my home machine, using
>
>> git clone ssh://john@remote.system.edu/home/bob/path/to/repo
>
> It fails with
>
> remote: fatal: Could not get the current working directory
Do these work:
$ ssh john@remote.system.edu ls -R /home/bob/path/to/repo
$ ssh john@remote.system.edu 'cd /home/bob/path/to/repo && pwd'
?
^ permalink raw reply [flat|nested] 12+ messages in thread
* Re: clone fails: Could not get the current working directory
2008-09-23 12:39 ` Alex Riesen
@ 2008-09-23 13:23 ` John Freeman
2008-09-23 14:12 ` Alex Riesen
0 siblings, 1 reply; 12+ messages in thread
From: John Freeman @ 2008-09-23 13:23 UTC (permalink / raw)
To: Alex Riesen; +Cc: git
Alex Riesen wrote:
> Do these work:
> $ ssh john@remote.system.edu ls -R /home/bob/path/to/repo
> $ ssh john@remote.system.edu 'cd /home/bob/path/to/repo && pwd'
>
Yes, they do. I wish the mailing list did better threading; please see
my other posts if you happened to miss them:
http://article.gmane.org/gmane.comp.version-control.git/96442
http://article.gmane.org/gmane.comp.version-control.git/96505
Thank you,
John
^ permalink raw reply [flat|nested] 12+ messages in thread
* Re: clone fails: Could not get the current working directory
2008-09-23 13:23 ` John Freeman
@ 2008-09-23 14:12 ` Alex Riesen
2008-09-23 14:45 ` John Freeman
0 siblings, 1 reply; 12+ messages in thread
From: Alex Riesen @ 2008-09-23 14:12 UTC (permalink / raw)
To: John Freeman; +Cc: git
2008/9/23 John Freeman <jfreeman@cs.tamu.edu>:
> Alex Riesen wrote:
>>
>> Do these work:
>> $ ssh john@remote.system.edu ls -R /home/bob/path/to/repo
>> $ ssh john@remote.system.edu 'cd /home/bob/path/to/repo && pwd'
>>
>
> Yes, they do. I wish the mailing list did better threading; please see my
> other posts if you happened to miss them:
>
> http://article.gmane.org/gmane.comp.version-control.git/96442
> http://article.gmane.org/gmane.comp.version-control.git/96505
>
Saw them. .bashrc (/etc/bashrc too) is not used for non-interactive sessions,
like yours (of course, you can source them from
.profile/.bash_login/.bash_profile).
Have you tried the commands exactly? (Even more interesting would be to try
a simple getpwd program which prints errno)
^ permalink raw reply [flat|nested] 12+ messages in thread
* Re: clone fails: Could not get the current working directory
2008-09-23 14:12 ` Alex Riesen
@ 2008-09-23 14:45 ` John Freeman
2008-09-23 15:01 ` Alex Riesen
0 siblings, 1 reply; 12+ messages in thread
From: John Freeman @ 2008-09-23 14:45 UTC (permalink / raw)
To: Alex Riesen; +Cc: git
Alex Riesen wrote:
> Saw them. .bashrc (/etc/bashrc too) is not used for non-interactive
> sessions,
> like yours (of course, you can source them from
> .profile/.bash_login/.bash_profile).
>
> Have you tried the commands exactly? (Even more interesting would be to try
> a simple getpwd program which prints errno)
>
I have. I'm convinced that the problem is not missing commands; if it
were, I'd be getting a "missing command," or "file not found," or
similar error. Like I've said, I am able to get this to work when the
repo is in my home directory. It only fails when the repo is on another
path in the system for which I do not have read privileges all the way
down - only at the end.
- John
^ permalink raw reply [flat|nested] 12+ messages in thread
* Re: clone fails: Could not get the current working directory
2008-09-23 14:45 ` John Freeman
@ 2008-09-23 15:01 ` Alex Riesen
2008-09-23 21:16 ` John Freeman
0 siblings, 1 reply; 12+ messages in thread
From: Alex Riesen @ 2008-09-23 15:01 UTC (permalink / raw)
To: John Freeman; +Cc: git
2008/9/23 John Freeman <jfreeman@cs.tamu.edu>:
> Alex Riesen wrote:
>>
>> Saw them. .bashrc (/etc/bashrc too) is not used for non-interactive
>> sessions,
>> like yours (of course, you can source them from
>> .profile/.bash_login/.bash_profile).
>>
>> Have you tried the commands exactly? (Even more interesting would be to
>> try
>> a simple getpwd program which prints errno)
>>
>
> I have. I'm convinced that the problem is not missing commands; if it were,
> I'd be getting a "missing command," or "file not found," or similar error.
I actually expected "ls -R" giving error about unable to read the directory
(permissions).
> Like I've said, I am able to get this to work when the repo is in my home
> directory. It only fails when the repo is on another path in the system for
> which I do not have read privileges all the way down - only at the end.
Again: try a simple program which just does getpwd for this pathname
^ permalink raw reply [flat|nested] 12+ messages in thread
* Re: clone fails: Could not get the current working directory
2008-09-23 15:01 ` Alex Riesen
@ 2008-09-23 21:16 ` John Freeman
2008-09-24 11:30 ` Alex Riesen
0 siblings, 1 reply; 12+ messages in thread
From: John Freeman @ 2008-09-23 21:16 UTC (permalink / raw)
To: Alex Riesen; +Cc: git
Alex Riesen wrote:
> I actually expected "ls -R" giving error about unable to read the
> directory (permissions).
This worked.
> Again: try a simple program which just does getpwd for this pathname
From what I gather, getpwd() is in libiberty, which I didn't feel like
messing with for this example. I ran a small test program that called
getcwd() in the repo directory, and it failed. errno was set to EACCES,
indicating insufficient permissions.
http://www.opengroup.org/onlinepubs/009695399/functions/getcwd.html
I may get around later to patching this, but for now we're moving ahead
with a workaround.
- John
^ permalink raw reply [flat|nested] 12+ messages in thread
* Re: clone fails: Could not get the current working directory
2008-09-23 21:16 ` John Freeman
@ 2008-09-24 11:30 ` Alex Riesen
2008-09-24 13:30 ` John Freeman
0 siblings, 1 reply; 12+ messages in thread
From: Alex Riesen @ 2008-09-24 11:30 UTC (permalink / raw)
To: John Freeman; +Cc: git
2008/9/23 John Freeman <jfreeman@cs.tamu.edu>:
> Alex Riesen wrote:
>> Again: try a simple program which just does getpwd for this pathname
>
> From what I gather, getpwd() is in libiberty, which I didn't feel like
> messing with for this example. I ran a small test program that called
> getcwd() in the repo directory, and it failed. errno was set to EACCES,
> indicating insufficient permissions.
So there we are...
> http://www.opengroup.org/onlinepubs/009695399/functions/getcwd.html
It suggest a rather dubious workaround (calling pwd).
> I may get around later to patching this, but for now we're moving ahead with
> a workaround.
...but that's a system-inflicted workaround. We just have to do it or something
like what it does.
General question: What does Sun's pwd do?
^ permalink raw reply [flat|nested] 12+ messages in thread
* Re: clone fails: Could not get the current working directory
2008-09-24 11:30 ` Alex Riesen
@ 2008-09-24 13:30 ` John Freeman
2008-09-24 14:43 ` Alex Riesen
0 siblings, 1 reply; 12+ messages in thread
From: John Freeman @ 2008-09-24 13:30 UTC (permalink / raw)
To: Alex Riesen; +Cc: git
Alex Riesen wrote:
> General question: What does Sun's pwd do?
>
It works like you'd expect. There are no permission problems. Even in
directories for which I don't have read access, it will show the path.
- John
^ permalink raw reply [flat|nested] 12+ messages in thread
* Re: clone fails: Could not get the current working directory
2008-09-24 13:30 ` John Freeman
@ 2008-09-24 14:43 ` Alex Riesen
0 siblings, 0 replies; 12+ messages in thread
From: Alex Riesen @ 2008-09-24 14:43 UTC (permalink / raw)
To: John Freeman; +Cc: git
2008/9/24 John Freeman <jfreeman@cs.tamu.edu>:
> Alex Riesen wrote:
>>
>> General question: What does Sun's pwd do?
>
> It works like you'd expect. There are no permission problems. Even in
> directories for which I don't have read access, it will show the path.
No, not what it shows. What does it call? Which syscalls it uses so we
can use them also. Or is /bin/pwd root-SUID?
^ permalink raw reply [flat|nested] 12+ messages in thread
end of thread, other threads:[~2008-09-24 14:44 UTC | newest]
Thread overview: 12+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2008-09-21 0:49 clone fails: Could not get the current working directory John Freeman
[not found] ` <d3a045300809211012l35b1ec2dq39f4174170d8c926@mail.gmail.com>
2008-09-21 22:18 ` John Freeman
2008-09-22 18:32 ` John Freeman
2008-09-23 12:39 ` Alex Riesen
2008-09-23 13:23 ` John Freeman
2008-09-23 14:12 ` Alex Riesen
2008-09-23 14:45 ` John Freeman
2008-09-23 15:01 ` Alex Riesen
2008-09-23 21:16 ` John Freeman
2008-09-24 11:30 ` Alex Riesen
2008-09-24 13:30 ` John Freeman
2008-09-24 14:43 ` Alex Riesen
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).