Skip to content

Attempting to save an image-rich presentation causes an error from Mongo #69

Open

Description

@banksJeremy

The error that shows up in Mongo's log is vague...

Assertion: 10334:Invalid BSONObj size: 21942433

... but it looks like Mongo has a maximum document size the defaults to 16MB and I might be hitting due to having a lot of embedded images.

Butter keeps waiting for a response from Mongo that never comes, so it never closes the connection to the browser, causing a silent failure from the user's perspective.

Activity

  1. banksJeremy commented on Jun 14, 2012

    @banksJeremy
    CollaboratorAuthor

    Inside the handler for app.post('/api/project/:id?', ...) in butter/cornfield/app.js I replaced

    doc.save();
    res.json({ error: 'okay', project: proj });
    

    with

    doc.save(function (err) {
      if ( !err ) {
        res.json({ error: 'okay', project: proj });
      } else {
        res.json( {error: 'internal db error' }, 500 );
      }
    });
    

    to fail better. (banksJeremy/butter@4eececb)

    This works, and now I'm confused why the failure left a connection open. I'd think that .save() would be async and return instantly, so res.json(...) would be called and close the connection in either case. Maybe it's not async? Weird.

  2. banksJeremy commented on Jun 18, 2012

    @banksJeremy
    CollaboratorAuthor

    Filed upstream: t1603

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions