Skip to content
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

v1.x Migration Survey [for everyone] #339

Closed
n-rodriguez opened this issue Jan 29, 2015 · 88 comments
Closed

v1.x Migration Survey [for everyone] #339

n-rodriguez opened this issue Jan 29, 2015 · 88 comments
Assignees
Labels

Comments

@n-rodriguez
Copy link
Contributor

Hi people!

I'd like to know how many of you are using this plugin and if the migration to the v1.x went fine for you.
Just add a +1 if it's the case. Feel free to add comments ;)

Thank you!

@n-rodriguez n-rodriguez self-assigned this Jan 29, 2015
@loopiv
Copy link

loopiv commented Jan 29, 2015

First of all, great plugin and thanks for your hard work. My migration was not smooth, but I finally got it going. There was some corruption in my gitolite admin repo and it didn't occur to me to rescue everything which cleared it up (git fsck was clean, but redmine/plugin had something diff). It happened during the ssh key renaming. If possible, I'd suggest folks do a rescue before shutting down redmine for the migration.

Just some small things - in the SCM list, Gitolite shows up as Xitolite. Also, I can't seem to get that nice 'how-to' for an empty repo anymore. I get a 404 "The entry or revision was not found in the repository." Although, the prepopulating with a readme works fine.

Thanks again!

@n-rodriguez
Copy link
Contributor Author

in the SCM list, Gitolite shows up as Xitolite

It's normal. It's the Ruby class name for Gitolite repositories. I would have named it Gitolite but there is a class name conflict with the Gitolite gem we use to access to Gitolite Admin repository. So it's a small workaround but it worth it ;)

Also, I can't seem to get that nice 'how-to' for an empty repo anymore.

Fixed in v1.x branch.

@cbarber
Copy link

cbarber commented Jan 31, 2015

I ran into the following exception when running redmine_git_hosting:migrate_to_v1:

Update repositories type (from Git to Xitolite) :

[..]

