Edgewall Software
Modify

Opened 18 years ago

Closed 18 years ago

#3226 closed defect (worksforme)

Windows trac-admin initenv fails (no such file or directory / File exists)

Reported by: ivan.boscolo Owned by: daniel
Priority: high Milestone:
Component: admin/console Version: 0.9.5
Severity: major Keywords: trac-admin no such file or directory initenv
Cc: Branch:
Release Notes:
API Changes:
Internal Changes:

Description (last modified by Christian Boos)

On my windows system (w2k) everything always worked fine with my svn install (1.3.1) and trac 0.9.5 ..today i only created a new repo and a new environment and worked fine and then deleted them via file system cancel, i succesfully recreated the repository but i cannot create any environment.

Case 1: if i do not create the directory structure and call initenv that's the situation

C:\Python23>python c:/python23/scripts/trac-admin C:/TRACProjects/Antalis/Mobis
Welcome to trac-admin 0.9.5
Interactive Trac adminstration console.
Copyright (c) 2003-2006 Edgewall Software

Type:  '?' or 'help' for help on commands.

Trac [C:\TRACProjects\Antalis\Mobis]> initenv
Creating a new Trac environment at C:\TRACProjects\Antalis\Mobis

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]> Mobis

 Please specify the connection string for the database to use.
 By default, a local SQLite database is created in the environment
 directory. It is also possible to use an already existing
 PostgreSQL database (check the Trac documentation for the exact
 connection string syntax).

Database connection string [sqlite:db/trac.db]>

 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]> C:\SVNRepos\AntalisMobis

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

Templates directory [C:\Python23\share\trac\templates]>

Creating and Initializing Project
Failed to create environment. [Errno 2] No such file or directory: 'C:\\TRACProj
ects\\Antalis\\Mobis'
Traceback (most recent call last):
  File "C:\Python23\Lib\site-packages\trac\scripts\admin.py", line 139, in env_create
    self.__env = Environment(self.envname, create=True, db_str=db_str)
  File "C:\Python23\Lib\site-packages\trac\env.py", line 79, in __init__
    self.create(db_str)
  File "C:\Python23\Lib\site-packages\trac\env.py", line 174, in create
    os.mkdir(self.path)
OSError: [Errno 2] No such file or directory: 'C:\\TRACProjects\\Antalis\\Mobis'

Failed to initialize environment. 1
Traceback (most recent call last):
  File "C:\Python23\Lib\site-packages\trac\scripts\admin.py", line 594, in do_initenv
    self.env_create(db_str)
  File "C:\Python23\Lib\site-packages\trac\scripts\admin.py", line 144, in env_create
    sys.exit(1)
SystemExit: 1

Case 2: If i create the directory structure and then call initenv

C:\Python23>python c:/python23/scripts/trac-admin C:\TRACProjects\Gts\Sfa
Welcome to trac-admin 0.9.5
Interactive Trac adminstration console.
Copyright (c) 2003-2006 Edgewall Software

Type:  '?' or 'help' for help on commands.

Trac [C:\TRACProjects\Gts\Sfa]> initenv
Creating a new Trac environment at C:\TRACProjects\Gts\Sfa

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]> Mobis

 Please specify the connection string for the database to use.
 By default, a local SQLite database is created in the environment
 directory. It is also possible to use an already existing
 PostgreSQL database (check the Trac documentation for the exact
 connection string syntax).

Database connection string [sqlite:db/trac.db]>

 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]> C:\SVNRepos\AntalisMobis

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

Templates directory [C:\Python23\share\trac\templates]>

Creating and Initializing Project
Failed to create environment. [Errno 17] File exists: 'C:\\TRACProjects\\Gts\\Sfa'
Traceback (most recent call last):
  File "C:\Python23\Lib\site-packages\trac\scripts\admin.py", line 139, in env_create
    self.__env = Environment(self.envname, create=True, db_str=db_str)
  File "C:\Python23\Lib\site-packages\trac\env.py", line 79, in __init__
    self.create(db_str)
  File "C:\Python23\Lib\site-packages\trac\env.py", line 174, in create
    os.mkdir(self.path)
OSError: [Errno 17] File exists: 'C:\\TRACProjects\\Gts\\Sfa'
Failed to initialize environment. 1
Traceback (most recent call last):
  File "C:\Python23\Lib\site-packages\trac\scripts\admin.py", line 594, in do_initenv
    self.env_create(db_str)
  File "C:\Python23\Lib\site-packages\trac\scripts\admin.py", line 144, in env_create
    sys.exit(1)
SystemExit: 1

Attachments (0)

Change History (4)

comment:1 by Christian Boos, 18 years ago

Description: modified (diff)

Well, in case 1, I suspect that the parent directory C:\TRACProjects\Antalis didn't exist, and in case 2, the directory C:\TRACProjects\Gts\Sfa already existed.

What you need to do is:

trac-admin x/y/z initenv ...

where x/y exists but z doesn't.

0.10 is a bit more tolerant about this, you can initenv an existing empty folder.

If with those advices are enough to solve your problem, please don't forget to close this ticket as worksforme. already exists but is empty.

comment:2 by anonymous, 18 years ago

Resolution: worksforme
Status: newclosed

Thanks man! Your advices works ;)

comment:3 by anonymous, 18 years ago

Resolution: worksforme
Status: closedreopened

I am getting the same error I am trying:

G:\Python23>python scripts/trac-admin G:/svnrepos/repo1 Welcome to trac-admin 0.9.6 Interactive Trac adminstration console. Copyright © 2003-2006 Edgewall Software

Type: '?' or 'help' for help on commands.

Trac \svnrepos\repo1> initenv Creating a new Trac environment at G:\svnrepos\repo1

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]> Repo1

Please specify the connection string for the database to use. By default, a local SQLite database is created in the environment directory. It is also possible to use an already existing PostgreSQL database (check the Trac documentation for the exact connection string syntax).

Database connection string db/trac.db>

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> G:/svnrepos/repo1

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

Templates directory \Python23\share\trac\templates>

Creating and Initializing Project Failed to create environment. [Errno 2] No such file or directory: 'G:
svnrepos
repo1'

comment:4 by Christian Boos, 18 years ago

Resolution: worksforme
Status: reopenedclosed

You made the common mistake to confuse a Trac environment directory with the Source Code Repository directory. They can't be the same.

Please (re)read TracEnvironment.

Modify Ticket

Change Properties
Set your email in Preferences
Action
as closed The owner will remain daniel.
The resolution will be deleted. Next status will be 'reopened'.
to The owner will be changed from daniel 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.