Need help upgrading to Indico 2.0

Hello,

My name is Jacek Ciura and I am admin at Institute of Nuclear Physics Polish Academy of Sciences. We are running Indico ver. 1.2.1rc10 (https://indico.ifj.edu.pl).
During migration to the 2.0 (stable) release, the process is interrupted with an error message:

(psycopg2.IntegrityError) new row for relation “menu_entries” violates check constraint “ck_menu_entries_title_not_empty”
DETAIL: Failing row contains (3660, null, 70, f, , null, 24, f, null, null, 48, 5).
[SQL: ‘INSERT INTO events.menu_entries (parent_id, event_id, is_enabled, title, name, position, new_tab, link_url, plugin, page_id, type) VALUES (%(parent_id)s, %(event_id)s, %(is_enabled)s, %(title)s, %(name)s, %(position)s, %(new_tab)s, %(link_url)s, %(plugin)s, %(page_id)s, %(type)s) RETURNING events.menu_entries.id’] [parameters: {‘is_enabled’: False, ‘name’: None, ‘plugin’: None, ‘event_id’: 70, ‘page_id’: 48, ‘link_url’: None, ‘title’: u’', ‘parent_id’: None, ‘position’: 24, ‘new_tab’: False, ‘type’: <MenuEntryType.page: 5>}]

At the address indico-migrate 1.0 / indico 2.0 · GitHub there is a debug.txt file

The command to start the migration process:

indico-migrate postgresql:///indico file:///opt/indico-legacy/db/Data.fs --archive-dir /opt/indico-legacy/archive --storage-backend legacy --default-email noreply-indico@ifj.edu.pl --default-currency EUR --symlink-target ~/archive/legacy_symlinks --symlink-backend legacy-symlinks

Any help would be greatly appreciated

Thanks,
Jacek

Looks like you have an event that has a custom menu entry with no title.

Could you try replacing the last two occurrences (line 221 and 237) of this line:

data['title'] = sanitize_user_input(item._caption)

with this:

data['title'] = sanitize_user_input(item._caption) or '(no title)'

in /opt/indico/.venv/lib/python2.7/site-packages/indico_migrate/steps/events/menus.py?


After that, re-run the migration. Note that you need to reset the Postgres database by deleting it using dropdb indico and then running the createdb and “CREATE EXTENSION” commands from the setup guide again.

If it works, please let us know, so we can release a version of the migration script which takes care of this problem without manual patching.

Now, the the migration process is successful

Thank you for your help.

1 Like

Just released v1.0.1 of the migration script that includes the fix.

You might want to check the menu of event 70 (https://your.indico.server/event/70/) and remove the “(no title)” menu item or give it a proper title.

1 Like