Hacktoberfest 2026: những issue maintainer đã đánh dấu cho tháng Mười, đang mở và phù hợp người mới. Xem issue Hacktoberfest

databricks fs cp fails when volume is empty

Đang mở
#5,834 2 bình luận 0 reaction 0 người được giao Xem trên GitHub

Maintainer thường phản hồi trong vòng 1 ngày

Chưa có ai nhận issue này.

Đánh giá

Độ khó
3/5
Thời gian dự kiến
1-2 ngày
Mức phù hợp với người mới
74/100
Loại issue
Lỗi
Độ rõ ràng
Đặc tả rõ ràng
Mức độ hoạt động
Sôi nổi
Công nghệ
go
Lĩnh vực
api, cli

Hướng nghiên cứu

Bắt đầu từ đường dẫn của lệnh databricks fs cp và theo dõi các bước kiểm tra sự tồn tại của thư mục đối với Files API, đặc biệt là các yêu cầu HEAD tới /api/2.0/fs/directories và /api/2.0/fs/files. Tái hiện với một UC managed volume hiện có nhưng trống, sau đó xác minh rằng việc sao chép một tệp thành công mà không coi các phản hồi 404 của volume trống là đích không tồn tại.

Do mô hình lập chỉ mục viết ra từ nội dung của issue.

Mô tả

Bug CLI Stale

Describe the issue

databricks fs cp fails with "Bad Request" when copying a file to a UC managed volume that exists but is empty. The CLI performs a directory existence check via the Files API before writing, and an empty UC volume returns HTTP 404 for that check — causing the CLI to abort instead of writing the file.

Steps to reproduce the behavior

  1. Create a UC managed volume: databricks volumes create mycatalog myschema myvol MANAGED
  2. Upload a file to it: databricks fs cp myfile.xml dbfs:/Volumes/mycatalog/myschema/myvol/ (succeeds)
  3. Delete all files from the volume (e.g. via the Databricks UI)
  4. Re-run the same databricks fs cp command

Expected Behavior

The file is uploaded successfully. The volume object still exists; only its contents were deleted. A write operation to an existing volume should not depend on whether the volume currently has any files in it.

Actual Behavior

The command fails with Error: Bad Request. The CLI calls HEAD /api/2.0/fs/directories/Volumes/mycatalog/myschema/myvol before writing. An empty UC volume returns 404 for this endpoint. The CLI interprets this as "no such directory" and aborts without writing the file.

Debug trace:
HEAD /api/2.0/fs/directories/Volumes/mycatalog/myschema/myvol → 404 Not Found
HEAD /api/2.0/fs/files/Volumes/mycatalog/myschema/myvol → 404 Not Found
HEAD /api/2.0/fs/directories/Volumes/mycatalog/myschema → 400 Bad Request
Error: Bad Request

The volume object exists throughout — databricks volumes read mycatalog.myschema.myvol returns full metadata. The --overwrite flag does not help; the same error occurs.

Workaround: Use the Files REST API directly — PUT /api/2.0/fs/files/Volumes/mycatalog/myschema/myvol/myfile.xml — which writes unconditionally without a prior directory check.

OS and CLI version

  • CLI: Databricks CLI v1.3.0
  • OS: Linux 5.10.16.3 (WSL2 on Windows)

Is this a regression?

Unknown — this was first observed on v1.3.0. Not tested on earlier versions.

Debug Logs

GET /api/2.0/fs/directories/Volumes/mycatalog/myschema/myvol
< HTTP/2 404
HEAD /api/2.0/fs/directories/Volumes/mycatalog/myschema/myvol
< HTTP/2 404
HEAD /api/2.0/fs/files/Volumes/mycatalog/myschema/myvol
< HTTP/2 404
HEAD /api/2.0/fs/directories/Volumes/mycatalog/myschema
< HTTP/2 400
Error: Bad Request

Ngôn ngữ chính
Go
Star
404
Fork
246
Merge trung bình
1 ngày 11 giờ
Pull request đã merge (30 ngày)
268

Chuẩn bị môi trường

  • Có Dockerfile hoặc tệp Docker Compose
  • Có mẫu pull request
  • Không có hướng dẫn đóng góp

Bắt đầu từ đâu

  1. Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
  2. Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
  3. Fork repository và làm thay đổi trên một nhánh.
  4. Mở pull request có tham chiếu số hiệu của issue.

Issue khác của databricks/cli

Tất cả issue của databricks/cli

Issue tương tự

Thêm issue về Go

Nhận issue mới trong hộp thư của bạn

Bản tóm tắt ngắn những issue GitHub phù hợp với người mới.