Sentry Issue: WORDPRESS-ANDROID-8PN
ErrnoException: write failed: ENOSPC (No space left on device)
at libcore.io.Posix.writeBytes(Posix.java)
at libcore.io.Posix.write(Posix.java:258)
at libcore.io.BlockGuardOs.write(BlockGuardOs.java:313)
at libcore.io.IoBridge.write(IoBridge.java:497)
at java.io.FileOutputStream.write(FileOutputStream.java:186)
...
(32 additional frame(s) were not displayed)
IOException: write failed: ENOSPC (No space left on device)
at libcore.io.IoBridge.write(IoBridge.java:502)
at java.io.FileOutputStream.write(FileOutputStream.java:186)
at java.io.DataOutputStream.writeShort(DataOutputStream.java:192)
at java.io.ObjectOutputStream.writeStreamHeader(ObjectOutputStream.java:1795)
at java.io.ObjectOutputStream.<init>(ObjectOutputStream.java:271)
...
(29 additional frame(s) were not displayed)
AztecLoggingException: java.io.IOException: write failed: ENOSPC (No space left on device)
at org.wordpress.android.ui.posts.EditPostActivity$10.logException(EditPostActivity.java:1792)
at org.wordpress.android.ui.posts.EditPostActivity.onSaveInstanceState(EditPostActivity.java:813)
...
(26 additional frame(s) were not displayed)
java.io.IOException: write failed: ENOSPC (No space left on device)
Zero events were tracked for this crash in 14.6.1 since it was released 9d ago on Apr 22.
Number of events recorded in the last 90d: 53
Number of users affected in the last 90d: 2
Limited to: Android 5.1 and 5.1.1
https://sentry.io/share/issue/e6732d26bd794f638697faa0721de079/
Events in the last 90d: 53
Events in the last 9d since 14.8 was released: 10
Users affected in the last 90d: 1
Limited to: Android 5.1
https://sentry.io/share/issue/e6732d26bd794f638697faa0721de079/
Recommend closing because we only seem to have recorded crash data for 1 user in the past 90d.
https://sentry.io/share/issue/e6732d26bd794f638697faa0721de079/ is returning "Page Not Found" now.
Expanding the search to show all crashes with "ENOSPC" returns 1,132 occurrences in the last 90d:
Is it normal for an app to crash if there is no space left on the device or is there something we can do to help users in that situation?
Is it normal for an app to crash if there is no space left on the device or is there something we can do to help users in that situation?
When the system reaches the "no space left" state, I don't think there is anything we can do. Having said that, there are things we can do to help preventing it from happening.
The fact that the number of occurrences has been raising since June (at least) is quite suspicious. I looked into the release-notes for v14.8 - 15.0 which were released around that time. The only thing that caught my eye was the "Media editor", but I verified it removes old files.
I looked into how we handle media files in general. It seems we never manually/explicitly remove files from the cache folder (only the Media Editor cleans up after itself). This shouldn't be a big deal, since the system is free to remove the entire folder when it is running out of space. However, the documentation says that devs shouldn't rely on this behavior . Having said that, I don't think this is the root cause of these crashes since AFAIK we were never deleting these files.
I wanted to implement a naive solution, but decided against it as it might have performance impact. I'd consider one of the following:
Next Steps:
A search for "ENOSPC" in Sentry > Discover returns 4,267 occurrences in the last 90 days:
I love the proposed solution to provide an option to clear cache if we can detect a device is running out of space. This would help the user experience because it helps explain a problem that might be otherwise hidden for many people.
This would help the user experience because it helps explain a problem that might be otherwise hidden for many people.
Yep, I agree it'd be a nice improvement. @yaelirub +- 50 users are affected per day, should we schedule this improvement?
Note: One thing we might want to double-check is size of application logs we store on the user device. Perhaps this issue isn't related to media files but to application logs. I'm not sure if we store them to the cache folder or somewhere else.
Most helpful comment
When the system reaches the "no space left" state, I don't think there is anything we can do. Having said that, there are things we can do to help preventing it from happening.
The fact that the number of occurrences has been raising since June (at least) is quite suspicious. I looked into the release-notes for v14.8 - 15.0 which were released around that time. The only thing that caught my eye was the "Media editor", but I verified it removes old files.
I looked into how we handle media files in general. It seems we never manually/explicitly remove files from the
cachefolder (only the Media Editor cleans up after itself). This shouldn't be a big deal, since the system is free to remove the entire folder when it is running out of space. However, the documentation says that devs shouldn't rely on this behavior . Having said that, I don't think this is the root cause of these crashes since AFAIK we were never deleting these files.I wanted to implement a naive solution, but decided against it as it might have performance impact. I'd consider one of the following:
Next Steps: