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

[Bug]: Non-string key in services.frontend.environment: 0 #5064

Closed
billy-le opened this issue Feb 5, 2025 · 2 comments · Fixed by #5217
Closed

[Bug]: Non-string key in services.frontend.environment: 0 #5064

billy-le opened this issue Feb 5, 2025 · 2 comments · Fixed by #5217

Comments

@billy-le
Copy link

billy-le commented Feb 5, 2025

I'm having an issue with a docker-compose file. It seems a recent update has broken my deployments. I noticed that the generated Coolify docker-compose file adds environment variables 0 and 1 which are not used by me - I don't know if they are used under the hood for Coolify.

Coolify version: v4.0.0-beta.390

The error I get from my container building:

2025-Feb-05 04:38:50.042430
Pulling & building required images.
2025-Feb-05 04:38:50.367588
docker exec aw4gc40gcgww4c80w8ksowso bash -c 'SOURCE_COMMIT=b5fca0b8560cc8e5a2be5ba4a4ba9ce9d4ac0630 COOLIFY_BRANCH=main  docker compose --env-file /artifacts/aw4gc40gcgww4c80w8ksowso/.env --project-name ccw0sww --project-directory /artifacts/aw4gc40gcgww4c80w8ksowso -f /artifacts/aw4gc40gcgww4c80w8ksowso/docker-compose.yaml build --pull'
2025-Feb-05 04:38:50.367588
Non-string key in services.frontend.environment: 0
2025-Feb-05 04:38:51.174537
Oops something is not okay, are you okay? 😢
2025-Feb-05 04:38:51.176740
Non-string key in services.frontend.environment: 0

Here is my docker compose yaml

services:
  frontend:
    build: 
      context: .
      dockerfile: Dockerfile
      args:
        PUBLIC_REMARK_URL: ${PUBLIC_REMARK_URL}
        PUBLIC_SITE: ${PUBLIC_SITE}
    container_name: "frontend"
    ports:
     - "4321:4321"
    expose:
     - "4321"
    networks:
      - app
    environment:
      - PUBLIC_REMARK_URL=${PUBLIC_REMARK_URL}
      - PUBLIC_SITE=${PUBLIC_SITE}
    env_file: 
      - .env
  remark42:
    image: umputun/remark42:latest
    container_name: remark42
    hostname: remark42
    restart: always
    logging:
      driver: json-file
      options:
        max-size: "10m"
        max-file: "5"
    ports:
      - "8081:8080"
    networks:
      - app 
    environment:
      - REMARK_URL=${PUBLIC_REMARK_URL}
      - SITE=${PUBLIC_SITE}
      - SECRET=${REMARK_SECRET}
      - ADMIN_SHARED_ID=${ADMIN_SHARED_ID}
      - AUTH_GOOGLE_CID=${AUTH_GOOGLE_CID}
      - AUTH_GOOGLE_CSEC=${AUTH_GOOGLE_CSEC}
      - AUTH_GITHUB_CID=${AUTH_GITHUB_CID}
      - AUTH_GITHUB_CSEC=${AUTH_GITHUB_CSEC}
      - AUTH_TELEGRAM=true
      - NOTIFY_ADMINS=telegram
      - TELEGRAM_TOKEN=${TELEGRAM_TOKEN}
      - NOTIFY_TELEGRAM_CHAN=${NOTIFY_TELEGRAM_CHAN}
      - ALLOWED_HOSTS=${REMARK_ALLOWED_HOSTS}
    env_file:
      - .env
    volumes:
      - remark42:/srv/var

networks:
  app:

volumes:
  remark42:

But this is what is generated from Coolify:

services:
  frontend:
    build:
      context: .
      dockerfile: Dockerfile
      args:
        PUBLIC_REMARK_URL: '${PUBLIC_REMARK_URL}'
        PUBLIC_SITE: '${PUBLIC_SITE}'
    container_name: frontend-ccw0sww-044808586986
    ports:
      - '4321:4321'
    expose:
      - '4321'
    networks:
      app: null
      ccw0sww: null
    environment:
      0: 'PUBLIC_REMARK_URL=${PUBLIC_REMARK_URL}'
      1: 'PUBLIC_SITE=${PUBLIC_SITE}'
      PUBLIC_REMARK_URL: '${PUBLIC_REMARK_URL}'
      PUBLIC_SITE: '${PUBLIC_SITE}'
    env_file:
      - .env
    labels:
      - traefik.enable=true
      - traefik.http.middlewares.gzip.compress=true
      - traefik.http.middlewares.redirect-to-https.redirectscheme.scheme=https
      - traefik.http.routers.http-0-wkss04s88wsww44scg8cgog8.entryPoints=http
      - traefik.http.routers.http-0-wkss04s88wsww44scg8cgog8.middlewares=redirect-to-https
      - 'traefik.http.routers.http-0-wkss04s88wsww44scg8cgog8.rule=Host(`billyle.dev`) && PathPrefix(`/`)'
      - traefik.http.routers.http-0-wkss04s88wsww44scg8cgog8.service=http-0-wkss04s88wsww44scg8cgog8
      - traefik.http.routers.https-0-wkss04s88wsww44scg8cgog8.entryPoints=https
      - traefik.http.routers.https-0-wkss04s88wsww44scg8cgog8.middlewares=gzip
      - 'traefik.http.routers.https-0-wkss04s88wsww44scg8cgog8.rule=Host(`billyle.dev`) && PathPrefix(`/`)'
      - traefik.http.routers.https-0-wkss04s88wsww44scg8cgog8.service=https-0-wkss04s88wsww44scg8cgog8
      - traefik.http.routers.https-0-wkss04s88wsww44scg8cgog8.tls.certresolver=letsencrypt
      - traefik.http.routers.https-0-wkss04s88wsww44scg8cgog8.tls=true
      - traefik.http.services.http-0-wkss04s88wsww44scg8cgog8.loadbalancer.server.port=4321
      - traefik.http.services.https-0-wkss04s88wsww44scg8cgog8.loadbalancer.server.port=4321
      - 'caddy_0.encode=zstd gzip'
      - 'caddy_0.handle_path.0_reverse_proxy={{upstreams 4321}}'
      - 'caddy_0.handle_path=/*'
      - caddy_0.header=-Server
      - 'caddy_0.try_files={path} /index.html /index.php'
      - 'caddy_0=https://billyle.dev'
      - caddy_ingress_network=ccw0sww
      - coolify.managed=true
      - coolify.version=4.0.0-beta.390
      - coolify.applicationId=7
      - coolify.type=application
      - coolify.name=frontend-ccw0sww-044808586986
      - coolify.resourceName=billyledev
      - coolify.projectName=portfolio
      - coolify.serviceName=billyledev
      - coolify.environmentName=production
      - coolify.pullRequestId=0
    restart: unless-stopped
  remark42:
    image: 'umputun/remark42:latest'
    container_name: remark42-ccw0sww-044808606257
    hostname: remark42
    restart: always
    logging:
      driver: json-file
      options:
        max-size: 10m
        max-file: '5'
    ports:
      - '8081:8080'
    networks:
      app: null
      ccw0sww: null
    environment:
      - 'REMARK_URL=${PUBLIC_REMARK_URL}'
      - 'SITE=${PUBLIC_SITE}'
      - 'SECRET=${REMARK_SECRET}'
      - 'ADMIN_SHARED_ID=${ADMIN_SHARED_ID}'
      - 'AUTH_GOOGLE_CID=${AUTH_GOOGLE_CID}'
      - 'AUTH_GOOGLE_CSEC=${AUTH_GOOGLE_CSEC}'
      - 'AUTH_GITHUB_CID=${AUTH_GITHUB_CID}'
      - 'AUTH_GITHUB_CSEC=${AUTH_GITHUB_CSEC}'
      - AUTH_TELEGRAM=true
      - NOTIFY_ADMINS=telegram
      - 'TELEGRAM_TOKEN=${TELEGRAM_TOKEN}'
      - 'NOTIFY_TELEGRAM_CHAN=${NOTIFY_TELEGRAM_CHAN}'
      - 'ALLOWED_HOSTS=${REMARK_ALLOWED_HOSTS}'
    env_file:
      - .env
    volumes:
      - 'remark42:/srv/var'
    labels:
      - coolify.managed=true
      - coolify.version=4.0.0-beta.390
      - coolify.applicationId=7
      - coolify.type=application
      - coolify.name=remark42-ccw0sww-044808606257
      - coolify.resourceName=billyledev
      - coolify.projectName=portfolio
      - coolify.serviceName=billyledev
      - coolify.environmentName=production
      - coolify.pullRequestId=0
volumes:
  remark42:
    name: remark42
networks:
  app: null
  ccw0sww:
    name: ccw0sww
    external: true
configs: {  }
secrets: {  }

Seems like the 0 and 1 environment variables are causing issues and I noticed some environment variables are now wrapped as a string.

@billy-le billy-le changed the title Non-string key in services.frontend.environment: 0 [BUG] Non-string key in services.frontend.environment: 0 Feb 5, 2025
@billy-le billy-le changed the title [BUG] Non-string key in services.frontend.environment: 0 [Bug]: Non-string key in services.frontend.environment: 0 Feb 5, 2025
@farhan2401
Copy link

Yeah also happen to me when I try to redeploy open-webui Docker Compose since it got update. Never had this problem before.

@farhan2401
Copy link

@billy-le I able to fix it by removing the environment in docker compose and put it into the environment variable tabs in coolify

Removing the environment from the docker compose
Image

Add the same env into Coolify
Image

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

Successfully merging a pull request may close this issue.

2 participants