rake aborted!
NoMethodError: undefined method `identifier' for nil:NilClass
/var/www/redmine-2.6.0/plugins/redmine_git_hosting/lib/tasks/migration_tools.rake:91:in `block (4 levels) in <top (required)>'
/var/www/redmine-2.6.0/plugins/redmine_git_hosting/lib/tasks/migration_tools.rake:85:in `each'
/var/www/redmine-2.6.0/plugins/redmine_git_hosting/lib/tasks/migration_tools.rake:85:in `block (3 levels) in <top (required)>'
/var/www/redmine-2.6.0/plugins/redmine_git_hosting/lib/tasks/migration_tools.rake:117:in `block (2 levels) in <top (required)>'
/usr/local/rvm/gems/ruby-2.1.5/bin/ruby_executable_hooks:15:in `eval'
/usr/local/rvm/gems/ruby-2.1.5/bin/ruby_executable_hooks:15:in `<main>'
Tasks: TOP => redmine_git_hosting:migration_tools:update_repositories_type
(See full trace by running task with --trace)

Turns out I had an orphaned repository (project_id was 0). Not sure how this happened and it was a test repository that was never used so I deleted the record and everything ran fine. Might be worthwhile to add a condition to check.

@saz
Copy link

saz commented Feb 1, 2015

rugged installation requires pkg-config (Ubuntu Trusty: apt-get install pkg-config)

@saz
Copy link

saz commented Feb 1, 2015

After rugged installation failed, due to a missing dependency, I'm now running into the following error:

www-data@lifeguard:/usr/share/redmine$ bundle exec rake redmine_git_hosting:migrate_to_v1 RAILS_ENV=production
https://github.com/jbox-web/grack.git (at fix_rails3) is not checked out. Please run `bundle install`
www-data@lifeguard:/usr/share/redmine$

Running bundle install won't fix the problem

@Trim
Copy link

Trim commented Feb 3, 2015

👍

Worked fine for me since I've understood that my Debian/Wheezy bundler were outdated: I had similar error than @saz one and an infinite loop of dependency resolving because of this outdated bundle (note, that then I installed the latest version of bundler with the gem and I had to use the bundler command instead of bundle to get the right version).

Fortunately, I had redmine backups so I was able to begin again the migration from a good state with the right bundler version and all worked like a charm.

The last issue I had was I didn't notice that after migration Redmine had the new Xitolite type for repositories.

Thank you and keep the good work :)

@overmind88
Copy link

Hi! I tested new redmine for future migration а week ago and did update git plugin to 1.0-beta. I found solution for few problems in this issue-tracker, but for one problem I spent a hour of my life.

I use container virtualization (lxc, openvz) and usually have only base system after create a new virtual machine. I installed all dependencies in operation system for all ruby gems with 0.7.x plugin version. Everything worked fine (I use ssh://git@ for access to repos). Version 1.0 uses 'rugged' gem, and this gem was compiled without ssh support, because I have no install libssh2-1 and libssh2-1-dev so my installation was broken. All works again after installing libssh and recompiling gems.

(Tests was performed on ubuntu 12.04 in lxc and ubuntu 14.04 in openvz)

@anarcat
Copy link

anarcat commented Feb 4, 2015

bundle install hangs on:

Fetching gem metadata from https://rubygems.org/........

and takes 100% of the CPU. same on v1.x branch.

also note that the directions do not use the proper tag naming convention (v1.0.0 vs 1.0.0) for the main repo.

@n-rodriguez
Copy link
Contributor Author

@n-rodriguez
Copy link
Contributor Author

@anarcat > also note that the directions do not use the proper tag naming convention (v1.0.0 vs 1.0.0) for the main repo.

Fixed.

@Trim
Copy link

Trim commented Feb 5, 2015

@anarcat I had same issue and I've resolved it by updating my bundler gem (before I used the Debian one and it was too outdated)

Which version of bundle do you use ?

@anarcat
Copy link

anarcat commented Feb 5, 2015

@Trim the debian one... :/ maybe pre-requisites should be clarified here?

@Akasch
Copy link

Akasch commented Feb 9, 2015

#287 is a big problem, as it requires lot of recovery work and notify all users about changed paths, besides from that all went Smoth.

@mrueg
Copy link

mrueg commented Feb 9, 2015

I'm still using 0.7.10, waiting until rugged-0.22.1 (my distribution hasn't packaged 0.21.4, just jumped straight to 0.22) and redmine_git_hosting-1.0.1 is released :)

@oneclickdev
Copy link

I had problems with indexes while migration. here is my solution:

drop index index_repository_git_extras_on_repository_id on repository_git_extras;
drop index index_repository_git_notifications_on_repository_id on repository_git_notifications;
drop index index_repository_git_config_keys_on_repository_id on repository_git_config_keys;
drop index index_repository_git_config_keys_on_key_and_repository_id on repository_git_config_keys;
drop index index_repository_post_receive_urls_on_repository_id on repository_post_receive_urls;
drop index index_repository_post_receive_urls_on_url_and_repository_id on repository_post_receive_urls;
drop index index_repository_mirrors_on_repository_id on repository_mirrors;
drop index index_repository_mirrors_on_url_and_repository_id on repository_mirrors;
drop index index_deployment_credentials_on_repository_id_and_public_key_id on repository_deployment_credentials;

@DasRoteSkelett
Copy link

For some magic reason, I can see, clone and push to existing repos, but when I try to create one, I can only have a "git" type and I have to submit some path. No Xitolite... Strange...

I cannot find an error in config. Everything seems fine

@n-rodriguez
Copy link
Contributor Author

For some magic reason, I can see, clone and push to existing repos, but when I try to create one, I can only have a "git" type and I have to submit some path. No Xitolite... Strange...

I cannot find an error in config. Everything seems fine

Go in Administration -> Settings -> Repositories tab and enable Xitolite repositories.

@DasRoteSkelett
Copy link

@n-rodriguez Thanks!! That saved my day!!

@saz
Copy link

saz commented Feb 23, 2015

After upgrading to 1.0 should the repos be of type Gitolite? I've enabled Xitolite, but the repository SCM is Gitolite.

@DasRoteSkelett
Copy link

@n-rodriguez Thanks again for the quick help. Donated 50 €. Keep up the good work

@n-rodriguez
Copy link
Contributor Author

@n-rodriguez Thanks again for the quick help. Donated 50 €. Keep up the good work

Thank you!

@n-rodriguez
Copy link
Contributor Author

After upgrading to 1.0 should the repos be of type Gitolite? I've enabled Xitolite, but the repository SCM is Gitolite.

Yep. It's normal : https://jbox-web.github.io/redmine_git_hosting/faq/#in-the-scm-list-gitolite-shows-up-as-xitolite

@saz
Copy link

saz commented Feb 23, 2015

@n-rodriguez Thanks!

@saz
Copy link

saz commented Feb 23, 2015

I'm running into another issue, if I'm trying to open an empty repository, Redmine just shows a 404 error message, not the instructions, how to clone this repository (as it was before)

@saz
Copy link

saz commented Feb 23, 2015

The following information is logged:

Started GET "/projects/entwicklung-allgemein/repository" for [...IP...] at 2015-02-23 16:47:08 +0100
Processing by RepositoriesController#show as HTML
  Parameters: {"id"=>"entwicklung-allgemein"}
  Current user: saz (id=16)
  Rendered common/error.html.erb within layouts/base (0.2ms)
Filter chain halted as :find_project_repository rendered or redirected
Completed 404 Not Found in 62.1ms (Views: 30.0ms | ActiveRecord: 9.4ms)

The following is the error message I'm seeing in the browser:

The entry or revision was not found in the repository.

If you need anything else, just let me know

@n-rodriguez
Copy link
Contributor Author

@saz Can you please open an other issue?

@michael-brade
Copy link

Good news regarding the last two posts: I fixed them both by deleting the repository in the database using SQL. After readding it in redmine everything is working now! Great work!

@ndthanhnet
Copy link

Hi there, i got this issue when i do anything with redmine git hosting :

Rugged::NetworkError (Unsupported URL protocol):
  vendor/bundle/ruby/2.2.0/bundler/gems/gitolite-rugged-eaa0d7a84b30/lib/gitolite/gitolite_admin.rb:311:in `clone_at'
  vendor/bundle/ruby/2.2.0/bundler/gems/gitolite-rugged-eaa0d7a84b30/lib/gitolite/gitolite_admin.rb:311:in `clone'
  vendor/bundle/ruby/2.2.0/bundler/gems/gitolite-rugged-eaa0d7a84b30/lib/gitolite/gitolite_admin.rb:110:in `initialize'
  plugins/redmine_git_hosting/lib/redmine_git_hosting/gitolite_wrapper.rb:67:in `new'
  plugins/redmine_git_hosting/lib/redmine_git_hosting/gitolite_wrapper.rb:67:in `gitolite_admin'
  plugins/redmine_git_hosting/lib/redmine_git_hosting/gitolite_wrapper.rb:39:in `resync_gitolite'
  plugins/redmine_git_hosting/lib/redmine_git_hosting.rb:50:in `resync_gitolite'
  plugins/redmine_git_hosting/app/services/gitolite_accessor.rb:109:in `resync_gitolite'
  plugins/redmine_git_hosting/app/services/gitolite_accessor.rb:15:in `destroy_ssh_key'

from creating new repository, adding new key, edit repository , etc... Config test show all green. is there any i'm missing ?
i followed this guide and all passed http://redmine-git-hosting.io/get_started/
there is one thing special is that i have custom ssh port, and i set custom ssh port in redmine git hosting config already.

please let me know what is the problem with my implemetation.

Thank you.

@bsdtec
Copy link

bsdtec commented May 30, 2015

+1 on leohartx comment.... also seeing same issue.

redmine 3.0.3 with redmine_git_hosting 1.0.4, on amd64 FreeBSD 10.1

Rugged::NetworkError (Unsupported URL protocol):
  /usr/local/lib/ruby/gems/2.1/bundler/gems/gitolite-rugged-eaa0d7a84b30/lib/gitolite/gitolite_admin.rb:311:in `clone_at'
  /usr/local/lib/ruby/gems/2.1/bundler/gems/gitolite-rugged-eaa0d7a84b30/lib/gitolite/gitolite_admin.rb:311:in `clone'
  /usr/local/lib/ruby/gems/2.1/bundler/gems/gitolite-rugged-eaa0d7a84b30/lib/gitolite/gitolite_admin.rb:110:in `initialize'
  plugins/redmine_git_hosting/lib/redmine_git_hosting/gitolite_wrapper.rb:67:in `new'
  plugins/redmine_git_hosting/lib/redmine_git_hosting/gitolite_wrapper.rb:67:in `gitolite_admin'
  plugins/redmine_git_hosting/lib/redmine_git_hosting/gitolite_wrapper.rb:39:in `resync_gitolite'
  plugins/redmine_git_hosting/lib/redmine_git_hosting.rb:50:in `resync_gitolite'
  plugins/redmine_git_hosting/app/services/gitolite_accessor.rb:109:in `resync_gitolite'
  plugins/redmine_git_hosting/app/services/gitolite_accessor.rb:27:in `create_repository'
  plugins/redmine_git_hosting/app/use_cases/create_repository.rb:64:in `create_repository'
  plugins/redmine_git_hosting/app/use_cases/create_repository.rb:16:in `call'
  plugins/redmine_git_hosting/app/use_cases/create_project_repository.rb:31:in `create_project_repository'
  plugins/redmine_git_hosting/app/use_cases/create_project_repository.rb:13:in `call'
  plugins/redmine_git_hosting/lib/redmine_git_hosting/patches/projects_controller_patch.rb:99:in `create_project_repository'
  plugins/redmine_git_hosting/lib/redmine_git_hosting/patches/projects_controller_patch.rb:31:in `create_with_git_hosting'
  actionpack (4.2.1) lib/action_controller/metal/implicit_render.rb:4:in `send_action'
  actionpack (4.2.1) lib/abstract_controller/base.rb:198:in `process_action'
  actionpack (4.2.1) lib/action_controller/metal/rendering.rb:10:in `process_action'
  actionpack (4.2.1) lib/abstract_controller/callbacks.rb:20:in `block in process_action'
  activesupport (4.2.1) lib/active_support/callbacks.rb:117:in `call'
  activesupport (4.2.1) lib/active_support/callbacks.rb:117:in `call'

I am also all green on the config test

@n-rodriguez
Copy link
Contributor Author

@bsdtec : #445 (comment)

@GuillaumeFromage
Copy link

After upgrade we get a bunch of repos that are Repository::Git, but the new one we create are Repository::Xitolite. We encountered a couple of inconsistencies in our schema (our database had a repo with multiple extras), so we had to restart the upgrade by hand a couple of time. It seems like in 0.7 patches would extend Repository::Git so they have the extra, is that still possible in 1.0 ? Or would we need to migrate by hand those repos ?

@n-rodriguez
Copy link
Contributor Author

@GuillaumeFromage :

It seems like in 0.7 patches would extend Repository::Git so they have the extra, is that still possible in 1.0 ?

No.

Or would we need to migrate by hand those repos ?

Normally this should have been done by the migration task. (http://redmine-git-hosting.io/how-to/migrate/#step-by-step-migration-from-0710-version-to-v10x).
If it's not the case you can migrate those repos by hand : just update the type field from Repository::Git to Repository::Xitolite.

@nivir
Copy link

nivir commented Jun 22, 2015

Hi,
I get the following errors while trying to push to my git repository. Any suggestion will be greatly appreciated. Thanks.
Git Error Message
Git Debug Message

@n-rodriguez
Copy link
Contributor Author

@nivir #461

@nivir
Copy link

nivir commented Jun 25, 2015

@n-rodriguez, we fix the error by opening the port in the firewall. Thank you very much for suggestion :)

@jensk
Copy link

jensk commented Jul 20, 2015

+1 It works like a charm.

Thank you very much for this amazing plugin!

@Jarvid
Copy link

Jarvid commented Aug 3, 2015

Hello, unfortunately I run into problems when running 'bundle exec rake redmine_git_hosting:migrate_to_v1 RAILS_ENV=production' as it is throwing the following error:
http://pastebin.com/tv0gpAbj

sorry for the ugly line breaks.

@n-rodriguez
Copy link
Contributor Author

@Jarvid : fixed in next release (1.1.2)

@AdamN1
Copy link

AdamN1 commented Oct 3, 2015

+1
Hi,
at the beginning I will say what I had and what I did, so i start from: redmine version 2.5.2 and redmine_git_hosting version 0.7.6

  1. upgrade redmine to version 3.1.1 (without problem)
  2. upgrade redmine_git_hosting to 0.7.10 using: http://redmine-git-hosting.io/how-to/migrate/ (section Step by Step migration from 0.6 version (or older) to v0.7.10)
  3. upgrade redmine_git_hosting to 1.0.7 using: http://redmine-git-hosting.io/how-to/migrate/ (main section)
  4. upgrade redmine_git_hosting 1.1.4 using http://redmine-git-hosting.io/how-to/upgrade/

in steep 2, 3 and 4 i had problem with gem version like

You specified: redcarpet (~> 3.3.2) and redcarpet (~> 3.1.2). Bundler cannot continue.                                                                                                                                             
#  from /home/www/pl/justnet/redmine/WWW/plugins/redmine_git_hosting/Gemfile:9
after comment line in gemfile everything works fine

The migration script itself works excellent.
Po wszystkich działaniach widzę że są luki w hooks:
image

Hooks should be installed by a migration script?

@n-rodriguez
Copy link
Contributor Author

Hooks should be installed by a migration script?

Go in Hooks tab and click on Install hooks link. But before, check that SSH keys (public and private keys) exist and are readable by the user that runs Redmine.

@AdamN1
Copy link

AdamN1 commented Oct 3, 2015

@n-rodriguez now everything is green :)
image

Is there any way to add existing repositories to the project?

@melbow
Copy link

melbow commented Oct 17, 2015

Hi, I installed fresh (no migration) following the Get Started guide (http://redmine-git-hosting.io/get_started/) but had the same issue as @saz and this page was basically the only relevant result (maybe it's more of a grack or thin issue), so I hope people don't mind me posting my question here:

 You specified: redcarpet (~> 3.3.2) and redcarpet (~> 3.1.2) 

I switched redmine_git_hosting gem files to use redcarpet 3.3.2 and called bundle again, which outputs (among other things):

Using gitlab-grack 2.0.0.pre from https://github.com/jbox-web/grack.git (at fix_rails4)
Using redcarpet 3.3.3
Using thin 1.6.4 

It launches successfully when I call:

 bundle exec rails server thin -b 192.168.1.2 -e production

But stangely when launching with thin:

 thin start -C /etc/thin/redmine 

I get the following output:

 /usr/lib/ruby/vendor_ruby/bundler/source/git.rb:188:in `rescue in load_spec_files': https://github.com/jbox-web/grack.git (at fix_rails4) is not yet checked out. Run `bundle install` first. (Bundler::GitError) 

My thin config file is pretty basic and was working fine before installing the plugin:

---
chdir: "/var/lib/redmine"
environment: production
address: 192.168.1.2
timeout: 30
log: "/var/lib/redmine/log/thin.log"
pid: tmp/pids/thin.pid
max_conns: 1024
max_persistent_conns: 100
require: []
wait: 30
threadpool_size: 20
user: redmine
daemonize: true

My fundamentals:

 Environment:
  Redmine version                3.1.1.stable
  Ruby version                   2.1.5-p273 (2014-11-13) [arm-linux-gnueabi]
  Rails version                  4.2.4
  Environment                    production
  Database adapter               Mysql2
SCM:
  Git                            2.1.4

I also tried setting redmine_git_hosting gem files to redcarpet 3.3.3, and tried installing the grack gem from cloning manually, but no success. Confused!
Any pointers much appreciated.

@melbow
Copy link

melbow commented Oct 17, 2015

On further investigation I think it's a permissions issue, something like that gem is not visible when launching from init script, although the thin config should change to redmine user (maybe ENV parameter missing)

@n-rodriguez
Copy link
Contributor Author

think it's a permissions issue, something like that gem is not visible when launching from init script, although the thin config should change to redmine user (maybe ENV parameter missing)

The issue is that bundle exec is missing. You must prefix the starting command with bundle execso that bundle can load all needed gems.

