Closed zagorsky closed 6 years ago
So we CAN catch this error, but the whole file writing stack makes guarantees about providing the encryption key in the file, so "handling" this failure mode is hugely problematic.
However, the statement above does provide an avenue of investigation worth tracking down because we might be silently failing to provide the encryption key in some very rare scenarios.
@sesterki can you please try to figure out what the failure mode is here?
We've seen at least one instance where we got an ENOSPC from a specific patient ID, and then we got OurBase64Error: Incorrect padding
on beiwe-backend with files uploaded from that same patient ID.
So when writes fail, does it write a partial line, instead of a full line? And is there a way we can prevent that, i.e., make it either write the full line or write nothing at all?
Error handling in commit e092597b78042d0d54885c9cb778410daeb3c01e
This error should happen differently on app versions greater than 2.3.3. It should still throw Sentry errors, but it shouldn't create corrupted files. Instead, it should keep trying to create a new file until it finally succeeds.
I don't think there's any easy fix for this. https://sentry.io/onnela-lab/production/issues/461716189/ https://sentry.io/onnela-lab/production/issues/461936990/ https://sentry.io/onnela-lab/production/issues/456211258/ https://sentry.io/onnela-lab/production/issues/483309548/ https://sentry.io/onnela-lab/production/issues/498048356/
Example stack trace: