Mastering Redmine

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

Check the book project on this site and/or

Buy the book

By buying this book you will also be donating to Redmine (see this page).


Bug #2017

SCM Creation on Windows

Added by Sascha Voth about 1 year ago. Updated 12 months ago.

Status:Closed Start:04 Apr 2012
Priority:Normal Due date:01 Jun 2012
Assigned to:Andriy Lesyuk % Done:

100%

Category:-
Target version:0.4.0
System: External issue:
System version:
Votes: 0

Description

Winddows Server

Redmine 1.3.2
SCM Creator 0.3

scm.yml
——-

production:
auto_create: false
deny_delete: false
svn:
path: E:\svn\managed_repositories
svnadmin: C:\Apache-Subversion-1.7.4\bin\svnadmin.exe
url: http://mydomain.de/svn


Getting some strange errors when using SCM Creator. When creating a Subversion repository in existing project, the automatically created URL is "file://E:/svn/managed_repositories/<p-id>". This should be "file:///E:/svn/managed_repositories/d-0006" I belive (three slashes). When acessing and trying to delete the repository, both commands fail. I tried to adapt subversion_creator.rb, but since I’ve zero experience in ruby, the results are quite dissapointing.

production_error.log (8.8 KB) Sascha Voth, 30 May 2012 12:14

production.log (2.5 KB) Sascha Voth, 31 May 2012 11:35

production.log (3.8 KB) Sascha Voth, 01 Jun 2012 07:41

Associated revisions

Revision 78
Added by Andriy Lesyuk 12 months ago

Replaced add_to_base(...) with add(:base, ...), worked on #2017

Revision 88
Added by Andriy Lesyuk 12 months ago

Refactoring a little + debugs for #2017

Revision 89
Added by Andriy Lesyuk 12 months ago

Clean up and debug for #2017

History

Updated by Sascha Voth about 1 year ago

I’ve changed all file:// to file:/// and cleaned up my repository database. Now, when setting deny delete to true, deletion of the project fails, creation works. When setting deny delete to false, everything seems to work, as intended.

Updated by Andriy Lesyuk about 1 year ago

  • Status changed from New to Open
  • Assigned to set to Andriy Lesyuk
  • Target version set to 0.4.0

Thank you for the report!

Now, when setting deny delete to true, deletion of the project fails, creation works. When setting deny delete to false, everything seems to work, as intended.

Seems to normal behaviour?..

Updated by Sascha Voth about 1 year ago

When following your description http://projects.andriylesyuk.com/projects/scm-creator/wiki/Configuration about the option deny_delete, it should not affect the deletion of the redmine project itself, but is does. When trying to delete an project with the DB entry "created_with_scm = 1" i get an error, and the deletion fails:

Internal error An error occurred on the page you were trying to access. If you continue to experience problems please contact your Redmine administrator for assistance. If you are the Redmine administrator, check your log files for details about the error. Back

production.log

Processing ProjectsController#destroy (for <IP> at 2012-05-16 09:01:23) [DELETE] Parameters: {"commit"⇒"Löschen", "confirm"⇒"1", "action"⇒"destroy", "_method"⇒"delete", "authenticity_token"⇒"<SECRETTOKEN>", "id"⇒"d-0008", "controller"⇒"projects"}

TypeError (can’t convert nil into String): vendor/plugins/redmine_scm/app/models/repository_observer.rb:13:in `before_destroy’ e:/webserver/Ruby187/lib/ruby/1.8/observer.rb:185:in `notify_observers’ e:/webserver/Ruby187/lib/ruby/1.8/observer.rb:184:in `each’ e:/webserver/Ruby187/lib/ruby/1.8/observer.rb:184:in `notify_observers’ app/controllers/projects_controller.rb:239:in `destroy’ config/initializers/mongrel.rb:62:in `dispatch_cgi’

Rendering e:/webserver/redmine-1.3.2/public/500.html (500 Internal Server Error)

Normal?

Updated by Andriy Lesyuk about 1 year ago

Oh... For some reason I missed that it fails to delete project. Sorry!
No, it’s not normal!

Updated by Andriy Lesyuk 12 months ago

  • Status changed from Open to In Progress
  • % Done changed from 0 to 20

Made a fix for file:///... Could you please check?

Updated by Andriy Lesyuk 12 months ago

  • Target version deleted (0.4.0)

Should not be blocking.

Updated by Sascha Voth 12 months ago

Still getting errors. Steps i’ve done:

- create new project
- selecting create SVN
- project creation redirects to error page

but

- project is created
- svn is created
- svn can be accessed via "/redmine/projects/d-0009/repository"
- repo settings result in error page "/redmine/projects/d-0009/settings"

Attached a part of the production log.

Regards.

ps: Do you have a time schedule for the 2.* version of your plugin? Since i just start using redmine, i think of switching to 2.* soon.

Updated by Andriy Lesyuk 12 months ago

  • Target version set to 0.4.0

Thanks for update! Will check.

ps: Do you have a time schedule for the 2.* version of your plugin? Since i just start using redmine, i think of switching to 2.* soon.

If you use other plugins you should wait with switching to 2.x perhaps... SCM Creator from SVN should work fine under 2.x - I have already ported it (but not tested it well).

Updated by Andriy Lesyuk 12 months ago

Could yoou please show me corresponding record from repositories database table?.. Need to know e.g. if root_url is not NULL.

Updated by Sascha Voth 12 months ago

Andriy Lesyuk wrote:

Could yoou please show me corresponding record from repositories database table?.. Need to know e.g. if root_url is not NULL.

Took a look into before submitting, but forgot to mention it. Sorry.

select * from redmine.repositories;
select * from redmine.projects;

repositories result

'31', '22', 'file:///E:/svn/managed_repositories/d-0009', '', '', 'file:///E:/svn/managed_repositories/d-0009', 'Subversion', NULL, NULL, NULL, '1'

projects result

'22', 'Hans Projekt Test', '', '', '0', NULL, '2012-05-30 10:30:10', '2012-05-30 10:30:10', 'd-0009', '1', '5', '6'

Updated by Andriy Lesyuk 12 months ago

  • % Done changed from 20 to 40

Please update from SVN and try loading settings again. Then show me what it wrote to logs.

Updated by Sascha Voth 12 months ago

Creation works fine. Deletion at least on Redmine level, but not in the file system ( auto_create: true, deny_delete: false ).

Very nice!

Updated by Andriy Lesyuk 12 months ago

You mean deletion also works? But repo on file system was not deleted?.. I don’t see any errors in logs...

Updated by Sascha Voth 12 months ago

Andriy Lesyuk wrote:

You mean deletion also works? But repo on file system was not deleted?.. I don’t see any errors in logs...

Yes, deletion works, but repo stays on the file system. Missed to add it in the log. Attached you another one where I:

- Created a project with SVN repo
- Deleted the project with SVN repo via Admin>Projects

There was no error, and the database entries are correctly removed (repositories, projects). But the SVN repository is still in the filesystem.

I’ve tested also deleting not the project, but the repository via the settings panel, which also gave no error in the production log. Should this throw one?

Updated by Andriy Lesyuk 12 months ago

Hm... Added more debugs - could you please try again?

Updated by Andriy Lesyuk 12 months ago

Anyway not working deletion is a different issue... Not related to this one! I figured out that I reproduce it too...

So closing this issue as fixed! Thanks, Sascha!

Updated by Andriy Lesyuk 12 months ago

  • Due date set to 01 Jun 2012
  • Status changed from In Progress to Closed
  • % Done changed from 40 to 100

Updated by Andriy Lesyuk 12 months ago

http://www.ruby-doc.org/stdlib-1.9.3/libdoc/fileutils/rdoc/FileUtils.html#method-c-remove_entry_secure

In my case it was the parent directory which was everyone writable...

Also available in: Atom PDF