Re: Just started using trac, clicked on project link and get ValueError: too many values to unpack

76 views
Skip to first unread message

John of NOVA

unread,
Jul 3, 2012, 2:13:23 PM7/3/12
to trac-...@googlegroups.com
On Tuesday, July 3, 2012 11:12:30 AM UTC-4, John of NOVA wrote:
Hey folks, new to trac. Using Postgresql as the database on a CentOS system.

After I run trac with "tracd --port 8000 /projectLocation"

I open it up in firefox and click my project's name, and then I get this error.

Any help would be appreciated.


I actually resolved this by fixing a typo. The '@' between the password and database address was missing.

But that resulted in a new error:

2012-07-03 13:42:40,848 Trac[env] WARNING: base_url option not set in configuration, generated links may be incorrect
2012-07-03 13:42:40,848 Trac[main] DEBUG: Dispatching <Request "GET '/'">
2012-07-03 13:42:40,929 Trac[session] DEBUG: Retrieving session for ID 'ba4755a85120bd08faf1dba8'
2012-07-03 13:42:40,973 Trac[main] ERROR: Internal Server Error:
Traceback (most recent call last):
  File "/usr/lib/python2.6/site-packages/Trac-0.12.3-py2.6.egg/trac/web/main.py", line 522, in _dispatch_request
    dispatcher.dispatch(req)
  File "/usr/lib/python2.6/site-packages/Trac-0.12.3-py2.6.egg/trac/web/main.py", line 208, in dispatch
    chosen_handler)
  File "/usr/lib/python2.6/site-packages/Trac-0.12.3-py2.6.egg/trac/web/main.py", line 350, in _pre_process_request
    chosen_handler = filter_.pre_process_request(req, chosen_handler)
  File "/usr/lib/python2.6/site-packages/Trac-0.12.3-py2.6.egg/trac/versioncontrol/api.py", line 327, in pre_process_request
    if is_default(reponame):
  File "/usr/lib/python2.6/site-packages/Trac-0.12.3-py2.6.egg/trac/versioncontrol/api.py", line 32, in is_default
    return not reponame or reponame in ('(default)', _('(default)'))
  File "/usr/lib/python2.6/site-packages/Trac-0.12.3-py2.6.egg/trac/util/translation.py", line 193, in gettext
    if not self.isactive:
  File "/usr/lib/python2.6/site-packages/Trac-0.12.3-py2.6.egg/trac/util/translation.py", line 179, in isactive
    self.activate(get_locale(), env_path)
  File "/usr/lib/python2.6/site-packages/Trac-0.12.3-py2.6.egg/trac/web/main.py", line 488, in <lambda>
    translation.make_activable(lambda: req.locale, env and env.path or None)
  File "/usr/lib/python2.6/site-packages/Trac-0.12.3-py2.6.egg/trac/web/api.py", line 216, in __getattr__
    value = self.callbacks[name](self)
  File "/usr/lib/python2.6/site-packages/Trac-0.12.3-py2.6.egg/trac/web/main.py", line 314, in _get_locale
    preferred = req.session.get('language')
  File "/usr/lib/python2.6/site-packages/Trac-0.12.3-py2.6.egg/trac/web/api.py", line 216, in __getattr__
    value = self.callbacks[name](self)
  File "/usr/lib/python2.6/site-packages/Trac-0.12.3-py2.6.egg/trac/web/main.py", line 306, in _get_session
    return Session(self.env, req)
  File "/usr/lib/python2.6/site-packages/Trac-0.12.3-py2.6.egg/trac/web/session.py", line 207, in __init__
    self.get_session(sid)
  File "/usr/lib/python2.6/site-packages/Trac-0.12.3-py2.6.egg/trac/web/session.py", line 228, in get_session
    super(Session, self).get_session(sid, authenticated)
  File "/usr/lib/python2.6/site-packages/Trac-0.12.3-py2.6.egg/trac/web/session.py", line 70, in get_session
    """, (sid, int(authenticated)))
  File "/usr/lib/python2.6/site-packages/Trac-0.12.3-py2.6.egg/trac/db/util.py", line 65, in execute
    return self.cursor.execute(sql_escape_percent(sql), args)
ProgrammingError: relation "session" does not exist
LINE 2:             SELECT last_visit FROM session WHERE sid=E'ba475...
                                           ^
ProgrammingError: relation "session" does not exist
LINE 2:             SELECT last_visit FROM session WHERE sid=E'ba475...
                                           ^

2012-07-03 13:42:40,987 Trac[session] DEBUG: Retrieving session for ID 'ba4755a85120bd08faf1dba8'

Matthew Caron

unread,
Jul 3, 2012, 3:11:19 PM7/3/12
to trac-...@googlegroups.com
On 07/03/2012 02:13 PM, John of NOVA wrote:
> return self.cursor.execute(sql_escape_percent(sql), args)
> ProgrammingError: relation "session" does not exist
> LINE 2: SELECT last_visit FROM session WHERE sid=E'ba475...

It would appear that you did not create the tables in your database.

--
Matthew Caron, Build Engineer
Sixnet, a Red Lion business | www.sixnet.com
+1 (518) 877-5173 x138 office


John of NOVA

unread,
Jul 3, 2012, 3:41:56 PM7/3/12
to trac-...@googlegroups.com


Hmm...none of the pages I looked at for installation guidance stated what tables had to be created. I figured the project auto-generated them...ok thanks.

Matthew Caron

unread,
Jul 3, 2012, 3:51:16 PM7/3/12
to trac-...@googlegroups.com
On 07/03/2012 03:41 PM, John of NOVA wrote:
> Hmm...none of the pages I looked at for installation guidance stated
> what tables had to be created. I figured the project auto-generated
> them...ok thanks.

http://trac.edgewall.org/wiki/TracEnvironment#PostgreSQLConnectionString

"Note that with PostgreSQL you will have to create the database before
running trac-admin initenv."

Cooke, Mark

unread,
Jul 4, 2012, 4:33:08 AM7/4/12
to trac-...@googlegroups.com
> -----Original Message-----
> From: trac-...@googlegroups.com On Behalf Of Matthew Caron
> Sent: 03 July 2012 20:51
> To: trac-...@googlegroups.com
> Subject: Re: [Trac] Re: Just started using trac, clicked on
> project link and get ValueError: too many values to unpack
>
> On 07/03/2012 03:41 PM, John of NOVA wrote:
> > Hmm...none of the pages I looked at for installation guidance stated
> > what tables had to be created. I figured the project auto-generated
> > them...ok thanks.
>
> http://trac.edgewall.org/wiki/TracEnvironment#PostgreSQLConnectionString
>
> "Note that with PostgreSQL you will have to create the
> database before running trac-admin initenv."

If you use the `schema=` version of the string, you do not need to create a new dB each time. I use this to host multiple projects for different groups, each group gets a dB (which has to be created using e.g. pgAdminIII first) and then each Trac project gets a different schema, based on the project name. This gives the following template connection string:-

postgres://<username>:<password>@localhost:<port>/<group>?schema=<prjname>

Doing this you only need to create the dB once, then initenv can create the schema and tables.

~ mark c

> --
> Matthew Caron, Build Engineer
> Sixnet, a Red Lion business | www.sixnet.com
> +1 (518) 877-5173 x138 office
>
>
> --
> You received this message because you are subscribed to the
> Google Groups "Trac Users" group.
> To post to this group, send email to trac-...@googlegroups.com.
> To unsubscribe from this group, send email to
> trac-users+...@googlegroups.com.
> For more options, visit this group at
> http://groups.google.com/group/trac-users?hl=en.
>
>
Reply all
Reply to author
Forward
0 new messages