> ## Documentation Index
> Fetch the complete documentation index at: https://wb-21fd5541-docs-1917.mintlify.site/llms.txt
> Use this file to discover all available pages before exploring further.

# How do I fix service account errors like `Unauthorized` or missing runs?

Here are common service account issues and their solutions:

### "Unauthorized" errors

Verify the API key is correctly set and the service account has access to the target project. For restricted projects, you must explicitly add the service account to the project's access list.

### Runs not appearing

Check that the `WANDB_ENTITY` environment variable is set to the correct team name:

```bash theme={null}
export WANDB_ENTITY=<team_name>
```

If `WANDB_ENTITY` is not set, runs may be logged to the wrong entity.

### User attribution not working

If you use `WANDB_USERNAME` to attribute automated runs to a human user, ensure the user specified is a member of the team:

```bash theme={null}
export WANDB_USERNAME=<username>
```

### Access denied to restricted projects

Explicitly add the service account to the restricted project's access list. Service accounts do not automatically have access to restricted projects, even if they belong to the team.

For more information, see [Use service accounts to automate workflows](/platform/hosting/iam/service-accounts).

***

<Badge stroke shape="pill" color="orange" size="md">[Administrator](/support/models/tags/administrator)</Badge><Badge stroke shape="pill" color="orange" size="md">[Security](/support/models/tags/security)</Badge>
