Skip to content

Fix Base64 file upload failing on read-only filesystems#175

Open
Copilot wants to merge 3 commits intomainfrom
copilot/fix-upload-file-base64-issue
Open

Fix Base64 file upload failing on read-only filesystems#175
Copilot wants to merge 3 commits intomainfrom
copilot/fix-upload-file-base64-issue

Conversation

Copy link

Copilot AI commented Mar 25, 2026

GetFileForFileUpload uses os.Create(request.FileName) to materialize Base64-decoded data, writing to CWD. This fails in containers with read-only filesystems:

500 Internal Error: skyflow upload file: code=Code: 400 message=Message: failed to create file

Changes

  • os.Createos.CreateTemp — temp file created in OS temp dir (/tmp) instead of CWD
  • os.Remove(request.FileName)os.Remove(file.Name()) — reference actual temp path for cleanup
  • Early validation when Base64 is set but FileName is empty (previously fell through to os.Create(""))
  • Test update — invalid base64 test now supplies FileName to exercise the decode path rather than hitting the new validation

Copilot AI and others added 3 commits March 25, 2026 23:17
…or Base64 uploads

Replace os.Create(request.FileName) with os.CreateTemp to create temporary
files in the OS temp directory instead of the current working directory.
This fixes failures in containers with read-only filesystems.

Also adds explicit FileName validation when Base64 is provided, and uses
file.Name() for the os.Remove call to correctly reference the temp file.

Co-authored-by: jstjoe <2015604+jstjoe@users.noreply.github.com>
Agent-Logs-Url: https://github.com/skyflowapi/skyflow-go/sessions/d8435c8e-77d9-4774-9041-b8ea37a9977b
Co-authored-by: jstjoe <2015604+jstjoe@users.noreply.github.com>
Agent-Logs-Url: https://github.com/skyflowapi/skyflow-go/sessions/d8435c8e-77d9-4774-9041-b8ea37a9977b
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants