Skip to content

missing project directory with hierarchical repositories... #217

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
dgeo opened this issue Jun 11, 2014 · 9 comments
Closed

missing project directory with hierarchical repositories... #217

dgeo opened this issue Jun 11, 2014 · 9 comments
Assignees
Labels

Comments

@dgeo
Copy link

dgeo commented Jun 11, 2014

#210 seems to have a bigger cause:

It seems (to me) that intermediate project(s) directory is inconsistently missing.

I did select 'hierarchical' for repositories a long time ago.

for new projects

Creation of a repo 'testrepo1' under project 'forge' gives repositories/testrepo1.git in redmine, if default one since upgrade from v0.6 to v0.7.3

2014-06-11 19:25:29 +0200 INFO [GitHosting] User 'dgeo' created a new repository 'testrepo1'
2014-06-11 19:25:29 +0200 DEBUG [GitWorker] add_repository : get lock !
2014-06-11 19:25:29 +0200 INFO [GitWorker] Using Gitolite configuration file : 'gitolite.conf'
2014-06-11 19:25:29 +0200 INFO [GitWorker] add_repository : repository 'testrepo1' does not exist in Gitolite, create it ...
2014-06-11 19:25:29 +0200 DEBUG [GitWorker] add_repository : repository path 'repositories/testrepo1.git'
2014-06-11 19:25:30 +0200 INFO [GitWorker] add_repository : commiting to Gitolite...
2014-06-11 19:25:30 +0200 DEBUG [GitHosting] /usr/local/www/redmine/plugins/redmine_git_hosting/bin/run_shell_cmd_as_gitolite_user find 'recycle_bin/' -type d -regex 'recycle_bin/[0-9]+__testrepo1.git' -prune -print 2> /dev/null 2>&1
2014-06-11 19:25:30 +0200 INFO [GitWorker] add_repository : let Gitolite create empty repository 'repositories/testrepo1.git'
2014-06-11 19:25:30 +0200 INFO [GitWorker] add_repository : pushing to Gitolite...
2014-06-11 19:25:38 +0200 INFO [GitWorker] add_repository : done !
2014-06-11 19:25:38 +0200 DEBUG [GitWorker] add_repository : lock released !
2014-06-11 19:25:38 +0200 DEBUG [GitHosting] Lookup for git_cache_id with repository path 'repositories/testrepo1.git' ... 
2014-06-11 19:25:38 +0200 DEBUG [GitHosting] Found git_cache_id ('forge/testrepo1'), call cache... 
2014-06-11 19:25:38 +0200 DEBUG [GitHosting] Send GitCommand : '/usr/local/www/redmine/plugins/redmine_git_hosting/bin/run_git_cmd_as_gitolite_user' '--git-dir' 'repositories/testrepo1.git' '-c' 'core.quotepath=false' '-c' 'log.decorate=no' 'branch' '--no-color' '--verbose' '--no-abbrev'
2014-06-11 19:25:38 +0200 WARN [GitCache] Cache is disabled : 'forge/testrepo1'

Second repository get correct location:

2014-06-11 19:28:03 +0200 INFO [GitHosting] User 'dgeo' created a new repository 'forge/testrepo2'
2014-06-11 19:28:03 +0200 DEBUG [GitWorker] add_repository : get lock !
2014-06-11 19:28:03 +0200 INFO [GitWorker] Using Gitolite configuration file : 'gitolite.conf'
2014-06-11 19:28:03 +0200 INFO [GitWorker] add_repository : repository 'forge/testrepo2' does not exist in Gitolite, create it ...
2014-06-11 19:28:03 +0200 DEBUG [GitWorker] add_repository : repository path 'repositories/forge/testrepo2.git'
2014-06-11 19:28:04 +0200 INFO [GitWorker] add_repository : commiting to Gitolite...
2014-06-11 19:28:04 +0200 DEBUG [GitHosting] /usr/local/www/redmine/plugins/redmine_git_hosting/bin/run_shell_cmd_as_gitolite_user find 'recycle_bin/' -type d -regex 'recycle_bin/[0-9]+__forge__testrepo2.git' -prune -print 2> /dev/null 2>&1
2014-06-11 19:28:04 +0200 INFO [GitWorker] add_repository : let Gitolite create empty repository 'repositories/forge/testrepo2.git'
2014-06-11 19:28:04 +0200 INFO [GitWorker] add_repository : pushing to Gitolite...
2014-06-11 19:28:12 +0200 INFO [GitWorker] add_repository : done !
2014-06-11 19:28:12 +0200 DEBUG [GitWorker] add_repository : lock released !
2014-06-11 19:28:12 +0200 DEBUG [GitHosting] Lookup for git_cache_id with repository path 'repositories/forge/testrepo2.git' ... 
2014-06-11 19:28:12 +0200 DEBUG [GitHosting] Found git_cache_id ('forge/testrepo2'), call cache... 
2014-06-11 19:28:12 +0200 DEBUG [GitHosting] Send GitCommand : '/usr/local/www/redmine/plugins/redmine_git_hosting/bin/run_git_cmd_as_gitolite_user' '--git-dir' 'repositories/forge/testrepo2.git' '-c' 'core.quotepath=false' '-c' 'log.decorate=no' 'branch' '--no-color' '--verbose' '--no-abbrev'
2014-06-11 19:28:12 +0200 WARN [GitCache] Cache is disabled : 'forge/testrepo2'

existing projects

When there is a sub-project, project's directory disappears in repos URL…

I have some even more problematic repositories with an extra directory (I missed a bug or may be my fault). Database's repositories/urls says repositories/project1/project2/project2/repo.git, I can see revisions in redmine BUT redmine shows ssh://git@server/project1/project2/repo.git which is not the working url… I didn't find how it is generated (no ruby genius here :-( )

Hope this can be worked out… Even manually i don't understand how to correct this (without changing existing repo's URL's)

I tried rake redmine_git_hosting:update_repositories RAILS_ENV=production and it complains about some missing repositories (those with double project dir)

Thank you for your good work and hope this is not an error of mine…

@n-rodriguez
Copy link
Contributor

Hi!

Thanks for your feedback and sorry for the inconvenience.
I think you have enabled 'unique identifier' in Git Hosting.

I've done some tests :

hierarchical / unique false :

2014-06-12 03:40:00 +0200 INFO [GitHosting] User 'admin' created a new repository 'forge/testrepo1'
2014-06-12 03:40:00 +0200 INFO [GitWorker] Clone Gitolite Admin Repo : git-jbox@localhost/gitolite-admin.git (port : 22) to /tmp/redmine_git_hosting/git-jbox/gitolite-admin.git
2014-06-12 03:40:26 +0200 INFO [GitWorker] Using Gitolite configuration file : 'gitolite.conf'
2014-06-12 03:40:26 +0200 INFO [GitWorker] add_repository : repository 'forge/testrepo1' does not exist in Gitolite, create it ...
2014-06-12 03:40:27 +0200 INFO [GitWorker] add_repository : commiting to Gitolite...
2014-06-12 03:40:27 +0200 INFO [GitWorker] add_repository : let Gitolite create empty repository 'repositories/forge/testrepo1.git'
2014-06-12 03:40:27 +0200 INFO [GitWorker] add_repository : pushing to Gitolite...
2014-06-12 03:40:33 +0200 INFO [GitWorker] add_repository : done !
2014-06-12 03:41:49 +0200 INFO [GitHosting] User 'admin' created a new repository 'forge/testrepo2'
2014-06-12 03:41:49 +0200 INFO [GitWorker] Using Gitolite configuration file : 'gitolite.conf'
2014-06-12 03:41:49 +0200 INFO [GitWorker] add_repository : repository 'forge/testrepo2' does not exist in Gitolite, create it ...
2014-06-12 03:41:49 +0200 INFO [GitWorker] add_repository : commiting to Gitolite...
2014-06-12 03:41:49 +0200 INFO [GitWorker] add_repository : let Gitolite create empty repository 'repositories/forge/testrepo2.git'
2014-06-12 03:41:49 +0200 INFO [GitWorker] add_repository : pushing to Gitolite...
2014-06-12 03:41:52 +0200 INFO [GitWorker] add_repository : done !

hierarchical / unique true :

2014-06-12 03:43:07 +0200 INFO [GitHosting] User 'admin' has removed repository 'testrepo1'
2014-06-12 03:43:07 +0200 INFO [GitWorker] Using Gitolite configuration file : 'gitolite.conf'
2014-06-12 03:43:07 +0200 WARN [GitWorker] delete_repositories : repository 'testrepo1' does not exist in Gitolite, exit !
2014-06-12 03:43:07 +0200 WARN [GitRecycleBin] Repository does not exist repositories/testrepo1.git
2014-06-12 03:43:07 +0200 INFO [GitWorker] delete_repositories : commiting to Gitolite...
2014-06-12 03:43:07 +0200 INFO [GitWorker] delete_repositories : pushing to Gitolite...
2014-06-12 03:43:07 +0200 INFO [GitWorker] delete_repositories : done !
2014-06-12 03:43:14 +0200 INFO [GitHosting] User 'admin' created a new repository 'testrepo1'
2014-06-12 03:43:15 +0200 INFO [GitWorker] Using Gitolite configuration file : 'gitolite.conf'
2014-06-12 03:43:15 +0200 INFO [GitWorker] add_repository : repository 'testrepo1' does not exist in Gitolite, create it ...
2014-06-12 03:43:15 +0200 INFO [GitWorker] add_repository : commiting to Gitolite...
2014-06-12 03:43:15 +0200 INFO [GitWorker] add_repository : let Gitolite create empty repository 'repositories/testrepo1.git'
2014-06-12 03:43:15 +0200 INFO [GitWorker] add_repository : pushing to Gitolite...
2014-06-12 03:43:17 +0200 INFO [GitWorker] add_repository : done !

Note that I've switched to unique true before deleting the default repository.

As this impacts repository's path and name, we can't even delete it correctly now.

This is linked to this issue.

@dgeo
Copy link
Author

dgeo commented Jun 12, 2014

You were right, id did switch 'unique' to true, and thank you for the pointer :)

