ASH container not running

Hello everyone!

Im new here, so many of the terms in here are a bit hard for me to understand but doing my best here so please be patient.

Im trying to get Ftrack to work with Ayon so I essentially tried runnning the ASH container inside Docker (Windows) and Im getting this error in the docker logs everytime I try running it.

2024-09-26 22:42:58 2024-09-26 21:42:58 ERROR      ash             Invalid configuration at api_key: field required
2024-09-26 22:42:58 2024-09-26 21:42:58 ERROR      ash             Unable to configure API
2024-09-26 22:42:58 2024-09-26 21:42:58 DEBUG      ash             Critical error. Terminating program.

I also edited the main container .yml file docker-compose.yml on the main directory and it looks like this below, so in theory ASH should be running as far as I know when I press run in Docker.

version: "3.7"
 
services:
  postgres:
    image: postgres:15
    restart: unless-stopped
    healthcheck:
      test: ["CMD-SHELL", "pg_isready -U ayon"]
      interval: 5s
      timeout: 5s
      retries: 5
 
    expose: [5432]
 
    volumes:
      - "/etc/localtime:/etc/localtime:ro"
      - "db:/var/lib/postgresql/data"
 
    environment:
      - "POSTGRES_USER=ayon"
      - "POSTGRES_PASSWORD=ayon"
      - "POSTGRES_DB=ayon"
 
  redis:
    image: redis:alpine
    restart: unless-stopped
    healthcheck:
      test: ["CMD-SHELL", "redis-cli ping | grep PONG"]
      interval: 5s
      timeout: 5s
      retries: 5
 
    expose: [6379]
 
 
  server:
    image: ynput/ayon:latest
    restart: unless-stopped
    healthcheck:
      test: ["CMD", "curl", "-f", "http://localhost:5000/api/info"]
      interval: 10s
      timeout: 2s
      retries: 3
 
    depends_on:
      postgres:
        condition: service_healthy
      redis:
        condition: service_started
    # uncomment for older versions of Docker (>4.0.0) and comment out above "depends on" section.
    #depends_on:
      #- postgres
      #- redis
 
    expose: [5000]
    ports: ["5000:5000"]
 
    volumes:
      - "./addons:/addons"
      - "./storage:/storage"
 
      # comment out the following line on Windows
      - "/etc/localtime:/etc/localtime:ro"
 
      # uncomment the following line if you need to work on the backend code
      # - "./backend:/backend"

worker:
    image: ynput/ayon-ash:latest
    hostname: worker-01
    restart: unless-stopped
    network_mode: host
    depends_on:
      - server
    volumes:
      - "/var/run/docker.sock:/var/run/docker.sock"
    environment:
      - "AYON_API_KEY=d055a693260c4ed886634f24fbe2d330"
      - "AYON_SERVER_URL=http://localhost:5000/"

volumes:
  db: {}

I also created the API key using this guide https://community.ynput.io/t/setting-up-ayon-service-host-ash/1535

So I dont understand what could I have done wrong or if I missed anything?

Thank you in advance





Hi @emesse92,

Why do you have network_mode: host inside your worker service configuration? (for info read the docs) This shouldn’t be the case since you don’t want to access the worker from the outside.

(Edit: I just saw that you took the config from Mustafa’s post)

This is my config:

worker:
    hostname: worker
    image: ynput/ayon-ash:latest
    restart: unless-stopped
    depends_on:
      server:
        condition: service_healthy

    volumes:
     - "/var/run/docker.sock:/var/run/docker.sock"

    environment:
      - "AYON_API_KEY=<api_key>"
      - "AYON_SERVER_URL=<ayon_url>"

Which comes from the ayon-docker repo.

Can you test with this?

Hi @johhnry

Thanks for your response,

I just removed the network line and restarted everything but is still the same unfortunatelly, not sure what else to do at this point

From your log screenshot, this is the line in the source code:

It tries to get all the environment variables that starts with ayon_ and extract the second part to store it in the config. So it should find AYON_API_KEY -> api_key.

It says that the field is required (Invalid configuration at api_key: field required) so it means that it can’t find the environment variable maybe?

Can you spawn a shell into the container and print the environment variables?