Skip to content

[BUG] (Read-only file system) error when saving IPP job files on AndroidΒ #2

@AshishYesale7

Description

@AshishYesale7

πŸ“ Issue Description

Describe the bug:
When executing a print command from a remote client (e.g., macOS using lp), the Virtual Printer receives the IPP request but fails to save the job data due to a filesystem permission error:

❯ lp -h Android_OKAN6RTJ.local:3000 -d "Virtual_Printer_(CPH2381)" /Users/username/Downloads/extensions.txt
lp: No such file or directory

Debug Logs:

ACTION START IPP VIRTUAL PRINTER  
req:POST / from:fe80::1  
Failed to save IPP job:  
print_job_1745326755245.ipp: open failed:  
EROFS (Read-only file system)
Image

Root Cause:
The IPP server attempts to write the job file using File(filename).writeBytes(buffer) in a directory where it doesn't have write permissions. Android sandboxing likely defaults to a read-only path in some contexts.


βœ… Suggested Fix

Use the app-specific storage directory (context.cacheDir or context.filesDir) for writing files instead of the default working directory.

Example fix:

val filename = File(context.cacheDir, "print_job_${System.currentTimeMillis()}.ipp")
filename.writeBytes(buffer)

πŸ“Œ This will ensure the app writes to a valid path with permissions on Android devices.


Let me know if you want help patching this or linking it with your Git commits!

Metadata

Metadata

Assignees

Labels

No labels
No labels

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions