NGC API Key is invalid. Please check and try again

When executing the command-
bash jarvis_init.sh, It is failing with

Logging into NGC docker registry if necessary…
NGC API Key is invalid. Please check and try again.

turing enabled machine
Steps followed-

[root@xxx /]# wget -O ngccli_linux.zip https://ngc.nvidia.com/downloads/ngccli_linux.zip && unzip -o ngccli_linux.zip && chmod u+x ngc
–2021-07-20 15:36:50-- https://ngc.nvidia.com/downloads/ngccli_linux.zip
Resolving ngc.nvidia.com (ngc.nvidia.com)… 99.86.100.121, 99.86.100.9, 99.86.100.124, …
Connecting to ngc.nvidia.com (ngc.nvidia.com)|99.86.100.121|:443… connected.
HTTP request sent, awaiting response… 200 OK
Length: 25118063 (24M) [application/zip]
Saving to: ‘ngccli_linux.zip’

100%[===========================================================================================================>] 25,118,063 24.7MB/s in 1.0s

2021-07-20 15:36:51 (24.7 MB/s) - ‘ngccli_linux.zip’ saved [25118063/25118063]

Archive: ngccli_linux.zip
inflating: ngc
extracting: ngc.md5
[root@xxx /]# echo “export PATH=”$PATH:$(pwd)"" >> ~/.bash_profile && source ~/.bash_profile
[root@xxx /]# ngc config set
Enter API key [****************************************************************cWU4MDQ2YzZmbGM3YWZwdjZtNDNyMmZnYTU6MTExZGFiZjItNDFhMy00OTczLTljMTEtMWQ5ODJhMGE0MTY4
Enter CLI output format type [json]. Choices: [ascii, csv, json]: json
Enter org [rqtvygzvvbuc]. Choices: [‘evoshdo5ltlx’]: evoshdo5ltlx
Enter team [no-team]. Choices: [‘no-team’]: no-team
Enter ace [no-ace]. Choices: [‘no-ace’]: no-ace
[root@xxx /]# ngc registry resource download-version “nvidia/jarvis/jarvis_quickstart:1.2.1-beta”

{
“download_end”: “2021-07-20 15:41:10.080991”,
“download_start”: “2021-07-20 15:41:06.073153”,
“download_time”: “4s”,
“files_downloaded”: 28,
“local_path”: “/jjarvis_quickstart_v1.2.1-beta-1”,
“size_downloaded”: “261.8 KB”,
“status”: “Completed”,
“transfer_id”: “jarvis_quickstart_v1.2.1-beta”
}
[root@xxx /]#
[root@xxx /]# cd jarvis_quickstart_v1.2.1-beta
[root@xxx jarvis_quickstart_v1.2.1-beta]# bash jarvis_init.sh
Logging into NGC docker registry if necessary…
NGC API Key is invalid. Please check and try again.

Hi @antarab ,
Can you please validate if you still have the valid API key, or validate the following steps that to generate the API key, and let us know?

1. Log in to your enterprise account on the NGC website [http://ngc.nvidia.com.](http://ngc.nvidia.com/)
2. Click Setup from the side menu, then click API Key from the Setup page.
3. On the API Key page, click Generate API Key.
4. In response to the warning that your old API Key will become invalid, click CONTINUE to generate the key.
Your API key is displayed with examples of how to use it.

Thanks!

Hi @ AakankshaS
Antara and myself have tried generating new keys couple of times but same error is coming.
Is there direct way to check if key is valid or not ?

1 Like

Hi @ydangi , @antarab ,
Can you please check on the below points

  • Configure your CLI to use your API key with the ngc config set command.
  • Also check if docker key is update “sudo docker login nvcr.io” here as well. Please refer below section

https://docs.nvidia.com/ngc/ngc-private-registry-user-guide/index.html#accessing-ngc-registry

Please let us know if this resolves the issue?

Thanks!

[root@xxx /]# md5sum -c ngc.md5
ngc: OK
[root@xxx /]# ngc config set
bash: ngc: command not found
[root@xxx/]# echo “export PATH=”$PATH:$(pwd)"" >> ~/.bash_profile && source ~/.bash_profile
[root@xxx /]# ngc config set
Enter API key [***************************************************************** ***************MTY4]. Choices: [<VALID_APIKEY>, ‘no-apikey’]: << MY API KEY>>
Enter CLI output format type [json]. Choices: [ascii, csv, json]: json
Enter org [evoshdo5ltlx]. Choices: [‘evoshdo5ltlx’]: evoshdo5ltlx
Enter team [no-team]. Choices: [‘no-team’]: no-team
Enter ace [no-ace]. Choices: [‘no-ace’]: no-ace
[root@XXX /]# docker login nvcr.io
Authenticating with existing credentials…
WARNING! Your password will be stored unencrypted in /root/.docker/config.json.
Configure a credential helper to remove this warning. See
docker login | Docker Documentation

Login Succeeded
[root@xxx /]# ^C
[root@xxx /]# ngc registry resource download-version “nvidia/jarvis/jarvis_quickstart:1.2.1-beta”
{
“download_end”: “2021-07-23 00:37:24.398698”,
“download_start”: “2021-07-23 00:37:19.387191”,
“download_time”: “5s”,
“files_downloaded”: 28,
“local_path”: “/jjarvis_quickstart_v1.2.1-beta-1”,
“size_downloaded”: “261.8 KB”,
“status”: “Completed”,
“transfer_id”: “jarvis_quickstart_v1.2.1-beta”
}
[root@xxx /]# cd jarvis_quickstart_v1.2.1-beta
[root@xxx jarvis_quickstart_v1.2.1-beta]# bash jarvis_init.sh
Logging into NGC docker registry if necessary…
NGC API Key is invalid. Please check and try again.

Above the steps, I am not sure where exactly is it failing? docker login nvcr.io SUCCEEDS.
can this be issue with the machine?

1 Like

Do you have an NGC_API_KEY variable set in your environment that is possibly invalid? If yes, that takes precedence over the key pulled from the NGC configuration file. The command that is failing is echo $NGC_API_KEY | docker login -u '$oauthtoken' --password-stdin nvcr.io

where $NGC_API_KEY either comes from your environment or is loaded from the ngc configuration file.

1 Like