Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Got uswgi socket error when launch with ECS #4848

Open
sbourell opened this issue Aug 19, 2024 · 0 comments
Open

Got uswgi socket error when launch with ECS #4848

sbourell opened this issue Aug 19, 2024 · 0 comments

Comments

@sbourell
Copy link

What went wrong?

What happened:
As we do not use K8s, I wanted to try to run Grafana OnCall on ECS (AWS Docker).
I configure my task definition based on what I found here: https://github.com/grafana/oncall/blob/dev/docker-compose.yml

But when the main oncall-engine starts, I get this error: uswgi -s/--socket option is missing and stdin is not a socket
And the container crash with exit code 1.

I tried to workaround this by adding this option manually, but it did not work because, I think, the configuration come from the .ini file in the image.

What did you expect to happen:

  • I expect the engine to start

How do we reproduce it?

Here is my container definition:

[
  // Grafana OnCall Engine
  {
    "name": "oncall-engine",
    "image": "grafana/oncall:latest",
    "essential": true,
    "logConfiguration": {
      "logDriver": "awslogs",
      "options": {
        "awslogs-group": "{{LOG_GROUP}}",
        "awslogs-region": "{{REGION}}",
        "awslogs-stream-prefix": "engine"
      }
    },
    "mountPoints": [
      {
        "containerPath": "/var/lib/oncall",
        "sourceVolume": "{{SOURCE_VOLUME}}"
      }
    ],
    "portMappings": [
      {
        "containerPort": 8080,
        "protocol": "tcp"
      }
    ],
    "command": ["sh", "-c", "uwsgi", "--socket", "127.0.0.1:34647", "--ini", "uwsgi.ini"],
    "dependsOn": [
      {
        "condition": "SUCCESS",
        "containerName": "oncall-db-migration"
      },
      {
        "condition": "HEALTHY",
        "containerName": "oncall-redis"
      }
    ],
    "environment": "{{ENV_VARS}}"
  },

  // Grafana OnCall Celery (workers)
  {
    "name": "oncall-celery",
    "image": "grafana/oncall:latest",
    "essential": false,
    "logConfiguration": {
      "logDriver": "awslogs",
      "options": {
        "awslogs-group": "{{LOG_GROUP}}",
        "awslogs-region": "{{REGION}}",
        "awslogs-stream-prefix": "celery"
      },
    },
    "mountPoints": [
      {
        "containerPath": "/var/lib/oncall",
        "sourceVolume": "{{SOURCE_VOLUME}}"
      }
    ],
    "command": ["sh", "-c", "./celery_with_exporter.sh"],
    "dependsOn": [
      {
        "condition": "SUCCESS",
        "containerName": "oncall-db-migration"
      },
      {
        "condition": "HEALTHY",
        "containerName": "oncall-redis"
      }
    ],
    "environment": "{{ENV_VARS}}"
  },

  // Grafana OnCall db_migration
  {
    "name": "oncall-db-migration",
    "image": "grafana/oncall:latest",
    "essential": false,
    "logConfiguration": {
      "logDriver": "awslogs",
      "options": {
        "awslogs-group": "{{LOG_GROUP}}",
        "awslogs-region": "{{REGION}}",
        "awslogs-stream-prefix": "dbmigration"
      }
    },
    "mountPoints": [
      {
        "containerPath": "/var/lib/oncall",
        "sourceVolume": "{{SOURCE_VOLUME}}"
      }
    ],
    "command": ["python3", "manage.py", "migrate", "--noinput"],
    "dependsOn": [
      {
        "condition": "HEALTHY",
        "containerName": "oncall-redis"
      }
    ],
    "environment": "{{ENV_VARS}}"
  },

  // Grafana OnCall Redis
  {
    "name"      : "oncall-redis",
    "image"     : "redis:7.0.5",
    "user"      : "1000:1000",
    "essential" : false,
    "logConfiguration" : {
      "logDriver": "awslogs",
      "options": {
        "awslogs-group": "{{LOG_GROUP}}",
        "awslogs-region": "{{REGION}}",
        "awslogs-stream-prefix": "redis"
      }
    },
    "portMappings" : [
      {
        "containerPort" : 6379,
        "protocol"      : "tcp"
      }
    ],
    "mountPoints": [
      {
        "containerPath": "/data",
        "sourceVolume": "{{SOURCE_VOLUME}}"
      }
    ],
    "healthCheck" : {
      "command": [ "CMD", "redis-cli", "ping"],
      "interval" : 5,
      "timeout" : 5,
      "retries" : 10,
      "startPeriod" : 20
    }
  }
]

As you can see, I try to add the socket option that is not present in the initial configuration: "command": ["sh", "-c", "uwsgi", "--socket", "127.0.0.1:34647", "--ini", "uwsgi.ini"]

Grafana OnCall Version

latest

Product Area

Helm/Kubernetes/Docker

Grafana OnCall Platform?

Docker

User's Browser?

No response

Anything else to add?

No response

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant