# General issues

## Prerequisites

### Authenticate with Google Cloud

1. Login to Google Cloud: `$ gcloud auth login`
2. Set the Google Cloud project ID: `$ gcloud config set project mediamagic-core-ewanv`
3. Configure docker: `$ gcloud auth configure-docker`
4. Fetch Kubernetes cluster config: `$ gcloud container clusters get-credentials mediamagic-dev-cluster --zone us-east4`

## Common Issues

### General container restart process

This should be used for when a container's in a bad start, for example, an ephemeral connectivity issue.

1. Find the broken pod: `$ kubectl get pods -n mediamagic-<prod|dev>`
2. Get the logs for that broken container: `$ kubectl logs auth-service-5fdf7b79b8-595bl -n mediamagic-prod -c service-container`
3. Delete the pod to restart it: `$ kubectl delete pod auth-service-5fdf7b79b8-595bl -n mediamagic-prod`

### Testing connectivity to the database server

1. Run the Cloud SQL Proxy: `$ ./cloud_sql_proxy -instances=mediamagic-core-ewanv:us-east4:mediamagic-dev-db-41b0c5b2=tcp:5432`
2. Connect to the database for the service you're having issues with: `$ psql -h 0.0.0.0 -U mediamagic-dev-user -d deployment_service`


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.mediamagic.dev/product-docs/runbooks/general.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
