migrations do not work on new install

Bug #1220955 reported by Curtis Hovey
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
charmworld
Fix Released
Critical
Curtis Hovey

Bug Description

The redeploy of staging.jujucharms.com failed because some of the migrations assume there is a db and index. There are not in this case, and we know that the migration in question has already run in production.

 HOOK + '[' true == true ']'
 HOOK + cd /home/webops_deploy/charmworld
 HOOK + su charmworld -c 'INI=/home/webops_deploy/charmworld/production.ini bin/migrations upgrade --init'
 HOOK Traceback (most recent call last):
 HOOK File "bin/migrations", line 9, in <module>
 HOOK load_entry_point('charmworld==0.0', 'console_scripts', 'migrations')()
 HOOK File "/home/webops_deploy/charmworld/charmworld/migrations/migrate.py", line 407, in main
 HOOK args.func(ini, args)
 HOOK File "/home/webops_deploy/charmworld/charmworld/migrations/migrate.py", line 386, in upgrade
 HOOK new_version = migrations.upgrade(ds, index_client, args.init)
 HOOK File "/home/webops_deploy/charmworld/charmworld/migrations/migrate.py", line 299, in upgrade
 HOOK self.run_migration(datastore.db, index_client, module_name)
 HOOK File "/home/webops_deploy/charmworld/charmworld/migrations/migrate.py", line 224, in run_migration
 HOOK getattr(module, 'upgrade')(db, index_client)
 HOOK File "/home/webops_deploy/charmworld/charmworld/migrations/versions/018_delete_all_bundles.py", line 10, in upgrade
 HOOK index_client._client.delete_all(index_client.index_name, BUNDLE)
 HOOK File "/home/webops_deploy/charmworld/local/lib/python2.7/site-packages/pyelasticsearch/client.py", line 96, in decorate
 HOOK return func(*args, query_params=query_params, **kwargs)
 HOOK File "/home/webops_deploy/charmworld/local/lib/python2.7/site-packages/pyelasticsearch/client.py", line 428, in delete_all
 HOOK query_params=query_params)
 HOOK File "/home/webops_deploy/charmworld/local/lib/python2.7/site-packages/pyelasticsearch/client.py", line 254, in send_request
 HOOK self._raise_exception(resp, prepped_response)
 HOOK File "/home/webops_deploy/charmworld/local/lib/python2.7/site-packages/pyelasticsearch/client.py", line 268, in _raise_exception
 HOOK raise error_class(response.status_code, error_message)
 HOOK pyelasticsearch.exceptions.ElasticHttpNotFoundError: (404, u'IndexMissingException[[charms] missing]')

Related branches

Revision history for this message
Curtis Hovey (sinzui) wrote :

I hacked the the migration script to complete so that staging could start ingestion.

While mongodb is forgiving when collections do not exist, elasticsearch is not. ES updates may need guard to ensure there is something to migrate.

Curtis Hovey (sinzui)
Changed in charmworld:
assignee: nobody → Curtis Hovey (sinzui)
status: Triaged → In Progress
Curtis Hovey (sinzui)
Changed in charmworld:
status: In Progress → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.