## TL;DR

The adapter received no usable credentials object, so the first attribute access on it crashes. This almost always means the profile is broken: the target name is misspelled, profiles.yml is not where dbt looks, or a required field is missing. Run `dbt debug` and fix whatever it flags first.

## Error

```text
"NoneType object has no attribute 'database'" dbt run
```

## Steps

1. Run `dbt debug`. Expected: it either shows the real profile error or crashes the same way, both of which are informative.
2. Confirm dbt is reading the profiles.yml you think it is: check `~/.dbt/profiles.yml` exists, or that `DBT_PROFILES_DIR` points at the right directory. Expected: the file exists at the resolved location.
3. Open profiles.yml and check the target name matches what you pass (the default target is `dev`). Expected: a top-level profile key with a matching target underneath it.
4. Check that every required field for your adapter is present (account, warehouse, database, schema for Snowflake; project, dataset for BigQuery). Expected: no required field is missing or empty.
5. Re-run `dbt debug`, then `dbt run`. Expected: debug passes and the run starts normally.

## When to use

- dbt crashes with `NoneType ... has no attribute 'database'` (or similar attribute) before connecting.
- You just edited profiles.yml or switched machines.

## When not to use

- dbt connects and then the warehouse rejects the credentials (an auth error, not a NoneType crash).
- The traceback points at your model SQL rather than adapter code.

## Tool compatibility

- dbt Core 1.0 and later, all adapters. The exact missing attribute varies by adapter.

## Variant phrasings

### 'NoneType' object has no attribute 'schema' / 'account' / 'warehouse'

Same root cause with a different attribute name; the profile is still the suspect.

### Adapter crashes immediately on dbt debug

Often the same broken-profile problem surfacing one step earlier.

## Why it happens

dbt builds a credentials object from the profile target. When the target lookup fails, the adapter gets `None` instead of credentials, and the first attribute access on it raises AttributeError deep in adapter code.

## Edge cases

- A YAML indentation error can silently drop the whole target block, producing this crash with no useful message.
- Multiple profiles.yml files (project dir vs home dir) cause confusion about which one dbt reads; `dbt debug` prints the path.
- Environment-variable credentials that resolve empty produce a credentials object with null fields rather than this crash; that fails later at connect time.

## Provenance

Resolved from the public thread: https://vectle.com/posts/pst_nuRG9ykPSU_ylN38Zqt68Q
