#2892 closed defect (worksforme)
Error while initialize Trac environment
| Reported by: | Owned by: | daniel | |
|---|---|---|---|
| Priority: | high | Milestone: | |
| Component: | admin/console | Version: | 0.9.3 |
| Severity: | blocker | Keywords: | needinfo |
| Cc: | Branch: | ||
| Release Notes: | |||
| API Changes: | |||
| Internal Changes: | |||
Description
I get the error below when I init a new trac environment with the trac-admin initenv command :
Creating and Initializing Project
Failed to create environment. need more than 1 value to unpack
Traceback (most recent call last):
File "/usr/local/lib/python2.4/site-packages/trac/scripts/admin.py", line 139, in env_create
self.__env = Environment(self.envname, create=True, db_str=db_str)
File "/usr/local/lib/python2.4/site-packages/trac/env.py", line 79, in __init__
self.create(db_str)
File "/usr/local/lib/python2.4/site-packages/trac/env.py", line 197, in create
db.init_db(self.path, db_str)
File "/usr/local/lib/python2.4/site-packages/trac/db.py", line 441, in init_db
cls, args = _get_cnx_class(env_path, db_str)
File "/usr/local/lib/python2.4/site-packages/trac/db.py", line 449, in _get_cnx_class
scheme, args = _parse_db_str(db_str)
File "/usr/local/lib/python2.4/site-packages/trac/db.py", line 462, in _parse_db_str
scheme, rest = db_str.split(':', 1)
ValueError: need more than 1 value to unpack
Failed to initialize environment. 1
Traceback (most recent call last):
File "/usr/local/lib/python2.4/site-packages/trac/scripts/admin.py", line 594, in do_initenv
self.env_create(db_str)
File "/usr/local/lib/python2.4/site-packages/trac/scripts/admin.py", line 144, in env_create
sys.exit(1)
SystemExit: 1
Attachments (0)
Change History (9)
comment:1 by , 20 years ago
| Resolution: | → invalid |
|---|---|
| Status: | new → closed |
follow-up: 4 comment:3 by , 18 years ago
| Resolution: | invalid |
|---|---|
| Status: | closed → reopened |
same error here:
Creating and Initializing Project
Failed to create environment. need more than 1 value to unpack
Traceback (most recent call last):
File "c:\xampp\python24\lib\site-packages\trac-0.10.3-py2.4.egg\trac\scripts\a
dmin.py", line 613, in do_initenv
options=options)
File "c:\xampp\python24\lib\site-packages\trac-0.10.3-py2.4.egg\trac\env.py",
line 124, in __init__
self.create(options)
File "c:\xampp\python24\lib\site-packages\trac-0.10.3-py2.4.egg\trac\env.py",
line 229, in create
DatabaseManager(self).init_db()
File "c:\xampp\python24\lib\site-packages\trac-0.10.3-py2.4.egg\trac\db\api.py
", line 68, in init_db
connector, args = self._get_connector()
File "c:\xampp\python24\lib\site-packages\trac-0.10.3-py2.4.egg\trac\db\api.py
", line 84, in _get_connector
scheme, args = _parse_db_str(self.connection_uri)
File "c:\xampp\python24\lib\site-packages\trac-0.10.3-py2.4.egg\trac\db\api.py
", line 110, in _parse_db_str
scheme, rest = db_str.split(':', 1)
ValueError: need more than 1 value to unpack
Failed to initialize environment. 1
Traceback (most recent call last):
File "c:\xampp\python24\lib\site-packages\trac-0.10.3-py2.4.egg\trac\scripts\a
dmin.py", line 617, in do_initenv
sys.exit(1)
SystemExit: 1
trying now for 3h - i'll give up :(
comment:4 by , 18 years ago
Replying to anonymous:
> same error here:
> scheme, args = _parse_db_str(self.connection_uri)
> File "c:\xampp\python24\lib\site-packages\trac-0.10.3-py2.4.egg\trac\db\api.py
> ", line 110, in _parse_db_str
> scheme, rest = db_str.split(':', 1)
> ValueError: need more than 1 value to unpack
Like the previous solution, it does look like the database string you enter during initenv is incorrect - it should be two parts, one indicating backend type, the other connection data. If you use sqlite (default) you just hit 'return' and accept default string (sqlite:db/trac.db) - if you use other backend look to DatabaseBackend to find examples of connection strings.
comment:5 by , 18 years ago
| Keywords: | needinfo added |
|---|
Can you provide the database string you were using? Please let us know if this fixes your problem.
comment:6 by , 18 years ago
| Resolution: | → worksforme |
|---|---|
| Status: | reopened → closed |
No feedback given, closing.
comment:7 by , 17 years ago
I had the same problem. As explained in a comment before it was for a incorrect db string.
I was using : db/trac.db and get the error.
Used this solved the problem: sqlite:db/mtbsnp.db
follow-up: 9 comment:8 by , 16 years ago
| Resolution: | worksforme |
|---|---|
| Status: | closed → reopened |
getting this error:-
Creating and Initializing Project
Failed to create environment. need more than 1 value to unpack
Traceback (most recent call last):
File "/usr/lib/python2.5/site-packages/Trac-0.11-py2.5.egg/trac/admin/console.py", line 543, in do_initenv
options=options)
File "/usr/lib/python2.5/site-packages/Trac-0.11-py2.5.egg/trac/env.py", line 188, in __init__
self.create(options)
File "/usr/lib/python2.5/site-packages/Trac-0.11-py2.5.egg/trac/env.py", line 311, in create
DatabaseManager(self).init_db()
File "/usr/lib/python2.5/site-packages/Trac-0.11-py2.5.egg/trac/db/api.py", line 69, in init_db
connector, args = self._get_connector()
File "/usr/lib/python2.5/site-packages/Trac-0.11-py2.5.egg/trac/db/api.py", line 85, in _get_connector
scheme, args = _parse_db_str(self.connection_uri)
File "/usr/lib/python2.5/site-packages/Trac-0.11-py2.5.egg/trac/db/api.py", line 111, in _parse_db_str
scheme, rest = db_str.split(':', 1)
ValueError: need more than 1 value to unpack
Using trac.db so pls help me……
comment:9 by , 16 years ago
| Resolution: | → worksforme |
|---|---|
| Status: | reopened → closed |
Replying to anonymous:
Using trac.db so pls help me……
You should be using sqlite:db/trac.db (or just 'Return' to accept the identical default value). Read comments above.



Oups … I just forgotten the database type in the connexion string …