|
| 1 | +# Troubleshooting Memgraph Connections |
| 2 | + |
| 3 | +This guide provides troubleshooting steps for common issues when connecting to Memgraph. |
| 4 | + |
| 5 | +## Connection Issues |
| 6 | + |
| 7 | +If you're experiencing issues connecting to the Memgraph database deployed on Azure, follow these steps: |
| 8 | + |
| 9 | +### 1. Check if the Memgraph service is running |
| 10 | + |
| 11 | +```bash |
| 12 | +kubectl get pods -l app=memgraph |
| 13 | +``` |
| 14 | + |
| 15 | +The output should show a pod in the `Running` state. If not, check the pod status: |
| 16 | + |
| 17 | +```bash |
| 18 | +kubectl describe pod -l app=memgraph |
| 19 | +``` |
| 20 | + |
| 21 | +### 2. Check the Memgraph logs for errors |
| 22 | + |
| 23 | +```bash |
| 24 | +kubectl logs -l app=memgraph |
| 25 | +``` |
| 26 | + |
| 27 | +Common errors include: |
| 28 | +- VM memory map count issues |
| 29 | +- Authentication failures |
| 30 | +- Networking problems |
| 31 | + |
| 32 | +### 3. Verify credential secret exists |
| 33 | + |
| 34 | +```bash |
| 35 | +kubectl get secret memgraph-credentials |
| 36 | +``` |
| 37 | + |
| 38 | +### 4. Run the diagnostic script |
| 39 | + |
| 40 | +We provide a comprehensive diagnostic script that checks for common issues and attempts to fix them: |
| 41 | + |
| 42 | +```bash |
| 43 | +./scripts/memgraph_diagnostics.sh |
| 44 | +``` |
| 45 | + |
| 46 | +This script will: |
| 47 | +- Check pod status |
| 48 | +- Verify service configuration |
| 49 | +- Validate credentials |
| 50 | +- Look for common errors in logs |
| 51 | +- Apply fixes when possible |
| 52 | +- Test connectivity |
| 53 | + |
| 54 | +### 5. Manual fix for credential issues |
| 55 | + |
| 56 | +If you've changed the Memgraph credentials in GitHub secrets but the pod doesn't reflect the changes: |
| 57 | + |
| 58 | +1. Update the Kubernetes secret: |
| 59 | + ```bash |
| 60 | + kubectl create secret generic memgraph-credentials \ |
| 61 | + --from-literal=username=YOUR_USERNAME \ |
| 62 | + --from-literal=password=YOUR_PASSWORD \ |
| 63 | + --dry-run=client -o yaml | kubectl apply -f - |
| 64 | + ``` |
| 65 | + |
| 66 | +2. Force the pod to restart with the new credentials: |
| 67 | + ```bash |
| 68 | + kubectl patch deployment memgraph -p \ |
| 69 | + "{\"spec\":{\"template\":{\"metadata\":{\"annotations\":{\"restart-at\":\"$(date +%s)\"}}}}}" |
| 70 | + ``` |
| 71 | + |
| 72 | +3. Wait for the new pod to be ready: |
| 73 | + ```bash |
| 74 | + kubectl wait --for=condition=ready pod -l app=memgraph --timeout=5m |
| 75 | + ``` |
| 76 | + |
| 77 | +### 6. Testing connectivity |
| 78 | + |
| 79 | +You can test connectivity using the provided test script: |
| 80 | + |
| 81 | +```bash |
| 82 | +# Make sure your .env file contains the correct credentials |
| 83 | +python examples/10-azure-memgraph-test.py |
| 84 | +``` |
| 85 | + |
| 86 | +## Common Errors and Solutions |
| 87 | + |
| 88 | +### VM Max Map Count Error |
| 89 | + |
| 90 | +If you see an error like "Max virtual memory areas vm.max_map_count 65530 is too low", this is fixed in the latest deployment configuration with an init container. |
| 91 | + |
| 92 | +### Authentication Errors |
| 93 | + |
| 94 | +If you're getting authentication errors: |
| 95 | +1. Verify the credentials in your `.env` file match those in the Kubernetes secret |
| 96 | +2. Ensure the GitHub secrets have been properly updated |
| 97 | +3. Check if the deployment was updated after changing the credentials |
| 98 | + |
| 99 | +### Connection Timeouts |
| 100 | + |
| 101 | +If connections are timing out: |
| 102 | +1. Verify the Azure Network Security Group allows traffic on port 7687 |
| 103 | +2. Check if the service has a valid external IP address |
| 104 | +3. Ensure your client can reach the Azure VM (no firewall blocking access) |
| 105 | + |
| 106 | +## Need Further Help? |
| 107 | + |
| 108 | +If the above steps don't resolve your issue, please: |
| 109 | +1. Gather the output from the diagnostic script |
| 110 | +2. Collect all relevant error messages |
| 111 | +3. Open an issue providing these details |
0 commit comments