Open jogerj opened 1 week ago
https://github.com/portainer/portainer/blob/607feb183e6255bb24c2530d440c5d997d86b301/app/react/kubernetes/applications/ConsoleView/ConsoleView.tsx#L79-L81
The following lines cannot be disabled and is forced to be sent, even when the target attached console is not necessarily sh compliant
sh
>
Attaches to console without side effects. The sent commands should be optional.
export LANG=C.UTF-8 > export LC_ALL=C.UTF-8 > clear [12:47:18 INFO]: Unknown command. Type "/help" for help. [12:47:18 INFO]: Unknown command. Type "/help" for help. [12:47:18 INFO]: [Essentials] CONSOLE issued server command: /clear [12:47:18 INFO]: Error: Player not found. >
Attaches to console and sends the command always
tty
stdin_open
true
e.g.
services: paper: image: itzg/minecraft-server tty: true stdin_open: true restart: unless-stopped environment: EULA: "TRUE" TYPE: PAPER VERSION: "1.20.4" USE_AIKAR_FLAGS: true
2.20.3
Community Edition (CE)
Docker 26.1.4
Ubuntu 22.04 LTS, ARM64
No response
.env:
PORTAINER_VERSION=2.20.3
docker-compose.yml:
services: portainer: container_name: portainer image: portainer/portainer-ce:${PORTAINER_VERSION} command: -H tcp://tasks.agent:9001 --tlsskipverify restart: unless-stopped volumes: - /var/run/docker.sock:/var/run/docker.sock - portainer_data:/data networks: - caddy networks: caddy: external: true volumes: portainer_data:
I thought of submitting this under feature request (to make the extra commands optional), but I'd argue it's a bug because it causes unintended behavior.
Also in other parts of code, there seems to be a check before sending the commands whether target is a linux terminal or not. https://github.com/portainer/portainer/blob/607feb183e6255bb24c2530d440c5d997d86b301/app/docker/views/containers/console/containerConsoleController.js#L179-L186
Hi @jogerj Thank you for reporting this, I confirmed this with the compose you provided. I am raising this internally
internal: EE-7293
Before you start please confirm the following.
Problem Description
https://github.com/portainer/portainer/blob/607feb183e6255bb24c2530d440c5d997d86b301/app/react/kubernetes/applications/ConsoleView/ConsoleView.tsx#L79-L81
The following lines cannot be disabled and is forced to be sent, even when the target attached console is not necessarily
sh
compliantExpected Behavior
Attaches to console without side effects. The sent commands should be optional.
Actual Behavior
Attaches to console and sends the command always
Steps to Reproduce
tty
andstdin_open
set totrue
e.g.
Portainer logs or screenshots
Portainer version
2.20.3
Portainer Edition
Community Edition (CE)
Platform and Version
Docker 26.1.4
OS and Architecture
Ubuntu 22.04 LTS, ARM64
Browser
No response
What command did you use to deploy Portainer?
.env:
docker-compose.yml:
Additional Information
I thought of submitting this under feature request (to make the extra commands optional), but I'd argue it's a bug because it causes unintended behavior.
Also in other parts of code, there seems to be a check before sending the commands whether target is a linux terminal or not. https://github.com/portainer/portainer/blob/607feb183e6255bb24c2530d440c5d997d86b301/app/docker/views/containers/console/containerConsoleController.js#L179-L186