I'm looking for a part-time remote job.

Hire me


I'm the author of:

Mastering Redmine is a comprehensive guide with tips, tricks and best practices, and an easy-to-learn structure.

Check the book's project or

Buy the book

Social pages of the book:

By buying this book you also donate to Redmine (see this page).


Follow me:

Bug #2361

Error received when creating new repository

Added by Mike Tegtmeyer about 9 years ago. Updated over 7 years ago.

Status:
Closed
Priority:
Major
Assignee:
Target version:
Start date:
25 Feb 2015
Due date:
% Done:

100%

Redmine version:
External issue:

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

Duplicated by SCM Creator (+Github) - Bug #2385: cannot create Repository anymore (URL should be of Format "file:///var/local/svn/<Repository>/") Closed 16 Jun 2015

Associated revisions

Revision 143 (diff)
Added by Andriy Lesyuk over 7 years ago

Regexp and other code fixes

History

#1 Updated by Mike Tegtmeyer about 9 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 about 9 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 about 9 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 almost 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 7 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.

Also available in: Atom PDF

Terms of use | Privacy policy