Using GitLab 5.1 and following the rake import help, when I:
place my bare repository in the repositories directory as configured in config/gitlab.yml
run the import task -- bundle exec rake gitlab:import:repos RAILS_ENV=production
Even though the bare repository was not empty, the repository is imported as an empty repository. No error was reported by the gitlab:import:repos tool. The empty repository is confirmed when I run gitlab:check, which says the 'repository is empty'.
While this ran, the production log said:
Connecting to database specified by database.yml
Creating scope :opened. Overwriting existing method Issue.opened.
Creating scope :closed. Overwriting existing method MergeRequest.closed.
Rendered notify/project_access_granted_email.html.haml within layouts/notify (1.3ms)
Rendered notify/project_access_granted_email.text.erb (0.3ms)
Sent mail to admin@local.host (176ms)
I am able to successfully import via the browser 'new project' page, accessing a http URL. This leads me to conclude the issue is somewhere specific to the rake import call path.
Also, potentially related -- once the import of the repository has finished, I am unable to transfer it outside of the Administrator namespace -- in the browser, I get the error: 'Cannot move project' -- no error was logged in either the production log or the sidekiq log.
Designs
Child items
...
Show closed items
Linked items
0
Link issues together to show that they're related.
Learn more.
Looking in the repositories/ directory, I see the repository is empty -- git log shows
fatal: bad default revision 'HEAD'
I can see the repo contents if (after doing the above) I manually copy the original bare repository directory from the repositories directory into the admin user's repository directory, then update the hooks/post-receive and hooks/update symlinks to refer to those in gitlab-shell/hooks/update.
However, I still cannot transfer the repository to the global namespace -- I still keep getting the 'Cannot move project' error, but I dont see anything problematic logged in the logfiles, so I'm not sure what is going on.
If I create a new project and use the import project from url approach to import into the admin namespace, I am able to succesfully move that project to the global namespace. So this issue I think is somehow related to the rake import process.
By Administrator on 2013-04-23T21:26:20 (imported from GitLab project)
By Administrator on 2013-04-23T21:26:20 (imported from GitLab)
At first, I thought this might be related to the git version, but this does not appear to be the case -- updated from 'git 1.7.1' to 'git 1.8.2' and the issue still persists.
By Administrator on 2013-04-23T22:54:03 (imported from GitLab project)
By Administrator on 2013-04-23T22:54:03 (imported from GitLab)
I was having the exact same issues when importing existing repos using GitLab (tagged v5.2.0).
Applying commit 2e8db0df fixed the issue for me. The only difference is that "name" is no longer a symbol, but "namespace" still is. So I ended up with:
Does this issue still exist on the latest master? Thanks for the issue report. Please reformat your issue to conform to the issue tracker guidelines found in our contributing guidelines.
By Administrator on 2013-06-15T08:25:24 (imported from GitLab project)
By Administrator on 2013-06-15T08:25:24 (imported from GitLab)
I have the same problem as the original poster, however i notice the import.rake file as change to
project_params = { name: name,
however the the line project = Projects::CreateContext.new(user, project_params).execute is there.
running on 5.4 branch. any fix?
By Administrator on 2013-08-12T17:02:31 (imported from GitLab project)
By Administrator on 2013-08-12T17:02:31 (imported from GitLab)
We did a fresh 5.4 install
We found impossible to import it with the rake, even with the fixes here.
Always get an empty repository after a succesful import:
Processing animate.css.git
2013-08-21T10:33:39Z 7430 TID-9lgfo INFO: Sidekiq client using redis://localhost:6379 with options {:namespace=>"resque:gitlab"}
Created animate.css (animate.css.git)
Done!
When we check the repo in terminal we cant do a git command, like git log or any others. We receive this answer:
I had similar problem, run import and all repositories were imported as empty. Moved all repos to a subfolder and import run correctly ( 6.5.1). So instead of repositories/repo1 I moved it to repositories/namespace/repo1 and run import, all works as expected.
By Administrator on 2014-02-24T10:19:26 (imported from GitLab project)
By Administrator on 2014-02-24T10:19:26 (imported from GitLab)
My issue on the latest version (6.5? Will have to check) was that after copying my .git repositories into repositories/groupname/ the permissions were not set to git:git
By Administrator on 2014-03-29T15:46:46 (imported from GitLab project)
By Administrator on 2014-03-29T15:46:46 (imported from GitLab)
I ran into this issue as well, but unlike ljromero, I ended up with many empty (but valid) git repositories.
I've then deleted the projects and moved the repositories into repositories/jlnr. Re-running the rake task gave me this error for every single repository, but it all seems to work regardless: * Failed trying to create group jlnr
Edit: Hm, but I had to re-create the satellites afterwards, which were missing from all new projects.
By Administrator on 2014-08-31T22:33:47 (imported from GitLab project)
By Administrator on 2014-08-31T22:33:47 (imported from GitLab)
During a restore, all messages from git are suppressed. Maybe something useful shows up if you replace {err: '/dev/null', out: '/dev/null'} with {} (the empty hash) before restoring. Wrong rake task :(
By Administrator on 2014-09-01T14:26:01 (imported from GitLab project)
By Administrator on 2014-09-01T14:26:01 (imported from GitLab)
/opt/gitlab/embedded/bin/git version -> git version 2.0.0
However, I've just moved the repos to be imported into the root dir (e.g. /var/opt/gitlab/git-data/repositories/root/) and started the import using gitlab-rake gitlab:import:repos
Even though I got an error stating "Failed trying to create group root" the import worked like a charm.
Maybe this helps.
By Administrator on 2014-10-04T17:28:27 (imported from GitLab project)
By Administrator on 2014-10-04T17:28:27 (imported from GitLab)
I know this does not help solve this issue but I feel obligated to point out that the solution proposed above by @iakovgan throws all file-based security in omnibus-gitlab out the window, and is likely to break a lot of things. (Will Postgres restart if gitlab-psql does not own its data directory? Can Redis still right memory dump files? Etc.)
That chown command is a very bad idea.
By Administrator on 2014-12-02T09:58:54 (imported from GitLab project)
By Administrator on 2014-12-02T09:58:54 (imported from GitLab)