# Wandb automatically logeed into the wrong user -- why?

**URL:** <https://community.wandb.ai/t/wandb-automatically-logeed-into-the-wrong-user-why/2916>\
**Category:** W&B Help\
**Tags:** wandb\
**Created:** [August 12, 2022, 2:33pm UTC](https://community.wandb.ai/t/wandb-automatically-logeed-into-the-wrong-user-why/2916 "2022-08-12T14:33:18Z")\
**Posts on this page:** 15\
**Page:** 1

<div class="post-metadata">

**Author:** ![brando](https://sea2.discourse-cdn.com/flex020/user_avatar/community.wandb.ai/brando/32/199_2.png) [@brando](https://community.wandb.ai/u/brando)\
**Post date:** [August 12, 2022, 2:33pm UTC](https://community.wandb.ai/t/wandb-automatically-logeed-into-the-wrong-user-why/2916/1 "2022-08-12T14:33:18Z")

</div>

I followed the usual instructions:

```auto
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:

```auto
(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?

> <https://stackoverflow.com/questions/73335735/wandb-automatically-logeed-into-the-wrong-user-why>

---

<div class="post-metadata">

**Author:** ![morgan](https://sea2.discourse-cdn.com/flex020/user_avatar/community.wandb.ai/morgan/32/74_2.png) [@morgan](https://community.wandb.ai/u/morgan)\
**Post date:** [August 12, 2022, 2:48pm UTC](https://community.wandb.ai/t/wandb-automatically-logeed-into-the-wrong-user-why/2916/2 "2022-08-12T14:48:34Z")

</div>

not sure what happened, but I would suggest [forcing a relogin](https://docs.wandb.ai/ref/cli/wandb-login)

```auto
wandb login --relogin

```

---

<div class="post-metadata">

**Author:** ![brando](https://sea2.discourse-cdn.com/flex020/user_avatar/community.wandb.ai/brando/32/199_2.png) [@brando](https://community.wandb.ai/u/brando)\
**Post date:** [August 12, 2022, 2:55pm UTC](https://community.wandb.ai/t/wandb-automatically-logeed-into-the-wrong-user-why/2916/3 "2022-08-12T14:55:39Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![brando](https://sea2.discourse-cdn.com/flex020/user_avatar/community.wandb.ai/brando/32/199_2.png) [@brando](https://community.wandb.ai/u/brando)\
**Post date:** [August 12, 2022, 2:56pm UTC](https://community.wandb.ai/t/wandb-automatically-logeed-into-the-wrong-user-why/2916/4 "2022-08-12T14:56:34Z")

</div>

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

```auto
machine api.wandb.ai
  login user

```

---

<div class="post-metadata">

**Author:** ![brando](https://sea2.discourse-cdn.com/flex020/user_avatar/community.wandb.ai/brando/32/199_2.png) [@brando](https://community.wandb.ai/u/brando)\
**Post date:** [August 12, 2022, 3:02pm UTC](https://community.wandb.ai/t/wandb-automatically-logeed-into-the-wrong-user-why/2916/5 "2022-08-12T15:02:37Z")

</div>

seems to have the right version?

```auto
(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)

```

---

<div class="post-metadata">

**Author:** ![brando](https://sea2.discourse-cdn.com/flex020/user_avatar/community.wandb.ai/brando/32/199_2.png) [@brando](https://community.wandb.ai/u/brando)\
**Post date:** [August 12, 2022, 3:08pm UTC](https://community.wandb.ai/t/wandb-automatically-logeed-into-the-wrong-user-why/2916/6 "2022-08-12T15:08:10Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![brando](https://sea2.discourse-cdn.com/flex020/user_avatar/community.wandb.ai/brando/32/199_2.png) [@brando](https://community.wandb.ai/u/brando)\
**Post date:** [August 12, 2022, 3:09pm UTC](https://community.wandb.ai/t/wandb-automatically-logeed-into-the-wrong-user-why/2916/7 "2022-08-12T15:09:54Z")

</div>

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

```auto
cat ~/.netrc

```

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

Mine looks as follows:

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

```

but relogin changes it to:

```auto
machine api.wandb.ai
  login user
  password SECRET

```

---

<div class="post-metadata">

**Author:** ![brando](https://sea2.discourse-cdn.com/flex020/user_avatar/community.wandb.ai/brando/32/199_2.png) [@brando](https://community.wandb.ai/u/brando)\
**Post date:** [August 12, 2022, 3:14pm UTC](https://community.wandb.ai/t/wandb-automatically-logeed-into-the-wrong-user-why/2916/8 "2022-08-12T15:14:11Z")

</div>

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

```auto
echo $WANDB_API_KEY

```

it’s output does look like my key.

---

<div class="post-metadata">

**Author:** ![brando](https://sea2.discourse-cdn.com/flex020/user_avatar/community.wandb.ai/brando/32/199_2.png) [@brando](https://community.wandb.ai/u/brando)\
**Post date:** [August 12, 2022, 3:22pm UTC](https://community.wandb.ai/t/wandb-automatically-logeed-into-the-wrong-user-why/2916/9 "2022-08-12T15:22:04Z")

</div>

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…😕

---

<div class="post-metadata">

**Author:** ![brando](https://sea2.discourse-cdn.com/flex020/user_avatar/community.wandb.ai/brando/32/199_2.png) [@brando](https://community.wandb.ai/u/brando)\
**Post date:** [August 12, 2022, 3:49pm UTC](https://community.wandb.ai/t/wandb-automatically-logeed-into-the-wrong-user-why/2916/10 "2022-08-12T15:49:49Z")

</div>

> [@brando](#):
>
> But that is weird, I’ve ran it from pycharm debugger before…😕

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…

```auto
(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:

```auto
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')

```

---

<div class="post-metadata">

**Author:** ![brando](https://sea2.discourse-cdn.com/flex020/user_avatar/community.wandb.ai/brando/32/199_2.png) [@brando](https://community.wandb.ai/u/brando)\
**Post date:** [August 16, 2022, 4:14pm UTC](https://community.wandb.ai/t/wandb-automatically-logeed-into-the-wrong-user-why/2916/11 "2022-08-16T16:14:48Z")

</div>

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

```auto
(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?:

```auto
WANDB_API_KEY=jhkjlljhkhjklhjkl....secret....skdfjdsfjlhjkfsd

```

---

<div class="post-metadata">

**Author:** ![morgan](https://sea2.discourse-cdn.com/flex020/user_avatar/community.wandb.ai/morgan/32/74_2.png) [@morgan](https://community.wandb.ai/u/morgan)\
**Post date:** [August 24, 2022, 3:18pm UTC](https://community.wandb.ai/t/wandb-automatically-logeed-into-the-wrong-user-why/2916/12 "2022-08-24T15:18:38Z")

</div>

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…

---

<div class="post-metadata">

**Author:** ![brando](https://sea2.discourse-cdn.com/flex020/user_avatar/community.wandb.ai/brando/32/199_2.png) [@brando](https://community.wandb.ai/u/brando)\
**Post date:** [September 15, 2022, 11:47pm UTC](https://community.wandb.ai/t/wandb-automatically-logeed-into-the-wrong-user-why/2916/13 "2022-09-15T23:47:38Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![brando](https://sea2.discourse-cdn.com/flex020/user_avatar/community.wandb.ai/brando/32/199_2.png) [@brando](https://community.wandb.ai/u/brando)\
**Post date:** [September 16, 2022, 5:47pm UTC](https://community.wandb.ai/t/wandb-automatically-logeed-into-the-wrong-user-why/2916/14 "2022-09-16T17:47:10Z")

</div>

some answers that don’t work here: [pycharm - Wandb automatically logged into the wrong user -- why? - Stack Overflow](https://stackoverflow.com/questions/73335735/wandb-automatically-logged-into-the-wrong-user-why)

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/flex020/uploads/wandb/original/1X/366b649231631dbab896843020da0056074ac79d.png) [@system](https://community.wandb.ai/u/system)\
**Post date:** [November 15, 2022, 5:48pm UTC](https://community.wandb.ai/t/wandb-automatically-logeed-into-the-wrong-user-why/2916/15 "2022-11-15T17:48:01Z")

</div>

Closed on November 15, 2022, 5:48pm UTC

This topic was automatically closed 60 days after the last reply. New replies are no longer allowed.
