5

My supervisor configuration file

environment=USER=%(ENV_FLOWER_USER_NAME),PASS=%(ENV_FLOWER_PASSWORD)
command=/usr/local/opt/python/bin/flower --basic_auth=%(ENV_USER}:%(ENV_PASS)

When I start supervisord, I receive the following error

Restarting supervisor: Error: Format string 'USER=%(ENV_FLOWER_USER_NAME),PASS=%(ENV_FLOWER_PASSWORD)' for 'environment' is badly formatted

Any ideas?

jophab
  • 5,356
  • 14
  • 41
  • 60
jdevops
  • 53
  • 1
  • 4

2 Answers2

5

Looks like you are missing the leading s in formatting environment variable name. Here is sample config file.

You should use

environment=USER=%(ENV_FLOWER_USER_NAME)s,PASS=%(ENV_FLOWER_PASSWORD)s
command=/usr/local/opt/python/bin/flower --basic_auth=%(ENV_USER)s:%(ENV_PASS)s

For readability

environment=
    USER=%(ENV_FLOWER_USER_NAME)s,
    PASS=%(ENV_FLOWER_PASSWORD)s

command=/usr/local/opt/python/bin/flower 
            --basic_auth=%(ENV_USER)s:%(ENV_PASS)s
Chillar Anand
  • 27,936
  • 9
  • 119
  • 136
0

Use a variable if this form is prefixed with %(ENV_NAME)s to the name.

docker-compose.yml

environment:
  ENVIRONMENT: production
  PORT: 8011 # port uwsgi

supervisord.conf

[program:uwsgi]
command=uwsgi --ini uwsgi.ini --http :%(ENV_PORT)s

saludos :)

josue
  • 630
  • 1
  • 10
  • 16