Problem with migrated Trac DB

364 views
Skip to first unread message

charmer

unread,
May 10, 2011, 11:15:10 AM5/10/11
to trac-...@googlegroups.com
Hi.

I've migrated my Trac database from one server to another. The first
one had Trac 0.12, the new has 0.12.2.
I've encountered two errors:

When I want add another item such as milestone or version in my admin
panel in the new installation, I get this error:

OperationalError: table cache has 3 columns but 2 values were supplied

I tried to flush the cache table manually still no go. Here's the full report:


----

Most recent calls ('Soubor' is file, 'radek' is line, 'v' is in)

Soubor "build/bdist.linux-i686/egg/trac/web/main.py", řádek 511, v
_dispatch_request
dispatcher.dispatch(req)
Soubor "build/bdist.linux-i686/egg/trac/web/main.py", řádek 237, v dispatch
resp = chosen_handler.process_request(req)
Soubor "build/bdist.linux-i686/egg/trac/admin/web_ui.py", řádek 116, v
process_request
path_info)
Soubor "build/bdist.linux-i686/egg/trac/ticket/admin.py", řádek 53, v
render_admin_panel
return self._render_admin_panel(req, cat, page, version)
Soubor "build/bdist.linux-i686/egg/trac/ticket/admin.py", řádek 480, v
_render_admin_panel
ver.insert()
Soubor "build/bdist.linux-i686/egg/trac/ticket/model.py", řádek 1126, v insert
@self.env.with_transaction(db)
Soubor "build/bdist.linux-i686/egg/trac/db/api.py", řádek 77, v
transaction_wrapper
fn(ldb)
Soubor "build/bdist.linux-i686/egg/trac/ticket/model.py", řádek 1134,
v do_insert
TicketSystem(self.env).reset_ticket_fields()
Soubor "build/bdist.linux-i686/egg/trac/ticket/api.py", řádek 270, v
reset_ticket_fields
del self.fields
Soubor "build/bdist.linux-i686/egg/trac/cache.py", řádek 47, v __delete__
CacheManager(instance.env).invalidate(id)
Soubor "build/bdist.linux-i686/egg/trac/cache.py", řádek 185, v invalidate
@self.env.with_transaction()
Soubor "build/bdist.linux-i686/egg/trac/db/api.py", řádek 73, v
transaction_wrapper
fn(ldb)
Soubor "build/bdist.linux-i686/egg/trac/cache.py", řádek 195, v do_invalidate
(id, 0))
Soubor "build/bdist.linux-i686/egg/trac/db/util.py", řádek 65, v execute
return self.cursor.execute(sql_escape_percent(sql), args)
Soubor "build/bdist.linux-i686/egg/trac/db/sqlite_backend.py", řádek
78, v execute
result = PyFormatCursor.execute(self, *args)
Soubor "build/bdist.linux-i686/egg/trac/db/sqlite_backend.py", řádek
56, v execute
args or [])
Soubor "build/bdist.linux-i686/egg/trac/db/sqlite_backend.py", řádek
48, v _rollback_on_error
return function(self, *args, **kwargs)

System Information:

User Agent: Mozilla/5.0 (X11; Linux x86_64; rv:2.0) Gecko/20100101 Firefox/4.0
Trac 0.12.2
Babel 0.9.6
Genshi 0.6
pysqlite 2.4.1
Python 2.6.4 (r264:75706, Dec 5 2009, 21:18:28) [GCC 4.3.3]
setuptools 0.6c11
SQLite 3.6.23.1
Subversion 1.6.11 (r934486)
jQuery 1.4.2

Enabled Plugins:
TracAccountManager 0.3dev-r10113
/usr/lib/python2.6/site-packages/TracAccountManager-0.3dev_r10113-py2.6.egg

-----

The second error appeared when I went to the /about page of the new
installation site. I got

IndexError: list index out of range

And the full report:

Most recent calls:

