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] Broken terminal behavior in PyCharm #12505

Open
doctornkz-intelas opened this issue Jan 28, 2025 · 4 comments
Open

[BUG] Broken terminal behavior in PyCharm #12505

doctornkz-intelas opened this issue Jan 28, 2025 · 4 comments
Labels

Comments

@doctornkz-intelas
Copy link

doctornkz-intelas commented Jan 28, 2025

Description

I am using JetBrains PyCharm+Gateway for remote development. I am using an internal Pycharm terminal. Today I found that the latest version of docker-compose 2.32.4 is printing w Enable Watch message over my outputs. Take a look (v2.32.4):

w Enable Watch
w Enable Watch
w Enable Watch
w Enable Watch
w Enable Watch
w Enable Watch
w Enable Watch
w Enable Watch
w Enable Watch
nginx_server  | 172.19.0.1 - - [28/Jan/2025:19:48:51 +0000] "GET / HTTP/1.1" 200 615 "-" "curl/7.81.0" "-"
nginx_server  | 172.19.0.1 - - [28/Jan/2025:19:48:53 +0000] "GET / HTTP/1.1" 200 615 "-" "curl/7.81.0" "-"

I see only the last 2 lines and others are masked by w Enable Watch
Using 2.30.0 version - It works perfectly:

nginx_server  | 172.19.0.1 - - [28/Jan/2025:19:49:42 +0000] "GET / HTTP/1.1" 200 615 "-" "curl/7.81.0" "-"
nginx_server  | 172.19.0.1 - - [28/Jan/2025:19:49:44 +0000] "GET / HTTP/1.1" 200 615 "-" "curl/7.81.0" "-"
nginx_server  | 172.19.0.1 - - [28/Jan/2025:19:49:46 +0000] "GET / HTTP/1.1" 200 615 "-" "curl/7.81.0" "-"
nginx_server  | 172.19.0.1 - - [28/Jan/2025:19:49:48 +0000] "GET / HTTP/1.1" 200 615 "-" "curl/7.81.0" "-"
nginx_server  | 172.19.0.1 - - [28/Jan/2025:19:49:50 +0000] "GET / HTTP/1.1" 200 615 "-" "curl/7.81.0" "-"
nginx_server  | 172.19.0.1 - - [28/Jan/2025:19:49:52 +0000] "GET / HTTP/1.1" 200 615 "-" "curl/7.81.0" "-"
nginx_server  | 172.19.0.1 - - [28/Jan/2025:19:49:54 +0000] "GET / HTTP/1.1" 200 615 "-" "curl/7.81.0" "-"
nginx_server  | 172.19.0.1 - - [28/Jan/2025:19:49:57 +0000] "GET / HTTP/1.1" 200 615 "-" "curl/7.81.0" "-"
nginx_server  | 172.19.0.1 - - [28/Jan/2025:19:49:59 +0000] "GET / HTTP/1.1" 200 615 "-" "curl/7.81.0" "-"
nginx_server  | 172.19.0.1 - - [28/Jan/2025:19:50:01 +0000] "GET / HTTP/1.1" 200 615 "-" "curl/7.81.0" "-"
nginx_server  | 172.19.0.1 - - [28/Jan/2025:19:50:03 +0000] "GET / HTTP/1.1" 200 615 "-" "curl/7.81.0" "-"
nginx_server  | 172.19.0.1 - - [28/Jan/2025:19:50:05 +0000] "GET / HTTP/1.1" 200 615 "-" "curl/7.81.0" "-"
nginx_server  | 172.19.0.1 - - [28/Jan/2025:19:50:07 +0000] "GET / HTTP/1.1" 200 615 "-" "curl/7.81.0" "-"


w Enable Watch

It breaks user experience extremely - you can't debug STDOUT at all. Do we have any suggestions or something I overlooked?

Thank you!

Steps To Reproduce

Run Pycharm and create a simple config file, like this:

version: '3.9'

services:
  nginx:
    image: nginx:latest
    container_name: nginx_server
    ports:
      - "9999:80" # Maps port 9999 on your host to port 80 in the container
    restart: unless-stopped

To spawn logs, run command in the same Linux machine, or container - watch curl localhost:9999

Install version 2.30.0, for example, and run it from the internal PyCharm terminal:

$ docker compose up
WARN[0000] /*****docker-compose.yml: the attribute `version` is obsolete, it will be ignored, please remove it to avoid potential confusion 
[+] Running 1/0
 ✔ Container nginx_server  Created                                                                                                                           0.0s 
Attaching to nginx_server
nginx_server  | /docker-entrypoint.sh: /docker-entrypoint.d/ is not empty, will attempt to perform configuration
nginx_server  | /docker-entrypoint.sh: Looking for shell scripts in /docker-entrypoint.d/
nginx_server  | /docker-entrypoint.sh: Launching /docker-entrypoint.d/10-listen-on-ipv6-by-default.sh
nginx_server  | 10-listen-on-ipv6-by-default.sh: info: IPv6 listen already enabled
nginx_server  | /docker-entrypoint.sh: Sourcing /docker-entrypoint.d/15-local-resolvers.envsh
nginx_server  | /docker-entrypoint.sh: Launching /docker-entrypoint.d/20-envsubst-on-templates.sh
nginx_server  | /docker-entrypoint.sh: Launching /docker-entrypoint.d/30-tune-worker-processes.sh

Works perfectly!

Install version 2.32.4 and run the same manifest:

$ docker compose up
WARN[0000] /****docker-compose.yml: the attribute `version` is obsolete, it will be ignored, please remove it to avoid potential confusion 
[+] Running 1/1
 ✔ Container nginx_server  Created                                                                                                                            0.0s
w Enable Watch
w Enable Watch
w Enable Watch
w Enable Watch
w Enable Watch
w Enable Watch
w Enable Watch
w Enable Watch
w Enable Watch
w Enable Watch
w Enable Watch
w Enable Watch
w Enable Watch
w Enable Watch
w Enable Watch
w Enable Watch
w Enable Watch
w Enable Watch
nginx_server  | 2025/01/28 19:55:10 [notice] 1#1: start worker process 24
nginx_server  | 2025/01/28 19:55:10 [notice] 1#1: start worker process 25

We are getting the mess of the lines.

Compose Version

$ docker compose version
Docker Compose version v2.32.4

Docker Environment

$ docker info
Client: Docker Engine - Community
 Version:    27.5.1
 Context:    default
 Debug Mode: false
 Plugins:
  buildx: Docker Buildx (Docker Inc.)
    Version:  v0.20.0
    Path:     /usr/libexec/docker/cli-plugins/docker-buildx
  compose: Docker Compose (Docker Inc.)
    Version:  v2.32.4
    Path:     /usr/libexec/docker/cli-plugins/docker-compose

Server:
 Containers: 51
  Running: 20
  Paused: 0
  Stopped: 31
 Images: 60
 Server Version: 27.5.1
 Storage Driver: overlay2
  Backing Filesystem: extfs
  Supports d_type: true
  Using metacopy: false
  Native Overlay Diff: true
  userxattr: false
 Logging Driver: json-file
 Cgroup Driver: systemd
 Cgroup Version: 2
 Plugins:
  Volume: local
  Network: bridge host ipvlan macvlan null overlay
  Log: awslogs fluentd gcplogs gelf journald json-file local splunk syslog
 Swarm: inactive
 Runtimes: io.containerd.runc.v2 runc
 Default Runtime: runc
 Init Binary: docker-init
 containerd version: bcc810d6b9066471b0b6fa75f557a15a1cbf31bb
 runc version: v1.2.4-0-g6c52b3f
 init version: de40ad0
 Security Options:
  apparmor
  seccomp
   Profile: builtin
  cgroupns
 Kernel Version: 5.15.0-1011-aws
 Operating System: Ubuntu 22.04.5 LTS
 OSType: linux
 Architecture: x86_64
 CPUs: 4
 Total Memory: 15.45GiB
 Name: ip-10-4-36-85
 ID: a14d6d65-054d-411b-9868-fc6bdd2d3a94
 Docker Root Dir: /var/lib/docker
 Debug Mode: false
 Experimental: false
 Insecure Registries:
  127.0.0.0/8
 Live Restore Enabled: false

Anything else?

No response

@ndeloof
Copy link
Contributor

ndeloof commented Jan 29, 2025

Not sure about the root cause, but you can disable this by running with COMPOSE_MENU=false environment variable set

@doctornkz-intelas
Copy link
Author

@ndeloof Thank you, sir!
I can't reproduce the issue anymore, in the case it appears, I will use env from @ndeloof , closing issue

@vpatov
Copy link

vpatov commented Jan 30, 2025

We are also experiencing this issue all of a sudden, with (w Enable Watch or w Disable Watch) + newline at the beggining of every single STDOUT line, which makes reading logs much harder.

Setting COMPOSE_MENU=false as per @ndeloof suggestion resolves the issue, but it does seem like there is some underlying bug that should be addressed.

@doctornkz-intelas
Copy link
Author

So, it's reproducible, and not only our issue. Thank you, @vpatov for the update!

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

No branches or pull requests

3 participants