MuntashirAkon/AppManager · error

IOException(REMOTE_ERR_MSG, throwable)

Error message

IOException(REMOTE_ERR_MSG, throwable)

What it means

IOResult is a Parcelable wrapper for a value returned from a remote IFileSystemService call; if that value is actually a Throwable thrown remotely, checkException() rethrows it locally as IOException(REMOTE_ERR_MSG, cause). This is how the library propagates exceptions that occurred in a remote file-system service process back to the caller.

Source

Thrown at libcore/io/src/main/java/io/github/muntashirakon/io/IOResult.java:34

    private final Object val;

    IOResult() {
        val = null;
    }

    IOResult(Object v) {
        val = v;
    }

    @Override
    public void writeToParcel(Parcel dest, int flags) {
        dest.writeValue(val);
    }

    void checkException() throws IOException {
        if (val instanceof Throwable) {
            throw new IOException(REMOTE_ERR_MSG, (Throwable) val);
        }
    }

    void checkErrnoException() throws ErrnoException, RemoteException {
        if (val instanceof ErrnoException) {
            throw (ErrnoException) val;
        } else if (val instanceof Throwable) {
            Throwable th = (Throwable) val;
            throw (RemoteException) new RemoteException(th.getMessage()).initCause(th);
        }
    }

    @SuppressWarnings("unchecked")
    <T> T tryAndGet() throws IOException {
        checkException();
        return (T) val;
    }

View on GitHub (pinned to 0152f468fc)

Solutions

  1. Inspect getCause() of the IOException to find the original remote exception
  2. Fix the root cause in the remote service (permissions, path validity) or ensure it returns ErrnoException-based failures instead of raw Throwables
  3. Check that the remote service process has the same or greater file access rights than expected

Example fix

// before
try { fm.getFile(path).delete(); } catch (IOException e) { /* opaque */ }
// after
try { fm.getFile(path).delete(); }
catch (IOException e) {
    Throwable remote = e.getCause();
    Log.e(TAG, "remote op failed", remote); // diagnose actual remote failure
}
Defensive patterns

Strategy: try-catch

Type guard

if (ioException.getCause() instanceof ErrnoException) { ErrnoException errno = (ErrnoException) ioException.getCause(); /* branch on errno */ }

Try / catch

try { result = remoteOp(); } catch (IOException e) { Throwable c = e.getCause(); log("remote failure", c); /* rethrow as domain error or retry */ }

Prevention

When it happens

Trigger: Calling FileSystemManager methods backed by a remote binder (createRemote) whose remote operation threw any Throwable (e.g. an IOException or RuntimeException inside the service); the stub returns it in the IOResult and tryAndGet calls checkException(), which rethrows it wrapped.

Common situations: Remote service crashes or throws while accessing files the service process cannot reach; binder calls across process boundaries where the remote side lacks permissions; dead or misbehaving IFileSystemService implementations.

Related errors


AI-assisted analysis of MuntashirAkon/AppManager@0152f468fc (2026-09-12). Data as JSON: /api/errors/85e532153b1691d6. Report an issue: GitHub.