# Troubleshooting Guide

## Common Issues

This section provides some troubleshooting tips related to Gradient

### Environment Variables not set

```
AttributeError: 'NoneType' object has no attribute 'host'
or 
AttributeError: 'NoneType' object has no attribute 'result'
```

This error is returned when Gradient can not access one to the environment variables that are required to return a recommendation. If you are using the CLI, make sure you have run

```
sync-cli configure
```

and that you have provided all the required values. If you are using the programatic Python interface, make sure the environment you working in has the following environment variable set:

```
DATABRICKS_TOKEN={{secrets/demo_workflow/db_token}}
SYNC_API_KEY_SECRET={{secrets/demo_workflow/sync_secret_access_key}}
AWS_DEFAULT_REGION=us-east-1
AWS_SECRET_ACCESS_KEY={{secrets/demo_workflow/aws_secret_access_key}}
AWS_ACCESS_KEY_ID={{secrets/demo_workflow/aws_access_key_id}}
SYNC_API_KEY_ID={{secrets/demo_workflow/sync_access_key_id}}
DATABRICKS_HOST=https://workspace.cloud.databricks.com/
```

### Insufficient Permissions to Make AWS Calls

If you receive an AWS permissions error, please review your AWS policy to ensure the following permissions are granted to the role executing the Gradient prediction.

```
% aws iam get-role-policy --role-name sync-minimum-access --policy-name sync-minimum-access                                                           
{                                                                                                                                                                                                                
    "RoleName": "sync-minimum-access",
    "PolicyName": "sync-minimum-access",
    "PolicyDocument": {
        "Version": "2012-10-17",
        "Statement": [
            {
                "Sid": "VisualEditor0",
                "Effect": "Allow",
                "Action": "ec2:DescribeInstances",
                "Resource": "*"
            },
            {
                "Sid": "VisualEditor1",
                "Effect": "Allow",
                "Action": [
                    "s3:PutObject",
                    "s3:GetObject",
                    "s3:ListBucket"
                ],
                "Resource": [
                    "arn:aws:s3:::sync-us-east-1-temp-90-days/sync/*",
                    "arn:aws:s3:::sync-us-east-1-temp-90-days"
                ]
            }
        ]
    }
}
```
