Skip to content

Commit

Permalink
Merge pull request #111 from parodos-dev/troubleshooting-sonata-db
Browse files Browse the repository at this point in the history
troubleshooting: sonata can't connect to db
  • Loading branch information
pkliczewski authored Oct 18, 2024
2 parents 4687d83 + e0883b7 commit b0b9d2a
Show file tree
Hide file tree
Showing 2 changed files with 71 additions and 1 deletion.
35 changes: 34 additions & 1 deletion content/1.2/docs/serverless-workflows/troubleshooting.md
Original file line number Diff line number Diff line change
Expand Up @@ -92,5 +92,38 @@ a CA which is not available to the workflow. The error in the workflow pod log u

### Problem: Workflow installed in a different namespace than Sonataflow services fails to start


First, check if the PostgreSQL pod is still starting. If it is, allow some time for the pod to become fully operational before the DataIndex and JobService pods are ready.

If the PostgreSQL pod is running but the issue persists, verify that the `sonataflow-infra` namespace has the required label `rhdh.redhat.com/workflow-namespace`. Missing this label can cause connectivity issues.

**Solution:**
When deploying a workflow in a namespace other than the one where Sonataflow services are running (e.g., sonataflow-infra), there are essential steps to follow to enable persistence and connectivity for the workflow. See the following [steps](https://github.com/parodos-dev/orchestrator-helm-operator/blob/main/docs/release-1.2/README.md#additional-workflow-namespaces).

Get the NetworkPolicy name from its [definition](https://github.com/parodos-dev/orchestrator-helm-operator/blob/03ddd07bcd8e2aaf9fb37cedb6604be2cf37b6f3/helm-charts/orchestrator/templates/network-policies.yaml#L5). or example, it may be `allow-rhdh-to-sonataflow-and-workflows`.

View the details of the specified NetworkPolicy:

```bash
oc get networkpolicy allow-rhdh-to-sonataflow-and-workflows -n sonataflow-infra
```

In the output YAML, you should see something like:

```yaml
- namespaceSelector:
matchLabels:
# Allow any other namespace the has workflows deployed because this is where
# this namespace contains the sonataflow services
rhdh.redhat.com/workflow-namespace: ""
```
verify if that label is available in `sonataflow-infra` namespace:

```bash
oc get ns sonataflow-infra -o yaml
```

If the required label is missing, you can add it by running the following command:
```bash
oc label ns sonataflow-infra rhdh.redhat.com/workflow-namespace: ""
```
37 changes: 37 additions & 0 deletions content/main/docs/serverless-workflows/troubleshooting.md
Original file line number Diff line number Diff line change
Expand Up @@ -94,3 +94,40 @@ a CA which is not available to the workflow. The error in the workflow pod log u

**Solution:**
When deploying a workflow in a namespace other than the one where Sonataflow services are running (e.g., sonataflow-infra), there are essential steps to follow to enable persistence and connectivity for the workflow. See the following [steps](https://github.com/parodos-dev/orchestrator-helm-operator/blob/main/docs/main/README.md#additional-workflow-namespaces).

### Problem: sonataflow-platform-data-index-service pods can't connect to the database on startup

First, check if the PostgreSQL pod is still starting. If it is, allow some time for the pod to become fully operational before the DataIndex and JobService pods are ready.

If the PostgreSQL pod is running but the issue persists, verify that the `sonataflow-infra` namespace has the required label `rhdh.redhat.com/workflow-namespace`. Missing this label can cause connectivity issues.

**Solution:**

Get the NetworkPolicy name from its [definition](https://github.com/parodos-dev/orchestrator-helm-operator/blob/03ddd07bcd8e2aaf9fb37cedb6604be2cf37b6f3/helm-charts/orchestrator/templates/network-policies.yaml#L5). or example, it may be `allow-rhdh-to-sonataflow-and-workflows`.

View the details of the specified NetworkPolicy:

```bash
oc get networkpolicy allow-rhdh-to-sonataflow-and-workflows -n sonataflow-infra
```

In the output YAML, you should see something like:

```yaml
- namespaceSelector:
matchLabels:
# Allow any other namespace the has workflows deployed because this is where
# this namespace contains the sonataflow services
rhdh.redhat.com/workflow-namespace: ""
```
verify if that label is available in `sonataflow-infra` namespace:

```bash
oc get ns sonataflow-infra -o yaml
```

If the required label is missing, you can add it by running the following command:
```bash
oc label ns sonataflow-infra rhdh.redhat.com/workflow-namespace: ""
```

0 comments on commit b0b9d2a

Please sign in to comment.