Problem with indexing of Silva Agenda Items when upgrading

Bug #1156513 reported by Kit Blake on 2013-03-18
This bug affects 2 people
Affects Status Importance Assigned to Milestone
Job van Achterberg

Bug Description

From the silva-general list:

I've run into an issue while trying to upgrade a Silva 2.3.7 site to
3.0.1. Specifically it is the indexing of Silva Agenda Items at the end
of the upgrade script. I am getting this traceback:

Traceback (innermost last):
  Module infrae.wsgi.publisher, line 355, in publish_and_render_errors
  Module infrae.wsgi.publisher, line 341, in publish
   - Published class: Products.Silva.ExtensionService.ManageExtensions
   - Object path: /silva/service_extensions
   - Object type: Silva Extension Service
  Module infrae.wsgi.publisher, line 196, in result
  Module infrae.wsgi.publisher, line 182, in finish
  Module infrae.wsgi.publisher, line 154, in commit
  Module Zope2.App.startup, line 301, in commit
  Module transaction._manager, line 89, in commit
  Module transaction._transaction, line 323, in commit
  Module transaction._transaction, line 393, in _callBeforeCommitHooks
  Module, line 155, in beforeCommit
  Module Products.ZCatalog.ZCatalog, line 476, in catalog_object
  Module Products.ZCatalog.Catalog, line 339, in catalogObject
  Module, line 123, in index_object
  Module, line 81, in __index_range
  Module, line 170, in __insert_in_index_set
TypeError: expected integer key

  The key that __insert_in_index_set receives is of type long, not int
as expected. I have traced the origin of the key's value to the method, which
returns a long. In Silva 2.3.7, the datetime_to_unixtimestamp method in
Products.SilvaNews.datetimeutils converts its return value to an int by
wrapping the computation in a call to int().

  Was the upgrade supposed to change the type of the keys used in the
index to long? Or should datetime_to_unixtimestamp return an int as
before? Or something else? Distributing the division performed in the
method keeps the return value completely within an int:

  (delta.microseconds / 10**6) + delta.seconds + (delta.days * 24 *

Changed in silva:
status: New → Confirmed
Sylvain Viollon (thefunny) wrote :

A fix should have been committed a while back. Migrations need to be done again in order to test it.

Changed in silva:
status: Confirmed → Fix Committed
Mathias Gibbens (gibmat) wrote :

I have just completed an upgrade from Silva 2.3.7 to 3.0.2dev using the current trunk buildout. (I did have to switch to pull from mercurial instead of fetching the egg to get the needed fix.) This is the same upgrade that caused the error I initially reported above, so the fix seems to work at least for me.

Changed in silva:
status: Fix Committed → Fix Released
To post a comment you must log in.
This report contains Public information  Edit
Everyone can see this information.

Duplicates of this bug

Other bug subscribers