AutoML “401 UNAUTHORIZED” problem

After “bash setup.sh install” is done, I try to
run sample code “tao_api_starter_kit/api/automl/classification.ipynb”.
I have a new problem look like this.

DevTools shows the problem is “401 UNAUTHORIZED”

How can I fix it?

Can you run below and share the result.
$ kubectl get services ingress-nginx-controller

Could you disable firewall and retry?

ufw disable

More, please make sure the ngc key is correct.

I disable firewall and generate new ngc key and follow
NVIDIA NGC” to setup, but still get the same error.

Could you run similar command as below to check if it can work?
$ curl -k https://127.0.1.1:32080/api/v1/login/bDNyourkey

I try both https and http.

Please try the new key since your key is already updated.

I follow “NVIDIA NGC” to setup and change the “ngc_api_key” in “quickstart_api_bare_metal/tao-toolkit-api-ansible-values.yml”.
Still get the same error.

How about
$ curl -k https://127.0.1.1:32080/api/v1/login/yournewkey

Could you replace “127.0.1.1” with the ip address of your master node and retry the curl command?

Get the same error.

Please help collect some logs.
$ kubectl get pods

then
$ kubectl logs tao-toolkit-api-app-pod-5858d657f9-5zqzr | sed “/health/d”

Where the exact pod name can be found with “kubectl get pods”

Please run below test.py to share the result.
$ vim test.py

import requests

key = “yourkey” # FIXME: use your latest NGC API KEY
r = requests.get(‘https://authn.nvidia.com/token’, headers={‘Accept’: ‘application/json’, ‘Authorization’: 'ApiKey ’ + key})
print(r.status_code)

$ export PYTHONPATH=/usr/lib/python3/dist-packages:$PYTHONPATH
$ python test.py

Beside test.py, you can also use curl as below.
$ curl --header ‘Accept: application/json’ --header ‘Authorization: ApiKey yourkey’ https://authn.nvidia.com/token

2023-01-11 08-48-17 的螢幕擷圖

So, the key seems to be correct.
Could you run with below test_1.py ?
$ vim test_1.py

import requests
endpoint = “http://127.0.1.1:32080/api/v1/login/yourkey
response = requests.get(endpoint)
user_id = response.json()[“user_id”]
print("user_id: ", user_id)

$ python test_1.py

That is the cell content of the notebook.
If not working, try to modify line3 as below and re-run.
response = requests.get(endpoint, verify=False)

I try both “requests.get(endpoint)” and “requests.get(endpoint, verify=False)”.
Both get <Response [401]>.

Suggest you to follow the method in 401 unauthorized: why?how to fix it? to narrow down.