@melbow
Copy link

melbow commented Oct 23, 2015

Thanks for your reply. Strangely that still doesn't work under root, i.e.:

 bundle exec thin start -C /etc/thin/redmine 

complains about grack not being checked out, where I'm pretty sure it used to run fine like that under root before. If I switch to redmine user then it runs with the exact same command & same dir, no complaints about grack not being checked out.

I'm fine with my workaround in the init script (i.e. adding 'su redmine' there, which thin does anyway as it's in the config file), but I still don't get why.

@wherget
Copy link

wherget commented Mar 1, 2016

Just a quick comment from our migration (which now actually happened for real):

We had quite a bit of trouble with invalid keys that were still in the database. The most frequent error was that there were whitespaces in the key data, and some users apparently pasted their private keys. In earlier versions, this didn't interrupt things, the keys just wouldn't work (I guess they were filtered out by gitolite). However now redmine-gitolite tries to pares these and errors out hard, such that the sync process interrupts.
Might be a good idea to throw away "invalid" keys when migrating.

@rocksolid12
Copy link

Gitolite itself can specify branch level access. In the end of your document you speak of repository level administration. Is this true? Is that not possible?

@baby-gnu
Copy link

baby-gnu commented Oct 3, 2016

The bundle exec rake redmine_git_hosting:rename_ssh_keys RAILS_ENV=production do not delete old keys with the message :

