Wandb automatically logeed into the wrong user -- why?

I followed the usual instructions:

pip install wandb
wandb login

but then it never asked me for the user and thus when I pasted my key into the terminal when asked it was there in the .netrc file but it was all wrong:

(iit_term_synthesis) brandomiranda~ ❯
(iit_term_synthesis) brandomiranda~ ❯ wandb login
wandb: W&B API key is configured. Use `wandb login --relogin` to force relogin
(iit_term_synthesis) brandomiranda~ ❯ wandb login --relogin
wandb: Logging into wandb.ai. (Learn how to deploy a W&B server locally: https://wandb.me/wandb-server)
wandb: You can find your API key in your browser here: https://wandb.ai/authorize
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: /Users/brandomiranda/.netrc
(iit_term_synthesis) brandomiranda~ ❯ cat /Users/brandomiranda/.netrc
machine api.wandb.ai
  login user
  password djkfhkjsdhfkjshdkfj...SECRET...sdhjfjhsdjkfhsdjf

how to fix this?

not sure what happened, but I would suggest forcing a relogin

wandb login --relogin

yes I tried forcing a relogin, and it changes my username in the .netrc file to user :confused:

why does the relogin change my username as followins in the .netrc file:

machine api.wandb.ai
  login user

seems to have the right version?

(iit_term_synthesis) brandomiranda~ ❯ pip install wandb --upgrade
Requirement already satisfied: wandb in ./miniconda/envs/iit_term_synthesis/lib/python3.9/site-packages (0.13.1)
Requirement already satisfied: setproctitle in ./miniconda/envs/iit_term_synthesis/lib/python3.9/site-packages (from wandb) (1.2.3)
Requirement already satisfied: docker-pycreds>=0.4.0 in ./miniconda/envs/iit_term_synthesis/lib/python3.9/site-packages (from wandb) (0.4.0)
Requirement already satisfied: setuptools in ./miniconda/envs/iit_term_synthesis/lib/python3.9/site-packages (from wandb) (61.2.0)
Requirement already satisfied: Click!=8.0.0,>=7.0 in ./miniconda/envs/iit_term_synthesis/lib/python3.9/site-packages (from wandb) (8.1.3)
Requirement already satisfied: protobuf<4.0dev,>=3.12.0 in ./miniconda/envs/iit_term_synthesis/lib/python3.9/site-packages (from wandb) (3.19.4)
Requirement already satisfied: requests<3,>=2.0.0 in ./miniconda/envs/iit_term_synthesis/lib/python3.9/site-packages (from wandb) (2.28.1)
Requirement already satisfied: psutil>=5.0.0 in ./miniconda/envs/iit_term_synthesis/lib/python3.9/site-packages (from wandb) (5.9.1)
Requirement already satisfied: six>=1.13.0 in ./miniconda/envs/iit_term_synthesis/lib/python3.9/site-packages (from wandb) (1.16.0)
Requirement already satisfied: PyYAML in ./miniconda/envs/iit_term_synthesis/lib/python3.9/site-packages (from wandb) (6.0)
Requirement already satisfied: pathtools in ./miniconda/envs/iit_term_synthesis/lib/python3.9/site-packages (from wandb) (0.1.2)
Requirement already satisfied: GitPython>=1.0.0 in ./miniconda/envs/iit_term_synthesis/lib/python3.9/site-packages (from wandb) (3.1.27)
Requirement already satisfied: shortuuid>=0.5.0 in ./miniconda/envs/iit_term_synthesis/lib/python3.9/site-packages (from wandb) (1.0.9)
Requirement already satisfied: sentry-sdk>=1.0.0 in ./miniconda/envs/iit_term_synthesis/lib/python3.9/site-packages (from wandb) (1.6.0)
Requirement already satisfied: promise<3,>=2.0 in ./miniconda/envs/iit_term_synthesis/lib/python3.9/site-packages (from wandb) (2.3)
Requirement already satisfied: gitdb<5,>=4.0.1 in ./miniconda/envs/iit_term_synthesis/lib/python3.9/site-packages (from GitPython>=1.0.0->wandb) (4.0.9)
Requirement already satisfied: smmap<6,>=3.0.1 in ./miniconda/envs/iit_term_synthesis/lib/python3.9/site-packages (from gitdb<5,>=4.0.1->GitPython>=1.0.0->wandb) (5.0.0)
Requirement already satisfied: urllib3<1.27,>=1.21.1 in ./miniconda/envs/iit_term_synthesis/lib/python3.9/site-packages (from requests<3,>=2.0.0->wandb) (1.26.9)
Requirement already satisfied: idna<4,>=2.5 in ./miniconda/envs/iit_term_synthesis/lib/python3.9/site-packages (from requests<3,>=2.0.0->wandb) (3.3)
Requirement already satisfied: certifi>=2017.4.17 in ./miniconda/envs/iit_term_synthesis/lib/python3.9/site-packages (from requests<3,>=2.0.0->wandb) (2022.6.15)
Requirement already satisfied: charset-normalizer<3,>=2 in ./miniconda/envs/iit_term_synthesis/lib/python3.9/site-packages (from requests<3,>=2.0.0->wandb) (2.0.12)

is there a terminal command to test I logged into wandb?

@morgan can you show me the output of your command:

cat ~/.netrc

of course you should remove the key value with something else like SECRET when pasting it here.

Mine looks as follows:

(iit_term_synthesis) brandomiranda~ ❯ cat /Users/brandomiranda/.netrc
machine api.wandb.ai
  login brando
  password SECRET

but relogin changes it to:

machine api.wandb.ai
  login user
  password SECRET

note I do have this env variable set to see if it forced things:

echo $WANDB_API_KEY

it’s output does look like my key.

actually just discovered that it doesn’t work in the pycharm debugger. Thats the issue.

But that is weird, I’ve ran it from pycharm debugger before…:confused:

First make sure your .netrc file looks right. Login in as instructed in wandb and its fine to relogin. Make sure it still looks fine. Make sure you update wandb with pip. You can set the env variable with your key too. Update pycharm. Remove all the .idea folders in your projects and start from scratch. Make sure your pycharm projs have the right path to the python interpreter form pycharm. Thats I think what worked…

(iit_term_synthesis) brandomiranda~/iit-term-synthesis ❯ rm -rf ../ultimate-utils/.idea
(iit_term_synthesis) brandomiranda~/iit-term-synthesis ❯ rm -rf ../iit-term-synthesis/.idea
(iit_term_synthesis) brandomiranda~/iit-term-synthesis ❯ rm -rf ../pycoq/.idea
(iit_term_synthesis) brandomiranda~/iit-term-synthesis ❯ rm -rf ../data/.idea
(iit_term_synthesis) brandomiranda~/iit-term-synthesis ❯ rm -rf ../proverbot/.idea

this was useful:

run_bash_command('pip install wandb --upgrade')
cat_file('~/.zshrc')
cat_file('~/.netrc')

wandb.init(project="proof-term-synthesis", entity="brando", name='run_name', group='expt_name')

print('success!\a')

1 Like

@morgan is it really correct behaviour that a forcing in login changes my login field in the netrc to user? see:

(iit_synthesis) [miranda9@cccxc518 pycoq]$ cat ~/.netrc
machine api.wandb.ai
  login user
  password fdlhsljkhsdflhjkfsdlhjk...SECRET...iputriuyohjsdbkljfdslhkj

also, is it normal that despite my ~/.netrc files looks fine that my bash script still needs this env variable?:

WANDB_API_KEY=jhkjlljhkhjklhjkl....secret....skdfjdsfjlhjkfsd

Hey @brando I do see that it changes my login field in netrc to “user” also, and I haven’t had any issues with logging in before…

@morgan do you have an example of a .netrc that is “correct”/works

some answers that don’t work here: pycharm - Wandb automatically logged into the wrong user -- why? - Stack Overflow