Skip to content

bundle: report a directory at a state path as "not a file" - #7087

Open
denik wants to merge 1 commit into
mainfrom
denik/state-dir-not-a-file
Open

denik wants to merge 1 commit into
mainfrom
denik/state-dir-not-a-file

Conversation

@denik

@denik denik commented Oct 16, 2026 •

Copy link
Copy Markdown
Contributor

Changes

When a remote state file fails to parse and starts with a ZIP header, report not a file: the workspace has a directory at this path. The test server now exports a directory as a ZIP archive, as the real API does.

Why

On a real workspace, /workspace/export?direct_download=true of a directory returns 200 with a ZIP archive rather than an error (checked on a real workspace; a missing path returns 404 RESOURCE_DOES_NOT_EXIST). That is what the get-status guard from #449 protected against; since #7075 dropped it, a directory failed with parsing state: invalid character 'P'. This brings the clear message back without the extra request.

Tests

New acceptance/bundle/state/directory_at_state_path, a cloud test; passes locally and against a real workspace, fails without the fix.

This pull request and its description were written by Isaac.

@denik
denik requested review from a team as code owners October 16, 2026 09:24
@denik
denik requested a review from pietern October 16, 2026 09:24
@denik
denik added this pull request to stack #7089 October 16, 2026 09:24
@denik
denik removed this pull request from stack #7089 October 16, 2026 09:31
@denik
denik force-pushed the denik/state-dir-not-a-file branch from 2be277b to 96dead2 Compare October 16, 2026 09:39
@denik
denik changed the base branch from denik/dms-prefetch-node to main October 16, 2026 09:39
@github-actions github-actions Bot added the DABs DABs related issues label Oct 16, 2026
@denik
denik added this pull request to stack #7091 October 16, 2026 09:39
@eng-dev-ecosystem-bot

eng-dev-ecosystem-bot commented Oct 16, 2026 •

Copy link
Copy Markdown
Collaborator

Integration test report

Commit: 12aa36b

Run: 38890739173

Env ✅​pass 🙈​skip Time
✅​ aws linux-2core-8gb 279 15 5:37
✅​ aws-windows-latest-4core-16gb 281 13 3:50
✅​ azure linux-2core-8gb 278 15 5:32
✅​ azure-windows-latest-4core-16gb 280 13 3:54
✅​ gcp linux-2core-8gb 279 15 5:32
✅​ gcp-windows-latest-4core-16gb 281 13 3:50
Top 6 slowest tests (at least 2 minutes):
duration env testname
3:50 azure linux-2core-8gb TestAccept
3:47 gcp linux-2core-8gb TestAccept
3:42 aws linux-2core-8gb TestAccept
3:38 azure-windows-latest-4core-16gb TestAccept
3:35 gcp-windows-latest-4core-16gb TestAccept
3:24 aws-windows-latest-4core-16gb TestAccept

The workspace exports a directory as a ZIP archive even with direct_download=true, so since
the state read stopped calling get-status first, a directory there failed with a JSON parse
error on the archive. Recognize the ZIP header and say what is wrong. The test server now
exports directories the same way.

Co-authored-by: Isaac <no-reply@databricks.com>
@denik
denik force-pushed the denik/state-dir-not-a-file branch from 96dead2 to 12aa36b Compare October 16, 2026 10:57

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

DABs DABs related issues

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants