influxdata / influxdata-docker

Official docker images for the influxdata stack
323 stars 248 forks source link

influxdb console arrow buttons don't work in docker container #26

Open jsternberg opened 7 years ago

jsternberg commented 7 years ago

Originally described in influxdata/influxdb#7444, the arrow buttons don't work inside of a docker container for the influxdb console. History still works if you use Ctrl+R, but up, down, left, and right do not work.

Investigate the reason why since the history feature is pretty useful.

jsternberg commented 7 years ago

I am unable to reproduce this with the latest version of docker which is 1.12.2. @rolele can you try this again with the latest docker?

rolele commented 7 years ago

the docker 1.12.2 version for mac native is not yet released. I will surely do as soon as it is released

mje-nz commented 7 years ago

Why was this issue closed? It still occurs for me with InfluxDB 1.1.1, using Docker 1.12.3 on Mac OSX and Docker 1.12.5 on Raspbian.

rolele commented 7 years ago

yes it does.

jsternberg commented 7 years ago

For anyone running into this issue, can you give me the docker command you are using so I can try to reproduce this later?

mje-nz commented 7 years ago

Sorry @jsternberg, turns out my issue was docker/docker#8755 as specified in the Docker Hub readme.

@rolele, does running docker run --rm --link=influxdb -it influxdb influx -host influxdb as explained in the CLI section here fix your issue too?

jsternberg commented 7 years ago

I'm going to close this again. If this happens to anybody else, please give me how you reproduced it so I can fix this immediately. If you are using docker exec, the influx binary won't work.

voiprodrigo commented 7 years ago

I'm not using docker and I have this problem of not being able to use the arrow keys with Influx RPM on CenOS 7. Any tips?

svenkirsten commented 7 years ago

The same for me, I use als influx console client on CentOS 7.2 with influx 1.2.4. And I can't use the Up-Arrrow.

toddbu commented 7 years ago

