Java Error when using depends_on with condition in docker compose

Answered

In version 2.1 of the Docker Compose file the ability to add conditional dependencies was added, however, it does not work with pycharm as a Java error is thrown. For example, this docker compose file (taken from the docker documentation) works:

version: '2'
services:
  web:
    build: .
    depends_on:
      - db
      - redis
  redis:
    image: redis
  db:
    image: postgres

but then changing the dependencies to conditional:

version: '2.1'
services:
  web:
    build: .
    depends_on:
      db:
        condition: service_healthy
      redis:
        condition: service_started
  redis:
    image: redis
  db:
    image: redis
    healthcheck:
      test: "exit 0"

results in an error from pycharm when trying to run in web:

Cannot deserialize instance of `java.util.ArrayList` out of START_OBJECT token
at [Source: UNKNOWN; line: -1, column: -1] (through reference chain: com.intellij.docker.compose.configuration.beans.v2.DockerComposeConfigurationV2["services"]->java.util.LinkedHashMap["web"]->com.intellij.docker.compose.configuration.beans.v2.DockerComposeServiceV2["depends_on"])

I'm using pycharm 2018.2.3 professional, docker-compose 1.21.2 and docker 18.06.1-ce. 

0
2 comments

Hi, the problem was fixed in 2018.3 (PY-24915). Could you please give the EAP build a try?

0
Avatar
Permanently deleted user

Using the EAP version works, thanks!

0

Please sign in to leave a comment.