IP access list update returns INVALID_STATE

Cannot update IP access list. INVALID_STATE error message.

Written by Gobinath.Viswanathan

Last published at: March 4th, 2022

Problem

You are trying to update an IP access list and you get an INVALID_STATE error message.

{"error_code":"INVALID_STATE","message":"Your current IP 3.3.3.3 will not be allowed to access the workspace under current configuration"}

Cause

The IP access list update that you are trying to commit does not include your current public IP address. If your current IP address is not included in the access list, you are blocked from the environment.

If you assume that your current IP is 3.3.3.3, this example API call results in an INVALID_STATE error message.

%sh
curl -X POST -n \
  https://<databricks-instance>/api/2.0/ip-access-lists
  -d '{
    "label": "office",
    "list_type": "ALLOW",
    "ip_addresses": [
        "1.1.1.1",
        "2.2.2.2/21"
      ]
    }'

Solution

You must always include your current public IP address in the JSON file that is used to update the IP access list.

If you assume that your current IP is 3.3.3.3, this example API call results in a successful IP access list update.

%sh
curl -X POST -n \
  https://<databricks-instance>/api/2.0/ip-access-lists
  -d '{
    "label": "office",
    "list_type": "ALLOW",
    "ip_addresses": [
        "1.1.1.1",
        "2.2.2.2/21",
        "3.3.3.3"
      ]
    }'

Was this article helpful?