ricecooker icon indicating copy to clipboard operation
ricecooker copied to clipboard

Better error message when user runs out of storage

Open ivanistheone opened this issue 6 years ago • 2 comments

Description

When a user has run out of storage quota, this path will get triggered: https://github.com/learningequality/studio/blob/develop/contentcuration/contentcuration/views/internal.py#L134

Current state: Ricecooker currently exits: Screen Shot 2019-08-23 at 7 59 28 AM

Expected: handle error and print informative message to user (you have run out of storage)

ivanistheone avatar Aug 23 '19 12:08 ivanistheone

Is it solved?

devlakshay avatar Jul 22 '24 16:07 devlakshay

I don't think it's giving an informative error message still, as the exception is for any rejected request: https://github.com/learningequality/ricecooker/blob/213a3ca5ae47ce54dd72594184d6187020431a7b/ricecooker/managers/tree.py#L191

Noting that this doesn't prevent any of our retry behaviour, which we should do when there is insufficient storage.

We are also using a different endpoint now, so just checking for a status response of 412 might be sufficient (to see where that 412 is coming from, see here https://github.com/learningequality/studio/blob/unstable/contentcuration/contentcuration/viewsets/file.py#L163).

So, a solution here would be:

  • In the else block where we just throw an exception (https://github.com/learningequality/ricecooker/blob/213a3ca5ae47ce54dd72594184d6187020431a7b/ricecooker/managers/tree.py#L191) we should check if the response status code is a 412, and raise a specific exception saying the user is out of storage space.
  • Make sure this is propagating through the chain of calls of _handle_upload, upload_files, etc. and make sure we flag (maybe through an attribute on the ChannelManager object) that there is insufficient storage, so that we can raise an error in the main thread, and give a meaningful error to the user.

rtibbles avatar Jul 22 '24 16:07 rtibbles

hey, is this issue still open? I would really like to work on it!

the-ivii avatar Jan 24 '25 07:01 the-ivii

I have fixed the issue by adding an insufficient storage exception. Please review @rtibbles

the-ivii avatar Jan 24 '25 13:01 the-ivii

Thanks @Divyanshi750!

MisRob avatar Jan 27 '25 08:01 MisRob

Hi @rtibbles @MisRob,

I have closed the previous PR and raised a new one due to some technical difficulties. In this updated PR:

I have removed changes to unrelated files. I have added the audio-cache file to .gitignore, as requested. I sincerely apologize for raising a new PR and appreciate your understanding as I am new to the open-source community. Kindly review it when possible.

Thank you!

the-ivii avatar Jan 28 '25 18:01 the-ivii

Thank you @Divyanshi750 - that is fine. In future, it is also OK to do a force push to the same branch to update the existing PR in this sort of case.

rtibbles avatar Jan 29 '25 14:01 rtibbles

Fixed in #567

rtibbles avatar Feb 08 '25 20:02 rtibbles