Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP

Loading…

Fails to remove old file, with KeyError #130

Open
qris opened this Issue · 2 comments

2 participants

@qris

2013-01-28 14:29:09 [DEBUG] push README.md
2013-01-28 14:29:09 [DEBUG] push wip.patch
2013-01-28 14:29:09 [DEBUG] Resource uri: http://localhost:5984/freebase
2013-01-28 14:29:09 [DEBUG] Request: GET _design/freebase
2013-01-28 14:29:09 [DEBUG] Headers: {'Accept': 'application/json', 'User-Agent': 'couchapp/1.0.1'}
2013-01-28 14:29:09 [DEBUG] Params: {}
2013-01-28 14:29:09 [DEBUG] /home/installuser/Dropbox/projects/freebase/freebase/vendor don't exist
2013-01-28 14:29:09 [DEBUG] detach jsdocs/symbols/src/com.qwirx.grid_Grid.js.html
2013-01-28 14:29:09 [CRITICAL] u'jsdocs/symbols/src/com.qwirx.grid_Grid.js.html'

Traceback (most recent call last):
File "/usr/local/lib/python2.7/dist-packages/couchapp/dispatch.py", line 48, in dispatch
return _dispatch(args)
File "/usr/local/lib/python2.7/dist-packages/couchapp/dispatch.py", line 92, in _dispatch
return fun(conf, conf.app_dir, args, *opts)
File "/usr/local/lib/python2.7/dist-packages/couchapp/commands.py", line 79, in push
doc.push(dbs, noatomic, browse, force)
File "/usr/local/lib/python2.7/dist-packages/couchapp/localdoc.py", line 111, in push
doc = self.doc(db, with_attachments=False, force=force)
File "/usr/local/lib/python2.7/dist-packages/couchapp/localdoc.py", line 221, in doc
del attachments[name]
KeyError: u'jsdocs/symbols/src/com.qwirx.grid_Grid.js.html'

It appears that when a file is in the signature list, but no longer in the couchapp (e.g. deleted manually? or by a partial/failed nonatomic push?) then couchapp crashes because it tries to remove the file from attachments again.

@BigBlueHat
Collaborator

@qris what version of couchapp did this happen with?

Here's what I tried with a couchapp direction containing a PDF in _attachments:

couchapp -v push . http://localhost:5984/testing
# confirmed attachment was there
# confirmed attachment in couchapp.signatures list
# Using Futon, I deleted the attachment & saved the document
couchapp -v push . http://localhost:5984/testing
# attachment was not re-attached, but the signature in couchapp.signatures was still there

Certainly a bug.

@qris, if you could describe the process you went through, and what version of couchapp you were used, I'd appreciate it!

@qris

Hi @BigBlueHat, sorry it was a very long time ago:

  • I can't remember the process.
  • I'm currently using Couchapp (version 1.0.1) which was installed 11 months ago.
  • I can't remember if that was before or after this issue occurred, or what version of CouchApp I might have been running before that.
  • However, lines 111 and 221 of /usr/local/lib/python2.7/dist-packages/couchapp/localdoc.py match the stack trace above.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.