AssertionError on DELETE when child links point to yourself #979

Open
opened 2010-03-04 07:24:10 +00:00 by zooko · 4 comments
zooko commented 2010-03-04 07:24:10 +00:00
Owner

USSJoin accidentally made a directory with all of its child links pointing to itself:

[
 "dirnode",
 {
  "rw_uri": "URI:DIR2:qtotg7dsasgg367iigdmloryjy:3iblclsl5vvuguthfgyu6r5r6fqz2eakolo5zf5dd4so7uwyqsua",
  "verify_uri":
"URI:DIR2-Verifier:7adhej5azpcfstqm7hozdplqyy:3iblclsl5vvuguthfgyu6r5r6fqz2eakolo5zf5dd4so7uwyqsua",
  "ro_uri": "URI:DIR2-RO:gnc3ftwpfi2s63fmupirayl7b4:3iblclsl5vvuguthfgyu6r5r6fqz2eakolo5zf5dd4so7uwyqsua",
  "children": {
   "1": [
    "dirnode",
    {
     "mutable": true,
     "verify_uri":
"URI:DIR2-Verifier:7adhej5azpcfstqm7hozdplqyy:3iblclsl5vvuguthfgyu6r5r6fqz2eakolo5zf5dd4so7uwyqsua",
     "ro_uri": "URI:DIR2-RO:gnc3ftwpfi2s63fmupirayl7b4:3iblclsl5vvuguthfgyu6r5r6fqz2eakolo5zf5dd4so7uwyqsua",
     "rw_uri": "URI:DIR2:qtotg7dsasgg367iigdmloryjy:3iblclsl5vvuguthfgyu6r5r6fqz2eakolo5zf5dd4so7uwyqsua",
...

At some point he got an AssertionError, attached in HTML format.

USSJoin accidentally made a directory with all of its child links pointing to itself: ``` [ "dirnode", { "rw_uri": "URI:DIR2:qtotg7dsasgg367iigdmloryjy:3iblclsl5vvuguthfgyu6r5r6fqz2eakolo5zf5dd4so7uwyqsua", "verify_uri": "URI:DIR2-Verifier:7adhej5azpcfstqm7hozdplqyy:3iblclsl5vvuguthfgyu6r5r6fqz2eakolo5zf5dd4so7uwyqsua", "ro_uri": "URI:DIR2-RO:gnc3ftwpfi2s63fmupirayl7b4:3iblclsl5vvuguthfgyu6r5r6fqz2eakolo5zf5dd4so7uwyqsua", "children": { "1": [ "dirnode", { "mutable": true, "verify_uri": "URI:DIR2-Verifier:7adhej5azpcfstqm7hozdplqyy:3iblclsl5vvuguthfgyu6r5r6fqz2eakolo5zf5dd4so7uwyqsua", "ro_uri": "URI:DIR2-RO:gnc3ftwpfi2s63fmupirayl7b4:3iblclsl5vvuguthfgyu6r5r6fqz2eakolo5zf5dd4so7uwyqsua", "rw_uri": "URI:DIR2:qtotg7dsasgg367iigdmloryjy:3iblclsl5vvuguthfgyu6r5r6fqz2eakolo5zf5dd4so7uwyqsua", ... ``` At some point he got an AssertionError, attached in HTML format.
tahoe-lafs added the
code-dirnodes
major
defect
1.6.0
labels 2010-03-04 07:24:10 +00:00
tahoe-lafs added this to the undecided milestone 2010-03-04 07:24:10 +00:00
zooko commented 2010-03-04 07:24:24 +00:00
Author
Owner

Attachment error.html (7092 bytes) added

**Attachment** error.html (7092 bytes) added
6.9 KiB
zooko commented 2010-03-04 08:08:55 +00:00
Author
Owner

From the stack trace it looks like USSJoin was attempting to delete one of the child links when it goes this assertion failure.

From the stack trace it looks like USSJoin was attempting to delete one of the child links when it goes this assertion failure.
davidsarah commented 2010-03-25 00:32:04 +00:00
Author
Owner

Making such a directory isn't a problem in itself; this definitely looks like a bug in the webapi handling of DELETE.

Making such a directory isn't a problem in itself; this definitely looks like a bug in the webapi handling of DELETE.
tahoe-lafs added
code-frontend-web
and removed
code-dirnodes
labels 2010-03-25 00:32:04 +00:00
tahoe-lafs modified the milestone from undecided to 1.7.0 2010-03-25 00:32:04 +00:00
tahoe-lafs changed title from AssertionError when child links point to yourself to AssertionError on DELETE when child links point to yourself 2010-03-25 00:32:04 +00:00
davidsarah commented 2010-03-25 01:08:30 +00:00
Author
Owner

The assertion that failed is assert self.parentnode and self.name in DirectoryNodeHandler's [render_DELETE method]source:src/allmydata/web/directory.py#L140, i.e. either self.parentnode or self.name is falsy. Those fields are only set in the constructor, which is only called from [make_handler_for]source:src/allmydata/web/directory.py#L42, so we're looking for a call to make_handler_for with a missing or falsy parentnode or name argument. But there are quite a few calls to that, and the necessary context isn't on the reported stack trace.

I can see how you might get this error by trying to DELETE .../uri/URI:..., I think -- are we sure that USSJoin didn't attempt to do that?

The testgrid is down atm; I'll try some tests of this when it comes back up.

The assertion that failed is `assert self.parentnode and self.name` in DirectoryNodeHandler's [render_DELETE method]source:src/allmydata/web/directory.py#L140, i.e. either `self.parentnode` or `self.name` is falsy. Those fields are only set in the constructor, which is only called from [make_handler_for]source:src/allmydata/web/directory.py#L42, so we're looking for a call to make_handler_for with a missing or falsy `parentnode` or `name` argument. But there are quite a few calls to that, and the necessary context isn't on the reported stack trace. I can see how you might get this error by trying to DELETE `.../uri/URI:...`, I think -- are we sure that USSJoin didn't attempt to do that? The testgrid is down atm; I'll try some tests of this when it comes back up.
tahoe-lafs modified the milestone from 1.7.0 to soon 2010-06-19 01:33:50 +00:00
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference: tahoe-lafs/trac-2024-07-25#979
No description provided.