Home > Enterprise >  Docker error keeps giving error closing quotation
Docker error keeps giving error closing quotation

Time:10-17

I'm trying to create a docker compose file to setup my development environment but the following error keeps happening:

ERROR: for 36b488ac7408_pcare_redis_1  No closing quotation

ERROR: for redis  No closing quotation
Traceback (most recent call last):
  File "docker-compose", line 3, in <module>
  File "compose\cli\main.py", line 81, in main
  File "compose\cli\main.py", line 203, in perform_command
  File "compose\metrics\decorator.py", line 18, in wrapper
  File "compose\cli\main.py", line 1186, in up
  File "compose\cli\main.py", line 1166, in up
  File "compose\project.py", line 697, in up
  File "compose\parallel.py", line 108, in parallel_execute
  File "compose\parallel.py", line 206, in producer
  File "compose\project.py", line 679, in do
  File "compose\service.py", line 579, in execute_convergence_plan
  File "compose\service.py", line 499, in _execute_convergence_recreate
  File "compose\parallel.py", line 108, in parallel_execute
  File "compose\parallel.py", line 206, in producer
  File "compose\service.py", line 494, in recreate
  File "compose\service.py", line 612, in recreate_container
  File "compose\service.py", line 341, in create_container
  File "compose\container.py", line 48, in create
  File "docker\api\container.py", line 422, in create_container
  File "docker\api\container.py", line 433, in create_container_config
  File "docker\types\containers.py", line 703, in __init__
  File "docker\utils\utils.py", line 464, in split_command
  File "shlex.py", line 315, in split
  File "shlex.py", line 300, in __next__
  File "shlex.py", line 109, in get_token
  File "shlex.py", line 191, in read_token
ValueError: No closing quotation
[17476] Failed to execute script docker-compose

version: '3'
services:
  db:
    restart: unless-stopped
    image: 'postgres:13'
    environment:
      PGPASSWORD: '${DB_PASSWORD:-secret}'
      POSTGRES_DB: '${DB_DATABASE}'
      POSTGRES_USER: '${DB_USERNAME}'
      POSTGRES_PASSWORD: '${DB_PASSWORD:-secret}'
    healthcheck:
      test: ["CMD", "pg_isready","-U","${DB_USERNAME}","-d","${DB_DATABASE}","-p","${DB_PORT}"]
      interval: 5s
      timeout: 5s
      retries: 3
    command: -p ${DB_PORT}
    ports:
      - "${DB_PORT}:${DB_PORT}"
  redis:
    image: 'redis:alpine'
    restart: unless-stopped
    command: 'redis-server --requirepass ${REDIS_PASSWORD} --port ${REDIS_PORT}'
    healthcheck:
      test: ["CMD", "redis-cli","-p","${REDIS_PORT}", "ping"]
      retries: 3
      timeout: 5s
      interval: 5s
    ports:
      - "${REDIS_PORT}"

Removing the line "command: 'redis-server --requirepass ${REDIS_PASSWORD} --port ${REDIS_PORT}'" docker compose works, but I don't know what is wrong. I have the follow .env in the same folder:

DB_CONNECTION=pgsql
DB_HOST=localhost
DB_PORT=6000
DB_DATABASE=test1
DB_USERNAME=test1
DB_PASSWORD=test1


REDIS_HOST=localhost
REDIS_PASSWORD='L\Cm;=9YV$v<{4,eLs/AN4[g{dA"R4wy'
REDIS_PORT=6001

I'm in windows 10.

CodePudding user response:

You have single quotes in your password and the command is wrapped in single quotes so definitely something is up with quotes and escaping them. I would also suggest to consider setting a password using the conf file.

  • Related