# Wandb: ERROR Error while calling W&B API: (\<Response \[500\]\>)

**URL:** <https://community.wandb.ai/t/wandb-error-error-while-calling-w-b-api-response-500/2509>\
**Category:** W&B Help\
**Tags:** wandb\
**Created:** [May 30, 2022, 2:51pm UTC](https://community.wandb.ai/t/wandb-error-error-while-calling-w-b-api-response-500/2509 "2022-05-30T14:51:15Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![jguzman](https://sea2.discourse-cdn.com/flex020/user_avatar/community.wandb.ai/jguzman/32/834_2.png) [@jguzman](https://community.wandb.ai/u/jguzman)\
**Post date:** [May 30, 2022, 2:51pm UTC](https://community.wandb.ai/t/wandb-error-error-while-calling-w-b-api-response-500/2509/1 "2022-05-30T14:51:15Z")

</div>

Hi,

I’ve just started to use **wandb** and I love it. I use v 0.12.17 and the code below to log from a json file that contains my key, because I don’t want to expose it to the public (I have my script in Github)

```auto
wandb_path = Path('~/.wandb/wandb.json').expanduser()
with open(wandb_path) as fp:
    mykey = json.load(fp)['key']
wandb.login(key = mykey)

```

I’m able to login, but after a few seconds, I get the following error message:

> wandb: ERROR Error while calling W&B API: json: cannot unmarshal array into Go value of type map[string]interface {} (\<Response [500]\>)

Any ideas on how to solve it?

Thanks

Jose

---

<div class="post-metadata">

**Author:** ![armanharutyunyan](https://avatars.discourse-cdn.com/v4/letter/a/a6a055/32.png) [@armanharutyunyan](https://community.wandb.ai/u/armanharutyunyan)\
**Post date:** [May 31, 2022, 8:07am UTC](https://community.wandb.ai/t/wandb-error-error-while-calling-w-b-api-response-500/2509/2 "2022-05-31T08:07:01Z")

</div>

Hey @jguzman, can you try setting the [WANDB\_API\_KEY](https://docs.wandb.ai/guides/track/advanced/environment-variables#optional-environment-variables) environment variable. That way you won’t need to call the wandb.login() function.

---

<div class="post-metadata">

**Author:** ![armanharutyunyan](https://avatars.discourse-cdn.com/v4/letter/a/a6a055/32.png) [@armanharutyunyan](https://community.wandb.ai/u/armanharutyunyan)\
**Post date:** [June 3, 2022, 3:33am UTC](https://community.wandb.ai/t/wandb-error-error-while-calling-w-b-api-response-500/2509/3 "2022-06-03T03:33:05Z")

</div>

Hey @jguzman I wanted to follow up on this request. Please let us know if we can be of further assistance or if your issue has been resolved.

​

---

<div class="post-metadata">

**Author:** ![jguzman](https://sea2.discourse-cdn.com/flex020/user_avatar/community.wandb.ai/jguzman/32/834_2.png) [@jguzman](https://community.wandb.ai/u/jguzman)\
**Post date:** [June 3, 2022, 4:10am UTC](https://community.wandb.ai/t/wandb-error-error-while-calling-w-b-api-response-500/2509/4 "2022-06-03T04:10:58Z")

</div>

Thank you very much for your assistance. That worked like a charm!!

---

<div class="post-metadata">

**Author:** ![armanharutyunyan](https://avatars.discourse-cdn.com/v4/letter/a/a6a055/32.png) [@armanharutyunyan](https://community.wandb.ai/u/armanharutyunyan)\
**Post date:** [June 3, 2022, 2:14pm UTC](https://community.wandb.ai/t/wandb-error-error-while-calling-w-b-api-response-500/2509/5 "2022-06-03T14:14:29Z")

</div>

Glad to hear that! Have a great weekend!

---

<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:** [August 2, 2022, 4:11am UTC](https://community.wandb.ai/t/wandb-error-error-while-calling-w-b-api-response-500/2509/6 "2022-08-02T04:11:37Z")

</div>

Closed on August 2, 2022, 4:11am UTC

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