Edgewall Software
Modify

Opened 21 years ago

Closed 21 years ago

#384 closed defect (fixed)

trac-admin initenv doesn't work with 0.7-rc1 (for me)

Reported by: keir@… Owned by: Jonas Borgström
Priority: highest Milestone: 0.7
Component: admin/console Version: devel
Severity: blocker Keywords:
Cc: Branch:
Release Notes:
API Changes:
Internal Changes:

Description

I get a rather unhelpful error when I set up a new trac install when I've already created a directory for the trac data. Perhaps trap this and make it more explicit? I solved the problem by deleting the directory /home/keir/tmp/trac-install, but it took me several minutes to notice that the real error was way up top.

$ trac-admin /home/keir/tmp/trac-install initenv
Creating a new Trac environment at /home/keir/tmp/trac-install

Trac will first ask a few questions about your environment 
in order to initalize and prepare the project database.

 Please enter the name of your project.
 This name will be used in page titles and descriptions.

Project Name [My Project]> 

 Please specify the absolute path to the project Subversion repository.
 Repository must be local, and trac-admin requires read+write
 permission to initialize the Trac database.

Path to repository [/var/svn/test]> /home/keir/svn/

 Please enter location of Trac page templates.
 Default is the location of the site-wide templatesinstalled with Trac.

Templates directory [/usr/local/share/trac/templates]> 
Creating and Initializing Project
Failed to create environment. [Errno 17] File exists: '/home/keir/tmp/trac-insta
ll'
Failed to initialize database. 1
Traceback (most recent call last):
  File "/usr/local/bin/trac-admin", line 913, in ?
    main()
  File "/usr/local/bin/trac-admin", line 902, in main
    tracadm.docmd (command)
  File "/usr/local/bin/trac-admin", line 63, in docmd
    self.onecmd(cmd)
  File "/usr/lib/python2.3/cmd.py", line 210, in onecmd
    return func(arg)
  File "/usr/local/bin/trac-admin", line 491, in do_initenv
    if cnx:
UnboundLocalError: local variable 'cnx' referenced before assignment

Attachments (0)

Change History (2)

comment:1 by daniel, 21 years ago

Component: generaltrac-admin
Milestone: 0.7
Priority: normalhighest
Severity: minorblocker

trac-admin should break after the first exception.

comment:2 by Jonas Borgström, 21 years ago

Resolution: fixed
Status: newclosed
Failed to create environment. [Errno 17] File exists: '/home/keir/tmp/trac-install'

Is the real problem. trac-admin refuses to create an environment if the target directory already exists. Remove the directory or use another path.

The traceback is printed because trac-admin failed to handle the exception raised by the first problem.

Fixed in [523].

Modify Ticket

Change Properties
Set your email in Preferences
Action
as closed The owner will remain Jonas Borgström.
The resolution will be deleted. Next status will be 'reopened'.
to The owner will be changed from Jonas Borgström to the specified user.

Add Comment


E-mail address and name can be saved in the Preferences .
 
Note: See TracTickets for help on using tickets.