Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fails to remove old file, with KeyError #130

Open
qris opened this issue Jan 28, 2013 · 2 comments
Open

Fails to remove old file, with KeyError #130

qris opened this issue Jan 28, 2013 · 2 comments
Milestone

Comments

@qris
Copy link

qris commented Jan 28, 2013

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
Copy link
Member

@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
Copy link
Author

qris commented Dec 14, 2013

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
Projects
None yet
Development

No branches or pull requests

2 participants