INFO [GitWorker] delete_ssh_key : SSH key 'redmine_eolepack_1393415509_779488@' does not exits in Gitolite, exit !

I ran a script/rails console production to look at what happens and I found the bug in lib/redmine_gitolite/admin_users_helper.rb

    def remove_inactive_key(key)
      repo_keys = @gitolite_admin.ssh_keys[key['owner']]
      repo_key  = repo_keys.find_all{|k| k.location == key['location'] && k.owner == key['owner']}.first

The k.location is not equal to key['location']

Here is the output of my console:

  • Create the gitolite_admin object
gitolite_admin_dir             = RedmineGitolite::Config.gitolite_admin_dir
gitolite_config_file           = RedmineGitolite::ConfigRedmine.get_setting(:gitolite_config_file)
gitolite_debug                 = RedmineGitolite::ConfigRedmine.get_setting(:gitolite_log_level) == 'debug' ? true : false
gitolite_timeout               = RedmineGitolite::ConfigRedmine.get_setting(:gitolite_timeout).to_i
gitolite_admin_ssh_script_path = RedmineGitolite::Config.gitolite_admin_ssh_script_path

gitolite_admin = Gitolite::GitoliteAdmin.new(@gitolite_admin_dir,
                                             :config_file => @gitolite_config_file,
                                             :debug       => @gitolite_debug,
                                             :timeout     => @gitolite_timeout,
                                             :env         => {'GIT_SSH' => @gitolite_admin_ssh_script_path})
  • Get the first public key and create the argument to remove_inactive_key
