Issue connecting to Wandb API even though login is successful

Hi, I’m trying to connect to my Wandb account from a company server when I run a PyTorch job. I have an account and I’m able to login to wandb, and the logs show that my API key and username is correct when I pass it into PyTorch, as it says currently logged in as [my user name]. However, when I try to actually do anything with Wandb, it says error 403 permission denied. My colleagues credentials work just fine when I enter his API key and his entity name into the wandb init. The traceback is posted below. My user id is mushaikh.

import wandb
import random
wandb.init(entity=“[my user]”,project=“test”)
wandb: (1) Create a W&B account
wandb: (2) Use an existing W&B account
wandb: (3) Don’t visualize my results
wandb: Enter your choice: 2
wandb: You chose ‘Use an existing W&B account’
wandb: Logging into Wandb
wandb: You can find your API key in your browser here:
wandb: Paste an API key from your profile and hit enter, or press ctrl+c to quit:
wandb: Appending key for api.wandb.ai to your netrc file: /home/…/.netrc
wandb: ERROR Error while calling W&B API: permission denied (<Response [403]>)
Thread SenderThread: wandb.init()…
Traceback (most recent call last):
File “/opt/conda/envs/python37/lib/python3.7/site-packages/wandb/sdk/lib/retry.py”, line 131, in call
result = self._call_fn(*args, **kwargs)
File “/opt/conda/envs/python37/lib/python3.7/site-packages/wandb/sdk/internal/internal_api.py”, line 242, in execute
return self.client.execute(*args, **kwargs) # type: ignore
File “/opt/conda/envs/python37/lib/python3.7/site-packages/wandb/vendor/gql-0.2.0/wandb_gql/client.py”, line 52, in execute
result = self._get_result(document, *args, **kwargs)
File “/opt/conda/envs/python37/lib/python3.7/site-packages/wandb/vendor/gql-0.2.0/wandb_gql/client.py”, line 60, in _get_result
return self.transport.execute(document, *args, **kwargs)
File “/opt/conda/envs/python37/lib/python3.7/site-packages/wandb/vendor/gql-0.2.0/wandb_gql/transport/requests.py”, line 39, in execute
request.raise_for_status()
File “/opt/conda/envs/python37/lib/python3.7/site-packages/requests/models.py”, line 1021, in raise_for_status
raise HTTPError(http_error_msg, response=self)
requests.exceptions.HTTPError: 403 Client Error: Forbidden for url: https://api.wandb.ai/graphql

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
File “/opt/conda/envs/python37/lib/python3.7/site-packages/wandb/apis/normalize.py”, line 26, in wrapper
return func(*args, **kwargs)
File “/opt/conda/envs/python37/lib/python3.7/site-packages/wandb/sdk/internal/internal_api.py”, line 1597, in upsert_run
**kwargs,
File “/opt/conda/envs/python37/lib/python3.7/site-packages/wandb/sdk/internal/internal_api.py”, line 217, in gql
**kwargs,
File “/opt/conda/envs/python37/lib/python3.7/site-packages/wandb/sdk/lib/retry.py”, line 147, in call
retry_timedelta_triggered = check_retry_fn(e)
File “/opt/conda/envs/python37/lib/python3.7/site-packages/wandb/util.py”, line 1066, in check_retry_fn
return fallback_retry_fn(e)
File “/opt/conda/envs/python37/lib/python3.7/site-packages/wandb/util.py”, line 1013, in no_retry_auth
raise CommError(“Permission denied, ask the project owner to grant you access”)
wandb.errors.CommError: Permission denied, ask the project owner to grant you access

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
File “/opt/conda/envs/python37/lib/python3.7/site-packages/wandb/sdk/internal/internal_util.py”, line 49, in run
self._run()
File “/opt/conda/envs/python37/lib/python3.7/site-packages/wandb/sdk/internal/internal_util.py”, line 100, in _run
self._process(record)
File “/opt/conda/envs/python37/lib/python3.7/site-packages/wandb/sdk/internal/internal.py”, line 329, in _process
self._sm.send(record)
File “/opt/conda/envs/python37/lib/python3.7/site-packages/wandb/sdk/internal/sender.py”, line 343, in send
send_handler(record)
File “/opt/conda/envs/python37/lib/python3.7/site-packages/wandb/sdk/internal/sender.py”, line 929, in send_run
self._init_run(run, config_value_dict)
File “/opt/conda/envs/python37/lib/python3.7/site-packages/wandb/sdk/internal/sender.py”, line 971, in _init_run
commit=run.git.commit or None,
File “/opt/conda/envs/python37/lib/python3.7/site-packages/wandb/apis/normalize.py”, line 64, in wrapper
raise CommError(message, err).with_traceback(sys.exc_info()[2])
File “/opt/conda/envs/python37/lib/python3.7/site-packages/wandb/apis/normalize.py”, line 26, in wrapper
return func(*args, **kwargs)
File “/opt/conda/envs/python37/lib/python3.7/site-packages/wandb/sdk/internal/internal_api.py”, line 1597, in upsert_run
**kwargs,
File “/opt/conda/envs/python37/lib/python3.7/site-packages/wandb/sdk/internal/internal_api.py”, line 217, in gql
**kwargs,
File “/opt/conda/envs/python37/lib/python3.7/site-packages/wandb/sdk/lib/retry.py”, line 147, in call
retry_timedelta_triggered = check_retry_fn(e)
File “/opt/conda/envs/python37/lib/python3.7/site-packages/wandb/util.py”, line 1066, in check_retry_fn
return fallback_retry_fn(e)
File “/opt/conda/envs/python37/lib/python3.7/site-packages/wandb/util.py”, line 1013, in no_retry_auth
raise CommError(“Permission denied, ask the project owner to grant you access”)
wandb.errors.CommError: Permission denied, ask the project owner to grant you access
wandb: ERROR Internal wandb error: file data was not synced
Problem at: 1 t()…
Traceback (most recent call last):
File “/opt/conda/envs/python37/lib/python3.7/site-packages/wandb/sdk/wandb_init.py”, line 1133, in init
run = wi.init()
File “/opt/conda/envs/python37/lib/python3.7/site-packages/wandb/sdk/wandb_init.py”, line 733, in init
cancel=True,
File “/opt/conda/envs/python37/lib/python3.7/site-packages/wandb/sdk/lib/mailbox.py”, line 271, in wait
raise MailboxError(“transport failed”)
wandb.errors.MailboxError: transport failed
wandb: ERROR Abnormal program exit
Traceback (most recent call last):
File “/opt/conda/envs/python37/lib/python3.7/site-packages/wandb/sdk/wandb_init.py”, line 1133, in init
run = wi.init()
File “/opt/conda/envs/python37/lib/python3.7/site-packages/wandb/sdk/wandb_init.py”, line 733, in init
cancel=True,
File “/opt/conda/envs/python37/lib/python3.7/site-packages/wandb/sdk/lib/mailbox.py”, line 271, in wait
raise MailboxError(“transport failed”)
wandb.errors.MailboxError: transport failed

The above exception was the direct cause of the following exception:

Traceback (most recent call last):
File “”, line 1, in
File “/opt/conda/envs/python37/lib/python3.7/site-packages/wandb/sdk/wandb_init.py”, line 1170, in init
raise Exception(“problem”) from error_seen
Exception: problem

Hi @mushaikh

Good day and thank you for reaching out to us. Happy to help you on this!

Could you please try to relogin by using the command wandb login --relogin to force relogin and enter your API key one more time? Let me know if this works for you.

May I also know if there’s any difference on the permission between your account and your colleagues on your Team?

Thanks,
Paulo

Hi Paulo,

Thanks for gettin back to me. I tried many things that I found on the community pages, including using wandb login --relogin and enter my API key one more time. Since then I have managed to resolve the issue, and for me, it was a matter of not entering the “entity” argument (i.e. my username). I’m not sure exactly what the issue is, but it might be to do with the new corporate accounts that wandb gives to everyone. I actually just need a personal account but the default that wandb gave me is a corporate account with a wandb team in which im just the sole user. It might be to do with that, because when I remove the entity param from the wandb.init() call, it works fine just by supplying my API key

Hi @mushaikh Good day and thank you for confirming this. With our new Community Edition plan, we do not offer personal entities anymore for new users. You will be given a team once you created a new account. Moving forward, please log your experiments/runs into your new team/entity. I hope this helps!

Thanks,
Paulo

Hi @mushaikh , since we have not heard back from you we are going to close this request. If you would like to re-open the conversation, please let us know!