databricks / databricks-sdk-go

Databricks SDK for Go
https://docs.databricks.com/dev-tools/sdk-go.html
Apache License 2.0
46 stars 38 forks source link

[ISSUE] databricks CLI can't copy from dbfs #928

Open jenry-h opened 1 month ago

jenry-h commented 1 month ago

Description

C:\Users\hhofstaedter>databricks fs cp dbfs:/FileStore/df/commands2_advation_2024-04-21_05-23.csv . Error: unexpected error handling request: json: cannot unmarshal number into Go struct field APIErrorBody.error_code of type string. This is likely a bug in the Databricks SDK for Go or the underlying REST API. Please report this issue with the following debugging information to the SDK issue tracker at https://github.com/databricks/databricks-sdk-go/issues. Request log:

GET /api/2.0/dbfs/get-status?path=/FileStore/df/commands2_advation_2024-04-21_05-23.csv
> * Host:
> * Accept: application/json
> * Authorization: REDACTED
> * User-Agent: cli/0.218.0 databricks-sdk-go/0.38.0 go/1.21.9 os/windows cmd/fs_cp auth/pat
< HTTP/2.0 403 Forbidden
< * Access-Control-Allow-Headers: Authorization, X-Databricks-Azure-Workspace-Resource-Id, X-Databricks-Org-Id, Content-Type
< * Access-Control-Allow-Origin: *
< * Cache-Control: no-cache, no-store, must-revalidate
< * Content-Length: 70
< * Content-Type: application/json; charset=utf-8
< * Date: Wed, 22 May 2024 14:32:32 GMT
< * Expires: 0
< * Pragma: no-cache
< * Server: databricks
< * Vary: Accept-Encoding
< * X-Databricks-Reason-Phrase: Invalid access to Org: 3352391956719492
< {
<   "error_code": 403,
<   "message": "Invalid access to Org: 3352391956719492"
< }

Reproduction databricks fs cp dbfs:/FileStore/df/commands2_advation_2024-04-21_05-23.csv .

Expected behavior No error. File should have been copied

Is it a regression? Formerly it copied files from such accounts

Debug Logs The SDK logs helpful debugging information when debug logging is enabled. Set the log level to Trace by configuring the default logger to log at trace (for example: add logger.DefaultLogger = &logger.SimpleLogger{Level: logger.LevelTrace} to your program), and include the logs here.

Other Information

Additional context Add any other context about the problem here.