# Troubleshooting

## BigQuery Authentication Fails

| Possible Cause | Resolution |
|  --- | --- |
| Invalid JSON key | Verify the JSON key file contents are valid. Re-download from the GCP Console if needed. |
| Service account missing IAM roles | Ensure the service account has `roles/bigquery.jobUser` at project level and `roles/bigquery.dataEditor` at dataset level. |
| BigQuery API not enabled | Verify that the BigQuery API is enabled in your GCP project: **APIs & Services** > **Enabled APIs** > **BigQuery API**. |
| OAuth credentials used instead of JSON key | Only JSON keyfile authentication is supported. OAuth user credentials are not supported for CDW connections used in CAS. |
| VPC Service Controls blocking access | If your GCP project uses VPC Service Controls, ensure Treasure AI server IPs are added to the allowed list. |


## Parent Segment Upload Fails

| Possible Cause | Resolution |
|  --- | --- |
| Invalid JSON | Validate your JSON with a linter (e.g., `jq . parent_segment_config.json`). |
| Wrong `connectionId` | Confirm the ID matches your saved BigQuery authentication in Integration Hub. The `connectionId` can be found in the URL of the authentication detail page. |
| Dataset or table not found | Verify all dataset and table names exist in BigQuery and match exactly (case-sensitive). |
| Missing columns | Ensure `keyColumn`, `tableKey`, `masterKey`, and all `column` values exist in the referenced tables. |


## Segment Counts Show Zero

| Possible Cause | Resolution |
|  --- | --- |
| Empty Customers table
 | Verify the Customers table has data:

```sql
SELECT COUNT(*) FROM `<project>.<dataset>.customers`;
```
 |
| Key mismatch | Confirm that unified profile identifier values in Behaviors tables match those in the Customers table. |
| Permission issues | Ensure the service account has the required IAM roles on all referenced datasets and tables. |


## Cannot Access CAS UI

| Possible Cause | Resolution |
|  --- | --- |
| Feature not enabled | Contact Customer Success to verify your account has Composable Audience Studio enabled. |
| Browser cache | Clear browser cache and reload the page. |
| Account permissions | Contact Customer Success to verify your account has CAS permissions. |