ssh_key = GitolitePublicKey.active.first
key     = {}
key['title']    = ssh_key.identifier
key['key']      = ssh_key.key
key['owner']    = ssh_key.owner
key['location'] = ssh_key.location
#{"title"=>"redmine_eolepack_1393415509_779488", "key"=>"ssh-rsa AAAAB3NzaC1yc2EAAAABIwAAAQEAxS82p1bPBB/xf6fjBiFsDMfAdcHCNlu2uotnryy35Ee4n8xQngKtpwDitRm9cX+qnFmUfxlXgZw83BVl14J4I0lzlZRsPyJqM6h4dwDhOxNI+ppUEb008Gh0WgWKUnmNrndTRlLgl7bP8mYSABthP7KmiU5GPdN5MbR0ieCvpzAszOg+zKUkhw9dvP3ZbTym5SwflxrkggWqngMbKmRmMK46PSBvW62Ms77njUWhe4iAkrqrwWRdfwg4oM7RsGY9udXvWYIpJBINZvh0NP732I38aTioSdbI/lxePrUPcwjUEg3ol1LvuYxcUieIAJ3lFrT+nGRT/XrwXAeB2CQxBQ== eole@athena", "owner"=>"redmine_eolepack_1393415509_779488", "location"=>nil}
  • Get the key for key['owner']
repo_key = gitolite_admin.ssh_keys[key['owner']].first
#<Gitolite::SSHKey:0x00000008659e58 @type="ssh-rsa", @blob="AAAAB3NzaC1yc2EAAAABIwAAAQEAxS82p1bPBB/xf6fjBiFsDMfAdcHCNlu2uotnryy35Ee4n8xQngKtpwDitRm9cX+qnFmUfxlXgZw83BVl14J4I0lzlZRsPyJqM6h4dwDhOxNI+ppUEb008Gh0WgWKUnmNrndTRlLgl7bP8mYSABthP7KmiU5GPdN5MbR0ieCvpzAszOg+zKUkhw9dvP3ZbTym5SwflxrkggWqngMbKmRmMK46PSBvW62Ms77njUWhe4iAkrqrwWRdfwg4oM7RsGY9udXvWYIpJBINZvh0NP732I38aTioSdbI/lxePrUPcwjUEg3ol1LvuYxcUieIAJ3lFrT+nGRT/XrwXAeB2CQxBQ==", @email="eole@athena", @owner="redmine_eolepack_1393415509_779488", @location="">

We see that location could be nil or the empty string.

I proposed the pull request #619 to fix this.

@n-rodriguez
Copy link
Contributor Author

n-rodriguez commented Oct 3, 2016

@web-flow

Gitolite itself can specify branch level access. In the end of your document you speak of repository level administration. Is this true? Is that not possible?

It's possible : it's the "Protected Branches" feature, configurable in the repository settings.

@baby-gnu
Copy link

baby-gnu commented Oct 4, 2016

I managed to migrate from redmine 2.3.4 with plugin 0.6.3 to redmine 3.3.0 with plugin 1.2.1 (#488).

Thanks.

@n-rodriguez
Copy link
Contributor Author

@baby-gnu Glad you finally did it :) and thanks for the step by step explanation (#488 (comment))

@mcondarelli
Copy link

mcondarelli commented Nov 15, 2016

I am fighting to install this in a brand new server.
Unfortunately I'm having tons of troubles (probably due to my clumsiness).
Current stumbling block is redmine add-user-keys doesn't seem to update gitolite user .ssh/authorized_keys.
Adding the key by hand results in a:
FATAL: R any <repo path> <user> DENIED by fallthru
Any pointer welcome.

@gituser
Copy link

gituser commented Apr 12, 2017

very bad documentation and not really easy process for migration...

  1. 1.2.x requires fresh redmine version with different set of dependencies, so you can't really upgrade JUST plugin without upgrading whole redmine..

  2. But there is a way...

  3. Use rvm! (https://rvm.io)

  4. Backup your database!! And maybe even better to backup whole ~git homedir folder.

  5. Use old ruby version within rvm with your old redmine installation and upgrade there redmine_git_hosting to 0.7.10 by following the guide here: http://redmine-git-hosting.io/how-to/migrate/ (Step by Step migration from 0.7.x version to 1.x)

  6. Now install fresh ruby with rvm get 2.3 and switch to it and make another redmine directory with 3.3 version via svn (you can find detailed instructions how to install redmine at redmine.org). Also configure your config/database.yml to point to your existing database

  7. Make sure you have LOCAL_CODE => "$ENV{HOME}/local", in your ~git/.gitolite.rc uncommented! Old version works just fine without this, but newer version wants this explicitly (otherwise you might get 500 error on redmine-git-hosting plugin settings page). Btw, this setting seems to be completely ommited from the migration guide which is a shame..

  8. Connect to your database via mysql and issue this query:

select * from settings where name='plugin_redmine_git_hosting';

:git_config_username: Redmine Git Hosting
:git_config_email: [email protected]
...

Make sure that there is no < or > in git_config_username or git_config_email because otherwise you'll get errors when migrating to the new version

  1. Install 1.2.x branch of the plugin, 1.2.2 version is broken at the moment (hooks installation is broken) via:
# First git clone Bootstrap Kit
redmine$ cd REDMINE_ROOT/plugins
redmine$ git clone https://github.com/jbox-web/redmine_bootstrap_kit.git
redmine$ cd redmine_bootstrap_kit/
redmine$ git checkout 0.2.4

# Then git clone Redmine Git Hosting
redmine$ cd REDMINE_ROOT/plugins
redmine$ git clone https://github.com/jbox-web/redmine_git_hosting.git
redmine$ cd redmine_git_hosting/
redmine$ git checkout remotes/origin/v1.2.x
  1. Now you can migrate the plugin with:
    cd REDMINE_ROOT; bundle exec rake redmine_git_hosting:migrate_to_v1 RAILS_ENV=production
    If there is a problem on this step, update your gitolite installation as well to v3.6.6 and once again check ~/.gitolite.rc for LOCAL directive and make sure that locally you can ssh from your redmine user to the localhost or git server with previously used ssh-key.

  2. Upgrade your redmine db through this guide - http://www.redmine.org/projects/redmine/wiki/RedmineUpgrade

  3. Re-install hooks via cd REDMINE_ROOT; RAILS_ENV=production rake redmine_git_hosting:install_hook_files

EDIT:

  1. there is a bug with nginx if you start nginx with one user and then change it to another some pages (e.g. settings of the redmine-git-hosting) might be cached and nginx can no longer access cache, thus pages will be broken, the fix is to rm -rf /var/cache/nginx/*; /etc/init.d/nginx restart

UPDATE:

some more issues I've encountered..

  1. If there is still and issue with 13) make sure after redmine upgrade you did set all required permissions on your Admin user group in http://your_redmine_url/roles and also make sure that you're using redmine_bootstrap_plugin v0.2.4

  2. There is an issue with SSH-keys, for some reason keys might get duplicated and no longer work, so best is to remove all keys or reconfigure gitolite from scratch and then visit http://your_redmine_url/settings/plugin/redmine_git_hosting?tab=gitolite_rescue and mark all checkboxes there.

  3. Another issue is that keys with spaces in title can't be used at all (you can't add them to the project), so this did the trick: mysql redmine_db -e "update gitolite_public_keys set title=replace(title,' ','_')"

  4. Another issue that you might have duplicated identifiers of the ssh-keys in your DB, check them with mysql redmine_db -e "select * from gitolite_public_keys gpk inner join gitolite_public_keys gpk2 ON gpk.identifier=gpk2.identifier where gpk.id!=gpk2.id". If you have duplicate entry that means you won't be able to use the key as well.

  5. If you use rvm for redmine user, make sure git user also ables to run ruby, thus install rvm environment for git user as well if you don't have global /usr/bin/ruby binary.

@NisargPatel2022
Copy link

I am getting the below error by running this command [sudo bundle exec rake redmine:plugins:migrate RAILS_ENV=production NAME=redmine_git_hosting]

== 20130807223227 MigrateParameters: migrating ================================
rake aborted!
StandardError: An error has occurred, all later migrations canceled:

undefined method `true?' for Additionals:Module

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