Soubor "build/bdist.linux-i686/egg/trac/web/main.py", řádek 511, v
_dispatch_request
Soubor "build/bdist.linux-i686/egg/trac/web/main.py", řádek 258, v dispatch
Soubor "build/bdist.linux-i686/egg/trac/web/chrome.py", řádek 868,
v render_template
Soubor "build/bdist.macosx-10.6-universal/egg/genshi/core.py",
řádek 183, v render
Soubor "build/bdist.macosx-10.6-universal/egg/genshi/output.py",
řádek 58, v encode
Soubor "build/bdist.macosx-10.6-universal/egg/genshi/output.py",
řádek 339, v __call__
Soubor "build/bdist.macosx-10.6-universal/egg/genshi/output.py",
řádek 826, v __call__
Soubor "build/bdist.macosx-10.6-universal/egg/genshi/output.py",
řádek 670, v __call__
Soubor "build/bdist.macosx-10.6-universal/egg/genshi/output.py",
řádek 771, v __call__
Soubor "build/bdist.macosx-10.6-universal/egg/genshi/output.py",
řádek 586, v __call__
Soubor "build/bdist.macosx-10.6-universal/egg/genshi/core.py",
řádek 288, v _ensure
Soubor "build/bdist.macosx-10.6-universal/egg/genshi/core.py",
řádek 288, v _ensure
Soubor "build/bdist.linux-i686/egg/trac/web/chrome.py", řádek 981,
v _strip_accesskeys
Soubor "build/bdist.macosx-10.6-universal/egg/genshi/core.py",
řádek 288, v _ensure
Soubor "build/bdist.linux-i686/egg/trac/web/chrome.py", řádek 970,
v _generate
Soubor "build/bdist.macosx-10.6-universal/egg/genshi/template/base.py",
řádek 605, v _include
Soubor "build/bdist.macosx-10.6-universal/egg/genshi/template/markup.py",
řádek 378, v _match
Soubor "build/bdist.macosx-10.6-universal/egg/genshi/template/markup.py",
řádek 378, v _match
Soubor "build/bdist.macosx-10.6-universal/egg/genshi/template/markup.py",
řádek 327, v _match
Soubor "build/bdist.macosx-10.6-universal/egg/genshi/template/base.py",
řádek 545, v _flatten
Soubor "build/bdist.macosx-10.6-universal/egg/genshi/core.py",
řádek 288, v _ensure
Soubor "build/bdist.macosx-10.6-universal/egg/genshi/path.py",
řádek 588, v _generate
Soubor "build/bdist.macosx-10.6-universal/egg/genshi/template/base.py",
řádek 605, v _include
Soubor "build/bdist.macosx-10.6-universal/egg/genshi/template/markup.py",
řádek 316, v _strip
Soubor "build/bdist.macosx-10.6-universal/egg/genshi/template/base.py",
řádek 545, v _flatten
Soubor "build/bdist.macosx-10.6-universal/egg/genshi/core.py",
řádek 288, v _ensure
Soubor "build/bdist.macosx-10.6-universal/egg/genshi/path.py",
řádek 588, v _generate
Soubor "build/bdist.macosx-10.6-universal/egg/genshi/template/base.py",
řádek 605, v _include
Soubor "build/bdist.macosx-10.6-universal/egg/genshi/template/markup.py",
řádek 316, v _strip
Soubor "build/bdist.macosx-10.6-universal/egg/genshi/template/base.py",
řádek 545, v _flatten
Soubor "build/bdist.macosx-10.6-universal/egg/genshi/filters/i18n.py",
řádek 177, v _generate
Soubor "build/bdist.macosx-10.6-universal/egg/genshi/filters/i18n.py",
řádek 1029, v translate
Soubor "build/bdist.macosx-10.6-universal/egg/genshi/filters/i18n.py",
řádek 1143, v parse_msg

System information

User Agent: Mozilla/5.0 (X11; Linux x86_64; rv:2.0) Gecko/20100101 Firefox/4.0
Trac 0.12.2
Babel 0.9.6
Genshi 0.6
pysqlite 2.4.1
Python 2.6.4 (r264:75706, Dec 5 2009, 21:18:28) [GCC 4.3.3]
setuptools 0.6c11
SQLite 3.6.23.1
Subversion 1.6.11 (r934486)
jQuery 1.4.2

Enabled Plugins:
TracAccountManager 0.3dev-r10113
/usr/lib/python2.6/site-packages/TracAccountManager-0.3dev_r10113-py2.6.egg

----


I'd appreciate any advice how to debug this.

Thank you in advance,

Tomas

--
It's not getting what you want, it's wanting what you've got.

Ryan J Ollos

unread,
May 11, 2011, 6:25:32 PM5/11/11
to trac-...@googlegroups.com


charmer-2 wrote:
>
> When I want add another item such as milestone or version in my admin
> panel in the new installation, I get this error:
>
> OperationalError: table cache has 3 columns but 2 values were supplied
>
> I tried to flush the cache table manually still no go. Here's the full
> report:
>

Try running `trac-admin upgrade`:

http://trac.edgewall.org/wiki/TracAdmin#FullCommandReference

--
View this message in context: http://old.nabble.com/Problem-with-migrated-Trac-DB-tp31586512p31598558.html
Sent from the Trac Users mailing list archive at Nabble.com.

charmer

unread,
May 12, 2011, 3:12:24 PM5/12/11
to trac-...@googlegroups.com
Thanks for the tip, but it said:

TracError: Database newer than Trac version

which really confuses me as the new instance has newer version of Trac
(0.12.2) than the old one (0.12).

Can I perhaps migrate manually?

Thank you,
Tomas

On 12 May 2011 00:25, Ryan J Ollos <ry...@physiosonics.com> wrote:
>
> Try running `trac-admin upgrade`:
>
> http://trac.edgewall.org/wiki/TracAdmin#FullCommandReference
>
> --
> View this message in context: http://old.nabble.com/Problem-with-migrated-Trac-DB-tp31586512p31598558.html
> Sent from the Trac Users mailing list archive at Nabble.com.
>

> --
> 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.

Ryan J Ollos

unread,
May 12, 2011, 4:29:31 PM5/12/11
to trac-...@googlegroups.com


charmer-2 wrote:
>
> Can I perhaps migrate manually?
>

I'm not sure what is going on here, but can only suggest that you read over
[1] if you have not done so already.

[1] http://trac.edgewall.org/wiki/TracUpgrade

--
View this message in context: http://old.nabble.com/Problem-with-migrated-Trac-DB-tp31586512p31606210.html

Christian Boos

unread,
May 12, 2011, 6:14:19 PM5/12/11
to trac-...@googlegroups.com
On 5/10/2011 5:15 PM, charmer wrote:
> Hi.
>
> I've migrated my Trac database from one server to another. The first
> one had Trac 0.12, the new has 0.12.2.
> I've encountered two errors:
>
> When I want add another item such as milestone or version in my admin
> panel in the new installation, I get this error:
>
> OperationalError: table cache has 3 columns but 2 values were supplied

What happened is that at some point you installed the trunk version
(0.13dev) and did an environment upgrade.

Assuming you're using sqlite database, you can verify this:

sqlite> select value from system where name = 'database_version';
27

You currently have a cache table looking like this:

sqlite> .schema cache
CREATE TABLE cache (
id integer PRIMARY KEY,
generation integer,
key text
);

Luckily, as that was for now the only schema change and because that
table is (as its name says) only used as a cache, it's very easy to
downgrade:

sqlite> DROP TABLE cache;
sqlite> CREATE TABLE cache (
id text PRIMARY KEY,
generation integer
);
sqlite> UPDATE system SET value = 26 where name = 'database_version';

... and you're back on 0.12.2 for a while ;-)

-- Christian


charmer

unread,
May 13, 2011, 4:31:01 AM5/13/11
to trac-...@googlegroups.com
> What happened is that at some point you installed the trunk version
> (0.13dev) and did an environment upgrade.

Thank you very much, that was indeed the case. I've downgraded successfully.

Perhaps the other error -

IndexError: list index out of range

I get on the /about page in my Trac has a similar cause?

Cheers,

Reply all
Reply to author
Forward
0 new messages