Edgewall Software

Ticket #2892 (closed defect: worksforme)

Opened 3 years ago

Last modified 3 months ago

Error while initialize Trac environment

Reported by: sdecleire@… Owned by: daniel
Priority: high Milestone:
Component: admin/console Version: 0.9.3
Severity: blocker Keywords: needinfo
Cc:

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

Change History

  Changed 3 years ago by sdecleire@…

  • status changed from new to closed
  • resolution set to invalid

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

  Changed 14 months ago by anonymous

have you got it work!!! could anyone provide solution for this

follow-up: ↓ 4   Changed 13 months ago by anonymous

  • status changed from closed to reopened
  • resolution invalid deleted

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 :(

in reply to: ↑ 3   Changed 13 months ago by osimons

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.

  Changed 13 months ago by sid

  • keywords needinfo added

Can you provide the database string you were using? Please let us know if this fixes your problem.

  Changed 10 months ago by cboos

  • status changed from reopened to closed
  • resolution set to worksforme

No feedback given, closing.

  Changed 3 months ago by anonymous

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

Add/Change #2892 (Error while initialize Trac environment)

Author



Change Properties
<Author field>
Action
as closed
Next status will be 'reopened'
to The owner will change from daniel. Next status will be 'closed'
 
Note: See TracTickets for help on using tickets.