Skip to content

fix: use Azurite-compatible URL format for signed_upload_url#216

Open
carjessu-trm wants to merge 1 commit intofalcondev-oss:devfrom
trmlabs:fix/azurite-compatible-upload-url
Open

fix: use Azurite-compatible URL format for signed_upload_url#216
carjessu-trm wants to merge 1 commit intofalcondev-oss:devfrom
trmlabs:fix/azurite-compatible-upload-url

Conversation

@carjessu-trm
Copy link
Copy Markdown

Problem

actions/cache@v4.2.0+ (and any action using @actions/cache v4+) hardcodes useAzureSdk: true in saveCacheV2(). This passes the signed_upload_url returned by CreateCacheEntry to the Azure BlobClient constructor, which expects URLs in Azure Blob Storage format.

The current URL format:

{API_BASE_URL}/upload/{id}

…causes the Azure SDK to fail with:

Warning: Failed to save: Unable to extract blobName and containerName with provided information.

The upload handler already correctly handles Azure SDK requests (comp=blocklist, blockid query params), but the URL format prevents the BlobClient constructor from parsing it.

Solution

Change the upload URL to use Azurite-compatible format:

{API_BASE_URL}/devstoreaccount1/upload/{id}

The Azure SDK recognizes devstoreaccount1 as the Azurite storage emulator account name, and correctly extracts:

  • accountName: devstoreaccount1
  • containerName: upload
  • blobName: {id}

The original /upload/{id} route is preserved for backward compatibility (e.g., tonistiigi/go-actions-cache used by Docker buildx).

Changes

  1. CreateCacheEntry.post.ts: Updated signed_upload_url to include /devstoreaccount1 prefix
  2. routes/devstoreaccount1/upload/[uploadId].put.ts: Added route handler at the Azurite-compatible path (identical to the existing upload handler)

Testing

Tested with:

  • actions/cache@v4 (v4.3.0) — cache save succeeds
  • actions/setup-node@v4 with cache: npm — cache save succeeds
  • Self-hosted ARC runners on GKE with GCS storage driver
  • enableDirectDownloads: true

Fixes #203

Made with Cursor

`actions/cache@v4.2.0+` hardcodes `useAzureSdk: true` in `saveCacheV2()`,
which passes the `signed_upload_url` from `CreateCacheEntry` to the Azure
`BlobClient` constructor. The constructor expects URLs in Azure Blob format
(or Azurite format for non-Azure hosts) and fails to parse the current
`/upload/{id}` path with:

  "Unable to extract blobName and containerName with provided information."

This changes the upload URL from:
  `{API_BASE_URL}/upload/{id}`
to:
  `{API_BASE_URL}/devstoreaccount1/upload/{id}`

The Azurite-style path (`/devstoreaccount1/<container>/<blob>`) is recognized
by the Azure SDK as a valid storage emulator URL, allowing it to extract:
  - accountName: "devstoreaccount1"
  - containerName: "upload"
  - blobName: "{id}"

The upload handler at the new path is identical to the existing one. The
original `/upload/{id}` route is preserved for backward compatibility.

Fixes falcondev-oss#203

Made-with: Cursor
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.

actions/cache@v4 save fails: “Unable to extract blobName and containerName …” with github-actions-cache-server (sqlite/filesystem driver)

1 participant