#3226: Windows trac-admin initenv fails (no such file or directory / File
exists)
----------------------------------------------------------+-----------------
Reporter: ivan.boscolo | Owner:
daniel
Type: defect | Status: new
Priority: high | Milestone:
Component: trac-admin | Version:
0.9.5
Severity: major | Resolution:
Keywords: trac-admin no such file or directory initenv |
----------------------------------------------------------+-----------------
Old description:
> 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
> canc, 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_c
> reate
> 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_in
> itenv
> self.env_create(db_str)
> File "C:\Python23\Lib\site-packages\trac\scripts\admin.py", line 144,
> in env_c
> reate
> 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\\Sf
> a'
> Traceback (most recent call last):
> File "C:\Python23\Lib\site-packages\trac\scripts\admin.py", line 139,
> in env_c
> reate
> 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_in
> itenv
> self.env_create(db_str)
> File "C:\Python23\Lib\site-packages\trac\scripts\admin.py", line 144,
> in env_c
> reate
> sys.exit(1)
> SystemExit: 1
New description:
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
}}}
Comment (by cboos):
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.
--
Ticket URL: <http://projects.edgewall.com/trac/ticket/3226>
The Trac Project <http://trac.edgewall.com/>
_______________________________________________
Trac-Tickets mailing list
[email protected]
http://lists.edgewall.com/mailman/listinfo/trac-tickets