You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Show a clear error if the Network permission is revoked (GrapheneOS) #752
A user on GrapheneOS (Pixel 6 Pro, Android 17, app 4.24.0) reports that no PDF opens anymore. The app shows only a generic error. The same files open on Linux and Windows.
Cause
The logcat that the user sent shows that the app cannot create any socket, not even on loopback:
E ODR : java.io.IOException: core server cannot bind 127.0.0.1:29665
Caused by: app.opendocument.core.OdrException: server bind failed: 127.0.0.1:29665
E ODR : java.io.IOException: core server cannot bind any port
E ODR : app.opendocument.core.OdrException: server is not bound
...
E chromium: [ERROR:net/socket/socket_posix.cc:121] CreatePlatformSocket() failed: Operation not permitted (1)
E ODR : java.lang.RuntimeException: loading http://localhost:29665/file/odr0/document.html failed: -1 net::ERR_ACCESS_DENIED
socket() returns EPERM. GrapheneOS does this when the user turns off the Network permission of an app, because it removes the inet group from the app. The core HTTP server and the WebView both need a loopback socket, so every document fails, not only PDFs.
This is the same failure as #411, where the F-Droid build had no INTERNET permission. Here the user revoked the permission at runtime.
Proposal
If the core server cannot bind, show a specific message, for example: "Allow the Network permission. The app uses it only on this device, to show documents."
Optionally, link to the settings page of the app from that message.
Optionally, check for the failure before the user opens a file, so the user sees the message at start.
The app cannot tell EPERM from other bind failures today, because the core drops the errno. See the core follow-up below. Until then, a failed bind on both the fixed port and port 0 is a strong signal for a missing Network permission.
Related
Core: ServerBindFailed in src/odr/http_server.cpp does not keep the errno. A core change can expose it, so that the app can match EPERM exactly.
The log reports odrcore unknown version (fae77ff7…) [dirty] for the 4.24.0 release. The release build seems to come from a dirty tree without a version tag.
Activity
feat(http): report a denied socket and the reason of a failed bind (#…
andiwand commentedon Nov 14, 2026
should be fixed after #757