Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

"databricks account ip-access-lists create" only creates disabled entries #1625

Closed
maxr-cyera opened this issue Jul 24, 2024 · 2 comments
Closed
Assignees
Labels
Bug Something isn't working CLI CLI related issues

Comments

@maxr-cyera
Copy link

maxr-cyera commented Jul 24, 2024

Describe the issue

When creating an IP access list using the CLI, it is created with enabled: false regardless of the enabled parameter.

Steps to reproduce the behavior

Please list the steps required to reproduce the issue, for example:

  1. Run databricks account ip-access-lists create --json '{"list_type":"ALLOW","enabled":true,"ip_addresses":["0.0.0.0/32"],"label":"test"}'
  2. The response returns a disabled list

Expected Behavior

The created list enabled state should align with the parameter.

Actual Behavior

The state is always false regardless of the parameter value.

OS and CLI version

Sonoma 14.5, Databricks CLI v0.224.0

Is this a regression?

No

Debug Logs

18:00:47  INFO start pid=2971 version=0.224.0 args="databricks, account, ip-access-lists, create, --json, {\"list_type\":\"ALLOW\",\"enabled\":true,\"ip_addresses\":[\"0.0.0.0/32\"],\"label\":\"test1\"}, --debug"
18:00:47 DEBUG /Users/max/.databrickscfg has no DEFAULT profile configured pid=2971 sdk=true
Using account profile: account-admin
18:00:48 DEBUG Loading account-admin profile from /Users/max/.databrickscfg pid=2971 sdk=true
18:00:48  INFO Ignoring pat auth, because databricks-cli is preferred pid=2971 sdk=true
18:00:48  INFO Ignoring basic auth, because databricks-cli is preferred pid=2971 sdk=true
18:00:48  INFO Ignoring oauth-m2m auth, because databricks-cli is preferred pid=2971 sdk=true
18:00:48  INFO Refreshed OAuth token from Databricks CLI, expires on 2024-07-24 18:17:35.029517 +0300 IDT pid=2971 sdk=true
18:00:48 DEBUG Using Databricks CLI authentication with Databricks OAuth tokens pid=2971 sdk=true
18:00:48  INFO Refreshed OAuth token from Databricks CLI, expires on 2024-07-24 18:17:35.029517 +0300 IDT pid=2971 sdk=true
18:00:49 DEBUG POST /api/2.0/accounts/ACCOUNT_ID/ip-access-lists
> {
>   "ip_addresses": [
>     "0.0.0.0/32"
>   ],
>   "label": "test1",
>   "list_type": "ALLOW"
> }
< HTTP/2.0 200 OK
< {
<   "ip_access_list": {
<     "address_count": 1,
<     "created_at": 1721833249635,
<     "created_by": userID,
<     "enabled": false,                     <------ False is being sent even though the parameter is true
<     "ip_addresses": [
<       "0.0.0.0/32"
<     ],
<     "label": "test1",
<     "list_id": "07e46c7e-d404-4b2e-8cb7-8a51438c8b78",
<     "list_type": "ALLOW",
<     "updated_at": 1721833249635,
<     "updated_by": userID
<   }
< } pid=2971 sdk=true
{
  "ip_access_list": {
    "address_count":1,
    "created_at":1721833249635,
    "created_by":userID,
    "enabled":false,
    "ip_addresses": [
      "0.0.0.0/32"
    ],
    "label":"test1",
    "list_id":"07e46c7e-d404-4b2e-8cb7-8a51438c8b78",
    "list_type":"ALLOW",
    "updated_at":1721833249635,
    "updated_by":userID
  }
}
@maxr-cyera maxr-cyera added the CLI CLI related issues label Jul 24, 2024
@shreyas-goenka shreyas-goenka added the Bug Something isn't working label Jul 24, 2024
@andrewnester
Copy link
Contributor

This is related to this issue in Go SDK databricks/databricks-sdk-go#1002

@andrewnester andrewnester self-assigned this Oct 4, 2024
github-merge-queue bot pushed a commit that referenced this issue Oct 11, 2024
## Changes
Added JSON input validation for CLI commands. Now when invalid JSON
passed as a payload to CLI commands, CLI performs input normalisation
and detects if there are any mismatches such as incorrect types, unknown
fields and etc.

This diagnostic information is printed in standard error output and does
not block command execution, so the change is backward compatible.

Fixes #1769 #1764 #1625 #1560


## Tests
Added unit tests

```
andrew.nester@HFW9Y94129 ~ % databricks jobs create --json '{"seeti}'
Error: error decoding JSON at (inline):1:2: unexpected EOF


andrew.nester@HFW9Y94129 ~ % databricks jobs create --json '{"seeti": true}'
Warning: unknown field: seeti
  in (inline):1:9

Error: Job settings must be specified.
```

---------

Co-authored-by: Pieter Noordhuis <[email protected]>
@andrewnester
Copy link
Contributor

The fix has been merged in #1771 and will be released in the next CLI release

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug Something isn't working CLI CLI related issues
Projects
None yet
Development

No branches or pull requests

3 participants