NETGEAR is aware of a growing number of phone and online scams. To learn how to stay safe click here.
Forum Discussion
ledermann
Oct 10, 2010Aspirant
gitscm: Can't connect to git repo
Hi!
I have installed the gitscm add-on and can't get it to work, instead the "git-upload-pack: command not found" message appears.
What I have done:
- Installed gitscm-addon via FrontView and rebooted the NAS
- Logged in to my readynas as root (ssh root@readynas)
- Created a git repo with:
# cd /opt/git
# mkdir repo
# cd repo
# git init --bare
- Checked that the new repo is shown in https://readynas/gitweb/gitweb.cgi => OK
- Trying to clone the repo from my local MAc client with:
# git clone root@readynas:/opt/git/repo.git
=> bash: line 1: git-upload-pack: command not found
fatal: The remote end hung up unexpectedly
Are there any hints? Because I don't have found any documentation to this addon, maybe I have created the repo the wrong way...
My config:
- ReadyNAS Duo
- Radiator 4.1.6
- git-scm v1.7.1-readynas-0.1.2
Kind regards,
Georg Ledermann
I have installed the gitscm add-on and can't get it to work, instead the "git-upload-pack: command not found" message appears.
What I have done:
- Installed gitscm-addon via FrontView and rebooted the NAS
- Logged in to my readynas as root (ssh root@readynas)
- Created a git repo with:
# cd /opt/git
# mkdir repo
# cd repo
# git init --bare
- Checked that the new repo is shown in https://readynas/gitweb/gitweb.cgi => OK
- Trying to clone the repo from my local MAc client with:
# git clone root@readynas:/opt/git/repo.git
=> bash: line 1: git-upload-pack: command not found
fatal: The remote end hung up unexpectedly
Are there any hints? Because I don't have found any documentation to this addon, maybe I have created the repo the wrong way...
My config:
- ReadyNAS Duo
- Radiator 4.1.6
- git-scm v1.7.1-readynas-0.1.2
Kind regards,
Georg Ledermann
14 Replies
Replies have been turned off for this discussion
- borrislAspirantI'm fresh to git myself and was having some of the same issues. My fix was insuring that all accounts had the /opt/rfw/bin was in the path. That might be just my newbie take on it though.
- WhoCares_MentorIf I recall correctly, the adding of the path should be automatic for *existing* accounts - but I'm not sure now you mention it. Will check.
-Stefan - ledermannAspirantFor the root user the path was already ok. I have added /opt/rfw/bin to the path in /etc/profile, but this doesn't change anything.
Here is a full log to demonstrate the problem:quattro:~ ledermann$ ssh root@readynas
root@readynas's password:
Linux ReadyNAS 2.6.17.8ReadyNAS #1 Tue Jun 9 13:59:28 PDT 2009 padre unknown
ReadyNAS:~# echo $PATH
/opt/rfw/bin:/opt/rfw/sbin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/bin/X11
ReadyNAS:~# whereis git-upload-pack
git-upload-pack: /opt/rfw/bin/git-upload-pack
ReadyNAS:~# git-upload-pack
usage: git upload-pack [--strict] [--timeout=nn] <dir>
ReadyNAS:~# exit
logout
Connection to readynas closed.
quattro:~ ledermann$ git clone root@readynas:/opt/git/repo.git
Cloning into repo...
root@readynas's password:
bash: line 1: git-upload-pack: command not found
fatal: The remote end hung up unexpectedly
quattro:~ ledermann$
Hope this helps for debugging. Maybe I'm doing something wrong.
Georg - nashwaanAspirantI second my request to ledermann. We really need help here. git (or VCS) is crucial for maintaining any project. I have been trying to clone/pull/push from my PC to readyNAS remotely by no success. I have read many web articles (around 30+) for more than 2 weeks to find a way to communicate remotely to the repo located in ReadyNAS it but no luck. Very frustrated. Here is the list of things i done:
- downloaded gitscm from this link http://readynasfreeware.org/attachments/download/100/gitscm_1.7.1-readypro-0.1.2.bin
Installed gitscm-addon via FrontView and rebooted the NAS
logged in to readyNAS as root user via Putty.
created a repo in the /opt/git directory, added few test files to the repo, commit the changes.
verified https://<ReadyNAS>/gitweb/gitweb.cgi and the repo showed there successfully.
I installed "msysgit" which is a Windows flavour of git and opened git bash session and tried to clone/pull/push the repo created in ReadyNAS to my local PC, but i get "fatal: The remote end hung up unexpectedly"
I have also tried to create --bare repo, still no success.
I have made similar checks to what ledermann ensuring path of git commands are accessible but i still get this error:
fatal: The remote end hung up unexpectedlyledermann wrote: quattro:~ ledermann$ ssh root@readynas
root@readynas's password:
Linux ReadyNAS 2.6.17.8ReadyNAS #1 Tue Jun 9 13:59:28 PDT 2009 padre unknown
ReadyNAS:~# echo $PATH
/opt/rfw/bin:/opt/rfw/sbin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/bin/X11
ReadyNAS:~# whereis git-upload-pack
git-upload-pack: /opt/rfw/bin/git-upload-pack
ReadyNAS:~# git-upload-pack
usage: git upload-pack [--strict] [--timeout=nn] <dir>
ReadyNAS:~# exit
logout
Connection to readynas closed.
quattro:~ ledermann$ git clone root@readynas:/opt/git/repo.git
Cloning into repo...
root@readynas's password:
bash: line 1: git-upload-pack: command not found
fatal: The remote end hung up unexpectedly
quattro:~ ledermann$
We are stuck here. Yo-dah, Who cares, or any ReadyNAS expert, pleeeeeeeeeease help :)
My config:
- ReadyNAS NV+
- Radiator 4.1.6
- git-scm v1.7.1-readynas-0.1.2
Thanks,
Yousuf - WhoCares_MentorThe problem when cloning using the git:// protocol is that by default git won't export any repositories unless told to do so:
A really simple TCP git daemon that normally listens on port "DEFAULT_GIT_PORT" aka 9418. It waits for a connection asking for a service, and will serve that service if it is enabled.
It verifies that the directory has the magic file "git-daemon-export-ok", and it will refuse to export any git directory that hasn't explicitly been marked for export this way (unless the --export-all parameter is specified). If you pass some directory paths as git daemon arguments, you can further restrict the offers to a whitelist comprising of those.
So you have two options:
1) create the magic file "git-daemon-export-ok" in the .git directory within your git repo
2) add the "--export-all" option to the line starting with GITDAEMON_OPTIONS= in /etc/init.d/rfw-git-daemon
In either case restart the git daemon using/etc/init.d/rfw-git-daemon stop
/etc/init.d/rfw-git-daemon start
Now cloning should work using the git:// protocol. If you need to enable uploads (receive-packs), you need to either configure the repo to allow this or add the "--enable=reveice-pack" option to the GITDAEMON_OPTIONS line. Other settings you can use with the "--enable-option":These services can be globally enabled/disabled using the command line options of this command. If a finer-grained control is desired (e.g. to allow git archive to be run against only in a few selected repositories the daemon serves), the per-repository configuration file can be used to enable or disable them.
upload-pack
This serves git fetch-pack and git ls-remote clients. It is enabled by default, but a repository can disable it by setting daemon.uploadpack configuration item to false.
upload-archive
This serves git archive --remote. It is disabled by default, but a repository can enable it by setting daemon.uploadarch configuration item to true.
receive-pack
This serves git send-pack clients, allowing anonymous push. It is disabled by default, as there is _no_ authentication in the protocol (in other words, anybody can push anything into the repository, including removal of refs). This is solely meant for a closed LAN setting where everybody is friendly. This service can be enabled by daemon.receivepack configuration item to true.
Again this works for the git:// protocol. Using SSH I still get the "command not found" error which has me really stumped for the PATH is added correctly for all user accounts involved. Will have to investigate more to get that one solved I fear.
-Stefan - parcaeAspirantI had the same problems.
I noticed I had two different PATH depending whether I was logged in to the ReadyNAS or wether I issued remote ssh command
If I looked at the PATH while logged into my ReadyNAS I saw this:
readynas:~# echo $PATH
/opt/rfw/bin:/opt/rfw/sbin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/bin/X11
if I did the following command from my local machine, I get a different PATH:
local: ssh root@readynas echo \$PATH
/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin
notice that when I ran the ssh remote command to show the $PATH, there was no /opt/rfw/bin
so on my ReadyNAS, I modified the .bashrc file to include /opt/rfw/bin:
readynas:~# cat .bashrc
# ~/.bashrc: executed by bash(1) for non-login shells.
PATH=:$PATH:/opt/rfw/bin
export PATH
export PS1='\h:\w\$ '
umask 022
By doing this, I was able to get my git push and pulls to work correctly. - ledermannAspirantThank you, parcae! Your solution works fine for me.
- After applying the above changes it functions, however only when accessed using the root NAS account, I applied similar changes to the git user however the same git-upload-pack command not found error persists. The same path issue is exhibited for this user even after creating an similar .bashrc file and .ssh directory with authorized_keys. Has anyone been able to access without using you root? Since multiple people will be accessing and I do not want to give root access to everyone a solution would be helpful.
- WhoCares_MentorMost likely you fail because all user accounts on the ReadyNAS are normally created with "/bin/false" as their standard shell program. Try running the EnableUserSSH add-on and see whether this fixes your problem. As an alternative you can set the login shell for those accounts that need access to git to "/bin/bash" using an editor on the command line.
-Stefan - Thank you, it runs flawlessly now.
Related Content
NETGEAR Academy

Boost your skills with the Netgear Academy - Get trained, certified and stay ahead with the latest Netgear technology!
Join Us!