But event when switching it back to false, first repo still miss project repository here, but not consistently…

2014-06-12 10:31:07 +0200 INFO [GitHosting] User 'dgeo' created a new repository 'testrepo1'
2014-06-12 10:31:07 +0200 DEBUG [GitWorker] add_repository : get lock !
2014-06-12 10:31:07 +0200 INFO [GitWorker] Using Gitolite configuration file : 'gitolite.conf'
2014-06-12 10:31:07 +0200 INFO [GitWorker] add_repository : repository 'testrepo1' does not exist in Gitolite, create it ...
2014-06-12 10:31:07 +0200 DEBUG [GitWorker] add_repository : repository path 'repositories/testrepo1.git'
2014-06-12 10:31:08 +0200 INFO [GitWorker] add_repository : commiting to Gitolite...
2014-06-12 10:31:08 +0200 DEBUG [GitHosting] /usr/local/www/redmine/plugins/redmine_git_hosting/bin/run_shell_cmd_as_gitolite_user find 'recycle_bin/' -type d -regex 'recycle_bin/[0-9]+__testrepo1.git' -prune -print 2> /dev/null 2>&1
2014-06-12 10:31:08 +0200 INFO [GitWorker] add_repository : let Gitolite create empty repository 'repositories/testrepo1.git'
2014-06-12 10:31:08 +0200 INFO [GitWorker] add_repository : pushing to Gitolite...
2014-06-12 10:31:17 +0200 INFO [GitWorker] add_repository : done !
2014-06-12 10:31:17 +0200 DEBUG [GitWorker] add_repository : lock released !
2014-06-12 10:31:17 +0200 DEBUG [GitHosting] Lookup for git_cache_id with repository path 'repositories/forge/testrepo1.git' ... 
2014-06-12 10:31:17 +0200 DEBUG [GitHosting] Found git_cache_id ('forge/testrepo1'), call cache... 
2014-06-12 10:31:17 +0200 DEBUG [GitHosting] Send GitCommand : '/usr/local/www/redmine/plugins/redmine_git_hosting/bin/run_git_cmd_as_gitolite_user' '--git-dir' 'repositories/forge/testrepo1.git' '-c' 'core.quotepath=false' '-c' 'log.decorate=no' 'branch' '--no-color' '--verbose' '--no-abbrev'
2014-06-12 10:31:17 +0200 WARN [GitCache] Cache is disabled : 'forge/testrepo1'
2014-06-12 10:31:17 +0200 ERROR [GitCache] Git exited with non-zero status : 128

Then testrepo1 exists as ~git/repositories/testrepo1.git, and is referenced in the database as repositories/forge/testrepo1.git (?!?)

The second repository created is consistently located at forge/testrepo2.git

Any idea how to debug this ?

@dgeo
Copy link
Author

dgeo commented Jun 12, 2014

Correction: the intermediate directory is only missing for default repo (not first one)

@n-rodriguez
Copy link
Contributor

Correction: the intermediate directory is only missing for default repo (not first one)

In hierarchical mode this is normal.

@dgeo
Copy link
Author

dgeo commented Jun 20, 2014

Then I'll live with it (even if it doesn't seems so logical)
Thank you anyway go all this work and support !

@dgeo dgeo closed this as completed Jun 20, 2014
@n-rodriguez
Copy link
Contributor

Then I'll live with it (even if it doesn't seems so logical)

What did you expect?

@dgeo
Copy link
Author

dgeo commented Jun 20, 2014

I expected it to be stored in a project subdir, keeping repositories in the same apparent structure than in redmine and avoiding uniqueness of Repo's names between two project's main repositories.
I may miss something ?

@dgeo
Copy link
Author

dgeo commented Jun 20, 2014

I may add this to #199 but I miss a real keyboard now :)

@n-rodriguez
Copy link
Contributor

I expected it to be stored in a project subdir, keeping repositories in the same apparent structure than in redmine and avoiding uniqueness of Repo's names between two project's main repositories.
I may miss something ?

I think this is for historical reason. At the time Redmine could manage only one repository so the repository's name was the project name and all projects were stored in flat design. Then came the multi-repositories option (and unique identifier).

To reproduce your use case, you can simply not use the default repository : don't create one and all repositories will be stored under the same directory named with the project name.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants