Skip to content
This repository has been archived by the owner on Nov 27, 2023. It is now read-only.

ECS: unexpected end of JSON input when running docker compose ps --format=json in v1.0.14 #1667

Closed
tmeijn opened this issue May 13, 2021 · 2 comments
Labels
ecs stale Inactive issue

Comments

@tmeijn
Copy link

tmeijn commented May 13, 2021

Description

when using ECS context and running docker compose up -d and thereafter immediately running docker compose ps --format=json I get an error message: unexpected end of JSON input. This is happening since updating to v1.0.14. I validated that v1.0.13 does not produce this error reverting back to that version.

Steps to reproduce the issue:

Install version 1.0.14

docker-compose.yml used:

version: "3.7"

services:
  backend:
    build: backend
    image: tmeijn/backend
    environment:
      POSTGRES_DB: example
      POSTGRES_PASSWORD: example
    depends_on:
      - db

  db:
    image: postgres
    restart: always
#    volumes:
#      - db-data:/var/lib/postgresql/data
    environment:
      POSTGRES_DB: example
      POSTGRES_PASSWORD: example

  proxy:
    build: proxy
    image: tmeijn/proxy
    ports:
      - 80:80
    depends_on: 
      - backend

Minimal script to reproduce:

#!/bin/sh
# Create an ECS context
docker context create ecs myecs --from-env

# Switch to newly created context
docker context use myecs

docker compose up -d

docker compose ps --format=json # this command produces `unexpected end of JSON input`

In version 1.0.13 and lower this produces null.

Note: when doing a sleep 10 before running the ps command it does show null.

Describe the results you received:

unexpected end of JSON input

Describe the results you expected:

null as I'd get in version v1.0.13 and before (min version tested: v1.0.11)

Additional information you deem important (e.g. issue happens only occasionally):

Usecase
I use docker compose up -d to workaround issue #1084 as I want to use a cluster with Fargate Spot provider. With the JSON output I validate certain conditions with jq.

Output of docker version:

Client: Docker Engine - Community
 Cloud integration: 1.0.14
 Version:           20.10.6
 API version:       1.41
 Go version:        go1.13.15
 Git commit:        370c289
 Built:             Fri Apr  9 22:46:38 2021
 OS/Arch:           linux/amd64
 Context:           myecs
 Experimental:      true

Server: Docker Engine - Community
 Engine:
  Version:          20.10.6
  API version:      1.41 (minimum version 1.12)
  Go version:       go1.13.15
  Git commit:       8728dd2
  Built:            Fri Apr  9 22:44:49 2021
  OS/Arch:          linux/amd64
  Experimental:     false
 containerd:
  Version:          1.4.4
  GitCommit:        05f951a3781f4f2c1911b05e61c160e9c30eaa8e
 runc:
  Version:          1.0.0-rc93
  GitCommit:        12644e614e25b05da6fd08a38ffa0cfe1903fdec
 docker-init:
  Version:          0.19.0
  GitCommit:        de40ad0

Output of docker context show:
You can also run docker context inspect context-name to give us more details but don't forget to remove sensitive content.

[
    {
        "Name": "myecs",
        "Metadata": {
            "Description": "credentials read from environment",
            "Type": "ecs"
        },
        "Endpoints": {
            "docker": {
                "SkipTLSVerify": false
            },
            "ecs": {
                "CredentialsFromEnv": true
            }
        },
        "TLSMaterial": {},
        "Storage": {
            "MetadataPath": "/home/tmeijn/.docker/contexts/meta/24835d5af7264331fc20359c2540af7e0f1ba2d94362379f4441258a5e71a631",
            "TLSPath": "/home/tmeijn/.docker/contexts/tls/24835d5af7264331fc20359c2540af7e0f1ba2d94362379f4441258a5e71a631"
        }
    }
]

Output of docker info:

Client:
 Context:    default
 Debug Mode: false
 Plugins:
  app: Docker App (Docker Inc., v0.9.1-beta3)
  buildx: Build with BuildKit (Docker Inc., v0.5.1-docker)
  compose: Docker Compose (Docker Inc., 2.0.0-beta.1)
  scan: Docker Scan (Docker Inc., v0.7.0)

Server:
 Containers: 8
  Running: 0
  Paused: 0
  Stopped: 8
 Images: 31
 Server Version: 20.10.6
 Storage Driver: overlay2
  Backing Filesystem: extfs
  Supports d_type: true
  Native Overlay Diff: true
  userxattr: false
 Logging Driver: json-file
 Cgroup Driver: cgroupfs
 Cgroup Version: 1
 Plugins:
  Volume: local
  Network: bridge host ipvlan macvlan null overlay
  Log: awslogs fluentd gcplogs gelf journald json-file local logentries splunk syslog
 Swarm: inactive
 Runtimes: io.containerd.runc.v2 io.containerd.runtime.v1.linux runc
 Default Runtime: runc
 Init Binary: docker-init
 containerd version: 05f951a3781f4f2c1911b05e61c160e9c30eaa8e
 runc version: 12644e614e25b05da6fd08a38ffa0cfe1903fdec
 init version: de40ad0
 Security Options:
  apparmor
  seccomp
   Profile: default
 Kernel Version: 5.8.0-50-generic
 Operating System: Ubuntu 20.10
 OSType: linux
 Architecture: x86_64
 CPUs: 12
 Total Memory: 31.08GiB
 Name: tmeijn-NHxxRZQ
 ID: GAPM:YYBE:NYV5:F4NC:UTXI:A5WZ:VUG4:LEJZ:N3WA:DLXX:XVYR:5NB7
 Docker Root Dir: /var/lib/docker
 Debug Mode: false
 Username: tmeijn
 Registry: https://index.docker.io/v1/
 Labels:
 Experimental: false
 Insecure Registries:
  127.0.0.0/8
 Live Restore Enabled: false

Additional environment details (AWS ECS, Azure ACI, local, etc.):

AWS ECS

@ndeloof ndeloof added the ecs label May 17, 2021
@stale
Copy link

stale bot commented Jan 3, 2022

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

@stale stale bot added the stale Inactive issue label Jan 3, 2022
@stale
Copy link

stale bot commented Apr 16, 2022

This issue has been automatically closed because it had not recent activity during the stale period.

@stale stale bot closed this as completed Apr 16, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
ecs stale Inactive issue
Projects
None yet
Development

No branches or pull requests

2 participants