database.delete_record fails on deleted records without a record_type

Bug #697728 reported by Eric Casteleijn
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
desktopcouch
Fix Released
Low
Eric Casteleijn

Bug Description

During the migration, delete_record throws this error:

Traceback (most recent call last):
  File "/usr/lib/desktopcouch/desktopcouch-service", line 49, in <module>
    service.start()
  File "/usr/lib/pymodules/python2.6/desktopcouch/application/service.py", line 138, in start
    ctx=self._ctx)
  File "/usr/lib/pymodules/python2.6/desktopcouch/application/platform/__init__.py", line 35, in find_pid
    return platform_find_pid(start_if_not_running, ctx)
  File "/usr/lib/pymodules/python2.6/desktopcouch/application/platform/linux/__init__.py", line 83, in platform_find_pid
    start_local_couchdb.run_needed_migrations()
  File "/usr/lib/pymodules/python2.6/desktopcouch/application/start_local_couchdb.py", line 182, in run_needed_migrations
    migration.run_needed_migrations(ctx=ctx)
  File "/usr/lib/pymodules/python2.6/desktopcouch/application/migration/__init__.py", line 64, in run_needed_migrations
    migration['method'](db)
  File "/usr/lib/pymodules/python2.6/desktopcouch/application/migration/__init__.py", line 88, in migrate_from_deleted_to_trash
    migrateable_db.delete_record(result.id)
  File "/usr/lib/pymodules/python2.6/desktopcouch/records/database.py", line 324, in delete_record
    record = self.get_record(record_id)
  File "/usr/lib/pymodules/python2.6/desktopcouch/records/database.py", line 174, in get_record
    record = self.record_factory(data=data)
  File "/usr/lib/pymodules/python2.6/desktopcouch/records/__init__.py", line 321, in __init__
    raise NoRecordTypeSpecified
desktopcouch.records.NoRecordTypeSpecified: Record type must be specified and should be a URL

Related branches

Changed in desktopcouch:
importance: Undecided → Critical
status: New → In Progress
assignee: nobody → Eric Casteleijn (thisfred)
Revision history for this message
Eric Casteleijn (thisfred) wrote :

Seems to fail only when a record has the deleted flag in application annotations, yet is missing a record_type. We should not break on this, but these records should not be created in the first place.

Changed in desktopcouch:
importance: Critical → Low
summary: - database.delete_record is missing a record_factory
+ database.delete_record fails on deleted records without a record_type
Changed in desktopcouch:
status: In Progress → Fix Committed
Changed in desktopcouch:
status: Fix Committed → 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.