@jsternberg, the problem here happens when TERM is not set properly in bash. To repro, do this:

  1. Fire up the InfluxDB container in any OS (I used Ubuntu LTS 16.04) using docker run -d --restart=always -p 8086:8086 influxdb:latest

  2. Connect to the container using docker exec -it <container ID> bash

  3. Type influx. Notice that up arrow gives ^[[A. Type quit

  4. Type set | grep "TERM". Notice that TERM is set to "dumb"

  5. Type export TERM=xterm. Repeat step 3 above. Notice that your history now works

It would be great if the InfluxDB docker containers would set the TERM value to something more usable at startup. The value of TERM should pass through when running docker exec but as I recall there's an open bug for that in Docker

flyrev commented 6 years ago

It doesn't work even if TERM=xterm.

$ docker run -d influxdb:latest
32b7b9025a5ccb2dd9c39929bc60c6bec120a319665e2000ccbb35b24fc7d1d6
$ docker exec -it 32b7b9025a5ccb2dd9c39929bc60c6bec120a319665e2000ccbb35b24fc7d1d6 bash
root@32b7b9025a5c:/# set | grep TERM
TERM=xterm
root@32b7b9025a5c:/# influx
Connected to http://localhost:8086 version 1.6.0
InfluxDB shell version: 1.6.0
> ^[[A

Note that arrows work inside the container itself, but not in influx.

Tried with both 1.5.0 and 1.6.0.

desprit commented 6 years ago

I'm using influxdb:alpine and arrows don't work when I connect to influx container and run influx shell.

jsternberg commented 6 years ago

I've reopened this issue. Anyone who runs into this issue, I will need you to run docker info and copy the output so I can properly look into this issue.

desprit commented 6 years ago
Containers: 6                                                                 
 Running: 6                                                                   
 Paused: 0                                                                    
 Stopped: 0                                                                   
Images: 430                                                                   
Server Version: 18.03.1-ce                                                    
Storage Driver: overlay2                                                      
 Backing Filesystem: extfs                                                    
 Supports d_type: true                                                        
 Native Overlay Diff: true                                                    
Logging Driver: json-file                                                     
Cgroup Driver: cgroupfs                                                       
Plugins:                                                                      
 Volume: local                                                                
 Network: bridge host macvlan null overlay                                    
 Log: awslogs fluentd gcplogs gelf journald json-file logentries splunk syslog
Swarm: active                                                                 
 NodeID: mosa3m69191i3uz2gdpoqlcaf                                            
 Is Manager: true                                                             
 ClusterID: lvkew9x4otrb27bn19nzldkon                                         
 Managers: 1                                                                  
 Nodes: 1                                                                     
 Orchestration:
  Task History Retention Limit: 5
 Raft:
  Snapshot Interval: 10000
  Number of Old Snapshots to Retain: 0
  Heartbeat Tick: 1
  Election Tick: 10
 Dispatcher:
  Heartbeat Period: 5 seconds
 CA Configuration:
  Expiry Duration: 3 months
  Force Rotate: 0
 Autolock Managers: false
 Root Rotation In Progress: false
 Node Address: 192.168.88.139
 Manager Addresses:
  192.168.88.139:2377
Runtimes: runc
Default Runtime: runc
Init Binary: docker-init
containerd version: 773c489c9c1b21a6d78b5c538cd395416ec50f88    
runc version: 4fc53a81fb7c994640722ac585fa9ca548971871
init version: 949e6fa
Security Options:
 apparmor
 seccomp
  Profile: default
Kernel Version: 4.4.0-97-generic
Operating System: Linux Mint 18.1
OSType: linux
Architecture: x86_64
CPUs: 4
Total Memory: 9.324GiB
Name: desprit-mint-vm
ID: P3RM:K7G6:IQ7D:CIT2:4YPP:4DMS:5JQM:GVNE:TCOU:K6IP:JMNG:55GB 
Docker Root Dir: /var/lib/docker
Debug Mode (client): false
Debug Mode (server): false
Username: desprit
Registry: https://index.docker.io/v1/
Labels:
Experimental: false
Insecure Registries:
 127.0.0.0/8
Live Restore Enabled: false

WARNING: No swap limit support
rantoniuk commented 6 years ago
containers: 3
 Running: 2
 Paused: 0
 Stopped: 1
Images: 4
Server Version: 17.12.0-ce
Storage Driver: overlay2
 Backing Filesystem: extfs
 Supports d_type: true
 Native Overlay Diff: true
Logging Driver: json-file
Cgroup Driver: cgroupfs
Plugins:
 Volume: local
 Network: bridge host macvlan null overlay
 Log: awslogs fluentd gcplogs gelf journald json-file logentries splunk syslog
Swarm: inactive
Runtimes: runc
Default Runtime: runc
Init Binary: docker-init
containerd version: 89623f28b87a6004d4b785663257362d1658a729
runc version: b2567b37d7b75eb4cf325b77297b140ea686ce8f
init version: 949e6fa
Security Options:
 apparmor
 seccomp
  Profile: default
Kernel Version: 4.4.0-112-generic
Operating System: Ubuntu 16.04.3 LTS
OSType: linux
Architecture: x86_64
CPUs: 8
Total Memory: 29.45GiB
Name: influxdb-efacbf0
ID: VIVU:YVM5:W3BG:X2CG:XROG:TBMK:5JWT:2SFI:IBVC:JB4T:VSQI:K7LT
Docker Root Dir: /var/lib/docker
Debug Mode (client): false
Debug Mode (server): false
Registry: https://index.docker.io/v1/
Labels:
Experimental: false
Insecure Registries:
 127.0.0.0/8
Live Restore Enabled: false
ereyes01 commented 6 years ago

EDIT: Was able to work around this as follows:

$ docker exec -e TERM=xterm -it influxdb_container bash
root@container:/# influx

And now my arrow keys work. This did NOT work:

$ docker exec -e TERM=xterm -it influxdb_container influx

---- Original message below:

Using image influxdb:1.6 and hitting this issue.

docker info output follows below:

Containers: 22
 Running: 5
 Paused: 0
 Stopped: 17
Images: 444
Server Version: 18.06.0-ce
Storage Driver: overlay2
 Backing Filesystem: extfs
 Supports d_type: true
 Native Overlay Diff: true
Logging Driver: json-file
Cgroup Driver: cgroupfs
Plugins:
 Volume: local
 Network: bridge host macvlan null overlay
 Log: awslogs fluentd gcplogs gelf journald json-file logentries splunk syslog
Swarm: inactive
Runtimes: runc
Default Runtime: runc
Init Binary: docker-init
containerd version: d64c661f1d51c48782c9cec8fda7604785f93587
runc version: 69663f0bd4b60df09991c08812a60108003fa340
init version: fec3683
Security Options:
 apparmor
 seccomp
  Profile: default
Kernel Version: 4.15.0-32-generic
Operating System: Ubuntu 16.04.5 LTS
OSType: linux
Architecture: x86_64
CPUs: 4
Total Memory: 15.43GiB
Name: moatcailin
ID: BUEL:6UZK:ZESF:IAVO:G7BQ:TGJ6:GJAF:ZH23:5LOV:RLVV:RW7G:SZFY
Docker Root Dir: /var/lib/docker
Debug Mode (client): false
Debug Mode (server): false
Registry: https://index.docker.io/v1/
Labels:
Experimental: false
Insecure Registries:
 127.0.0.0/8
Live Restore Enabled: false

WARNING: No swap limit support
darenyong commented 5 years ago
$ docker exec -e TERM=xterm -it influxdb_container bash
root@container:/# influx

This did not work for me, Mac OS High Sierra, Docker version 18.03.1-ce, build 9ee9f40.

Up arrow still produces ^[[A

adam-nielsen commented 5 years ago

How strange. This also works for me:

$ docker exec -it influxdb_container bash
root@container:/# influx

However this does not:

$ docker exec -it influxdb_container bash -c influx

I wonder what the difference is?

positron96 commented 5 years ago

I confirm that in alpine version it does not work even with TERM=xterm

AlessioGiambrone commented 5 years ago

After setting TERM=xterm (didn't work), then TERM=screen-256color, I've been able to have the history working, but as soon as I exited influx and re-entered it wasn't working anymore. I've tried many times but can't reproduce.

Docker image is influxdb:1.7.6.

positron96 commented 4 years ago

Does anyone who experience this issue also cannot move cursor with LEFT and RIGHT keyboard keys? Mine do not work inside influx cli when started from docker exec … bash. This is even more inconvenient than lack of history. Output looks like this:

$ docker exec -it influxdb bash
bash-4.4# set | grep TERM
TERM=xterm
bash-4.4# influx
Connected to http://localhost:8086 version 1.7.9
InfluxDB shell version: 1.7.9
> delete^[[D^[[D^[[D

PS Everything works fine in bash itself inside that same container, as described above.

huahuayu commented 4 years ago

same issue here. I run ubuntu image in docker, the up, down, left, right key pressed is not working, instead ^[[A^[[B^[[D^[[C printed on the terminal.

container image:

REPOSITORY                                  TAG                 IMAGE ID            CREATED             SIZE
ubuntu                                      latest              47b19964fb50        11 months ago       88.1MB

docker: 2.1.0.4(39773)

system: mac os 10.15.2

terminal: iterm2 3.3.6

anyone who needs more info to reproduce, please let me know.

jonhammer commented 4 years ago

FWIW I've experienced this issue weirdly intermittently as well.

Using tmux inside of iterm I will see the issue. Then sometimes if I open a new terminal I can get it to work just fine. Still have not figured out what the trick is.

kiwenlau commented 4 years ago

I found the same issue when using influxdb:1.7.9, It shows " ^[[A^[[B^[[D^[[C" when I presss "up, down, left, right" key.

docker run --name influxdb -p 8086:8086 -v /influxdb:/var/lib/influxdb -d dockerhub.azk8s.cn/library/influxdb:1.7.9
Unable to find image 'dockerhub.azk8s.cn/library/influxdb:1.7.9' locally
1.7.9: Pulling from library/influxdb
3192219afd04: Pull complete
17c160265e75: Pull complete
cc4fe40d0e61: Pull complete
2f7e80883a6e: Pull complete
201d9ee900dd: Pull complete
cc91dcf5bc21: Pull complete
06344aa0843d: Pull complete
2beec574b3bc: Pull complete
Digest: sha256:55770f3ab210aba5e9d7125c260864e22134c09e51d7f02fd28849dd5f8ebb40
Status: Downloaded newer image for dockerhub.azk8s.cn/library/influxdb:1.7.9
466f1adc96d761b78caa3356d823d07941377a21d4bcc790dbc93c09cef8fd87

docker exec -it influxdb influx
Connected to http://localhost:8086 version 1.7.9
InfluxDB shell version: 1.7.9
> ^[[A^[[B^[[D^[[C