Skip to content

Conversation

@sulkaharo
Copy link
Member

(Don't merge yet!)

@sulkaharo sulkaharo mentioned this pull request Jul 30, 2018
@sulkaharo
Copy link
Member Author

Is there a good way to surface this to users?

@jasoncalabrese
Copy link
Member

I think we should still return a 500 so the client deal with it. Is this mostly for device status? I was wondering it we should rename the old collection on startup if it's too big, then start using a new collection and ignore the old.

@sulkaharo
Copy link
Member Author

At least for mLab, looks like all inserts to all collections start failing at the same time, so it’s not specific to the device status collection, other than it being the collection that seems to get the most data.

@sulkaharo
Copy link
Member Author

@jasoncalabrese so, instead of just returning, throw the error?

@sulkaharo sulkaharo added this to the 0.11.0 milestone Jul 31, 2018
@PieterGit
Copy link
Contributor

@jasoncalabrese @sulkaharo
I think logging an error for 0.10.3 in the console is better than crashing Heroku. We can do the 500 server error stuff in 0.11. Thoughts?

@jasoncalabrese
Copy link
Member

What's the behavior when the db is full "crashing heroku" sounds extreme...

I think to return a 500, we just need to call the callback passing an error something like fn(new Error('insert failed'), null) instead of the fn(null, doc.ops) that gets call on success

Copy link
Contributor

@PieterGit PieterGit left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I hope either @jpcunningh or @jasoncalabrese can fix the PR so that it does what @jasoncalabrese suggest of returning a 500 (and logging info the console log). I don't get how this code works, so I would rather not touch it 😀 . Quite some people on Gitter have problems with full Mongo databases, so it would be good that for 0.11 we make sure we log it and return a 500 error to the uploader.

@jpcunningh
Copy link
Collaborator

@jasoncalabrese, the app crashes when the database fails to insert any records due to a null dereference. The only way to recover is to free up space through either the Heroku dashboard link to mLab, clearing a whole collection, or some means other than Nightscout admin tools.

@sulkaharo, is it best if I submit a PR to your account's wip/devicestatus_insert_err branch for the lib/server/* modules to return 500?

@PieterGit
Copy link
Contributor

@jpcunningh I don't mind if we PR this with this PR or with #3989 . I assume @jasoncalabrese and @sulkaharo are quite busy at this moment, because I haven't seen them a lot the last few weeks. I will accept any tested PR that will log an error and return 500 to the client 😄

@jpcunningh
Copy link
Collaborator

@PieterGit, I created a new PR #4004 that returns 500 to the client.

@PieterGit
Copy link
Contributor

Merged #4004 instead. Closing this PR

@PieterGit PieterGit closed this Oct 23, 2018
@sulkaharo sulkaharo deleted the wip/devicestatus_insert_err branch March 3, 2019 10:34
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants