Bug #2361
Error received when creating new repository
100%
Description
Stock install of Redmine and SCM Creator with the exception of repos located in /opt/repo.
Any attempt to create new repository using GUI results in message: 'Path to repository should be of format "/opt/repo/git/<repository>/”'. No combination of configuration settings nor “Path to repository” field entry appears to fix this. For example in project 'foo’, /opt/repo/git/{foo,foo.git} However, with setting configured as below, automatic creation on project creation works as advertised (to me indicating there is not a permission issue). When created automatically on project creation, the internal path is displayed rather than the external URL (only tried on git repositories).
scm.yml is configured as:
production: deny_delete: true auto_create: force force_repository: true pre_create: /usr/local/bin/pre-create.sh post_create: /usr/local/bin/post-create.sh pre_delete: /usr/local/bin/pre-delete.sh post_delete: /usr/local/bin/post-delete.sh max_repos: 0 only_creator: true allow_add_local: true allow_pickup: true # svn: # path: /var/lib/svn # svnadmin: /usr/bin/svnadmin # url: svn git: path: /opt/repo/git git: /opt/gitlab-7.6.2-0/git/bin/git options: --bare url: https://git.MYDOMAIN.org update_server_info: true git_ext: true # append: trunk # mercurial: # path: /var/lib/mercurial # hg: /usr/bin/hg # bazaar: # path: /var/lib/bazaar # bzr: /usr/bin/bzr # init: init-repository # log_encoding: UTF-8 # github: # path: /var/lib/github # api: # token: 36857b12efbccc64ce725ea8674fab6ecbd05c03 # register_hook: true development:
Environment:
Redmine version 2.6.1.stable
Ruby version 2.0.0-p598 (2014-11-13) [x86_64-linux]
Rails version 3.2.21
Environment production
Database adapter Mysql2
SCM:
Git 1.9.5
Filesystem
Redmine plugins:
redmine_banner 0.1.0
redmine_base_deface 0.0.1
redmine_dmsf 1.4.9 stable
redmine_issue_templates 0.0.9
redmine_knowledgebase 3.0.7
redmine_maintenance_mode 2.0.1
redmine_people 0.1.8
redmine_scm 0.5.1
redmine_sudo 0.0.1
redmine_xlsx_format_issue_exporter 0.1.1
Related issues
Associated revisions
Regexp and other code fixes
History
#1 Updated by Mike Tegtmeyer almost 10 years ago
Disclaimer: Although competent in using regular expressions, my ruby programming experience spans only the length of this issue.
After investigating where the issue lies and looking at #2355, it appears that the change to \A from ^ and \z from $ in the regular expression matching is causing the issue. Could be a ruby versioning problem as I am fairly ignorant in Ruby or Rails application programming but reverting the regular expression changes from r141 appears to fixture problem---at least for me.
#2 Updated by markus schulte almost 10 years ago
same here.
diy debugging:
SCM GitCreator Line 51: base: /var/lib/git
SCM GitCreator Line 52: path: /var/lib/git/referenz.git
SCM GitCreator Line 53: base escaped: /var/lib/git
SCM Creator error: name:
worx after changing back line 51 in git_creator.rb to:
matches = Regexp.new("^#{Regexp.escape(base)}/([^/]+?)(\\.git)?/?$").match(path)
#3 Updated by markus schulte almost 10 years ago
sorry. changing back one line is not sufficient.
i had to revert to r140 by doing
svn merge -r 142:140 http://svn.s-andy.com/scm-creator
#4 Updated by Mike Hagedon over 9 years ago
I, too, had this issue. I’m testing Redmine 3.0.2, and I’m using SCM Creator r142. Thanks for the lead, Markus! Comment 2 didn’t solve the problem for me, and comment 3 broke Redmine – I’m on Rails 4, and ActiveRecord::Observer has gone away. Part of r141 addresses this. I now have it working, at least for Git. I started with Markus’ merge command:
svn merge -r 142:140 http://svn.s-andy.com/scm-creator
And then I reverted back to r142 all the changes that weren’t related to regexes. So I ran these commands:
svn rm app/models/repository_observer.rb svn revert init.rb svn revert lib/scm_repository_patch.rb
Then I restarted Redmine. I don’t know enough to know why the new regex format is causing this error, but this fix worked for me while preserving Redmine 3 compatibility. I’m on Ruby 2.2.2.
#5 Updated by Andriy Lesyuk over 8 years ago
- Tracker changed from Support to Bug
- Status changed from New to Closed
- Assignee set to Andriy Lesyuk
- Priority changed from Normal to Major
- Target version set to 0.5.1
- % Done changed from 0 to 100
Sorry, guys! This issue has been fixed in r143.