I think it has always been there. I am guessing I need to redo the mirror.
Do I need to delete the existing git repo first or can I make the changes to the config file and create the new mirror over it?
I think it has always been there. I am guessing I need to redo the mirror.
Do I need to delete the existing git repo first or can I make the changes to the config file and create the new mirror over it?
You can either run
subgit install --rebuild GIT_REPO
This command will re-trasnlate everything from scratch but it will automatically create a backup of your existing installation.
Or you can create a absolutely fresh new Git repository from scratch using ‘subgit configure’ + copying config and authors.txt and passwd files and then running ‘subgit install’.
Hi,
I did the command:
subgit install --rebuild GIT_REPO
After changing the config file and everyone now gets this error when trying to push to master.
! [remote rejected] master -> master (unable to migrate objects to permanent storage)
error: failed to push some refs to ‘https://server.domain.com/root/therepo.git’
Is there anything I else I need to do after running rebuild?
It looks like new files in the objects/packs directory are being created as read only? Could that be it?
Hi Steve,
the “install” command itself doesn’t require any additional actions, the repository should be ready for work after the command finishes its work.
From the error message “unable to migrate objects to permanent storage” it indeed looks like permissions issue. Could you advise please which protocol do developers use to commit to the mirrored repository, is that ssh? If so, have the repository permission been set groups-writable? If not, what is the user that runs SubGit, is that the same ‘git’ user that runs GitLab?
Hi,
We use https to communicate with the git repo.
I think I did the rebuild command as root for subgit whereas the original mirror was as git. Could this cause the issue?
Hi Steve,
yes, it’s definitely can be the reason. Moreover, if you ran the rebuild on behalf of ‘root’ then SubGit daemon probably us still running on behalf of root. So the solution is to stop the daemon in this repository:
subgit shutdown <REPO>
this command should be invoked by root.
Then, change the files owner to git in this repository:
chown -R git <REPO>
after that start the daemon on behalf of ‘git’ user:
subgit install <REPO>
Hi,
I have done the above. Now when I attempt git fetch I get the message:
$ git fetch
error: RPC failed; HTTP 500 curl 22 The requested URL returned error: 500
fatal: the remote end hung up unexpectedly
Is there anything else I need to do?
Hi,
as far as I found, this error comes from Git client when it cannot deliver the data. It can be caused by large blobs, but I think in this case it may also be permissions issue. Could you please describe your setup in more detail: it is a GitLat repository on GitLab server and SubGit installed into this repository, right?
Hi,
I have done some more poking around and it looks like GitLab has filled the disk space on the server such that there is only 20k left.
I will sort this out and recheck the status of the git mirror.
Okay, now we have fixed the disk space explosion!
When I try to push to master I get this error:
To https://host.server.com/root/therepo.git
! [remote rejected] master -> master (pre-receive hook declined)
error: failed to push some refs to ‘https://server.domain.com/root/therepo.git’
Unfortunately, this message gives no clues on why the push has been declined. Is there other information in the message? Usually SubGit responds with the reason why the push has been declined. If there’s no information, please upload pre-receive hook and daemon logs.
Okay, I have sorted the server side out.
I now get the message:
$ git push
Enumerating objects: 7, done.
Counting objects: 100% (7/7), done.
Delta compression using up to 8 threads
Compressing objects: 100% (4/4), done.
Writing objects: 100% (4/4), 363 bytes | 0 bytes/s, done.
Total 4 (delta 3), reused 0 (delta 0)
remote: Fetching revisions from SVN repository:
remote: up to date
remote: Sending commits to SVN repository:
remote: 3253f26 => r70067 trunk
remote: Sync completed successfully
remote: error executing git hookerror: hook declined to update refs/heads/master
To https://host.server.com/root/therepo.git
! [remote rejected] master -> master (hook declined)
error: failed to push some refs to ‘https://host.server.com/root/therepo.git’
Is this a standard thing to encounter? The commit still goes through and appears in svn, I just get this error message as well.
Hi Steve,
the error message provide too little information about what went wrong, the hook definitely produces an error, but it’s not clear why. We would need to check pre-receive hook and daemon logs to find out, could you please upload them?
Thank you Steve.
Could you please also add pre-receive hook logs?
Hi Steve,
thank you for the logs.
Though I’m afraid they are not that much of a help, but only because there are no errors in logs: everything in logs looks fine, SubGit pre-receive hook finishes its work successfully and the revisions is indeed being translated to SVN. And only after that something happens on GitLab server that declines writing the commit to the master branch. The error comes from GitLab itself, not from SubGit, but it’s not clear what is happening, better to check GitLabs logs.
Thanks, I will look into it
Are there any issues with having two git repos mirroring the same svn repo?
I am thinking of simply generating a new git repo mirror to get around this issue.
Well, if both Git repositories are active and developers are committing to both of them, then such a setup may lead to conflicts, for example, when two developers commit to the same branch in different repositories. Also, there will be two SubGit daemons and every commit will be translated twice which would take more resources. However, it is possible setup, yet I wouldn’t say it’s the best thing to do.