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

Select and Copy output of Terminal panel #2512

Closed
wiserweb opened this issue Sep 21, 2016 · 22 comments
Closed

Select and Copy output of Terminal panel #2512

wiserweb opened this issue Sep 21, 2016 · 22 comments
Labels
kind/question Questions that haven't been identified as being feature requests or bugs.

Comments

@wiserweb
Copy link

[Background]

I'm coming from cloud9 world which uses Ace editor.

[Issue]
With cloud9 it is possible to highlight/select terminal output. This does not seem possible with Eclipse Che at this time. This is problematic since your app may output warning/debug messages via the terminal and these must be typed in manually into your favourite search engine.

I'm hoping to be able to move all development to Eclipse Che.

Expected behavior:

Ability to highlight/select output terminal text for bidirectional copy/paste capability.

Observed behavior:

Unable to select text. However, Crtl-V works from host clipboard.

Che version: Latest
OS and version: Mint 17.4
Docker version: 1.11.2
Che install: Docker

Additional information:

  • Problem started happening recently, didn't happen in an older version of Che: N/A
  • Problem can be reliably reproduced, doesn't happen randomly: Yes
@ghost ghost added the kind/question Questions that haven't been identified as being feature requests or bugs. label Sep 21, 2016
@ghost
Copy link

ghost commented Sep 21, 2016

@wiserweb i have just built the latest Che and can select, copy and paste from/to terminal. I am using Chrome.

@wiserweb
Copy link
Author

wiserweb commented Sep 21, 2016

Thanks. @eivantsov I am using Chrome as well..... investigating on my end further.

@wiserweb
Copy link
Author

@eivantsov Firefox v48 and Chrome v53.0.2785.116 both exhibit the same behavior. Also tried with Firefox Development Edition v 50.0a2 (2016-09-19) without any add-ons.

@ghost
Copy link

ghost commented Sep 21, 2016

What's your Che version? Help > About?

@wiserweb
Copy link
Author

wiserweb commented Sep 21, 2016

@eivantsov 4.7.2

@ghost
Copy link

ghost commented Sep 21, 2016

Can you try the nightly build please?

@wiserweb
Copy link
Author

Yes, will do now. brb

@wiserweb
Copy link
Author

wiserweb commented Sep 21, 2016

Ok, new to docker... so I have the new image (I think)

codenvy/che-server                                                             nightly             5889f4564ab1        10 hours ago        322.4 MB
codenvy/che                                                                    nightly             5889f4564ab1        10 hours ago        322.4 MB

Trying to run it this way

docker run --rm -t -v /var/run/docker.sock:/var/run/docker.sock 5889f4564ab1 start

Outputs the following


############## HOW TO CONNECT YOUR CHE CLIENT ###############
After Che server has booted, you can connect your clients by:
1. Open browser to http://localhost:8080, or:
2. Open native chromium app.
#############################################################

Using CATALINA_BASE:   /home/user/che/tomcat
Using CATALINA_HOME:   /home/user/che/tomcat
Using CATALINA_TMPDIR: /home/user/che/tomcat/temp
Using JRE_HOME:        /usr/lib/jvm/default-jvm/jre
Using CLASSPATH:       /home/user/che/tomcat/conf/:/usr/lib/jvm/default-jvm/jre/lib/tools.jar:/home/user/che/tomcat/bin/bootstrap.jar:/home/user/che/tomcat/bin/tomcat-juli.jar
Tomcat started.

But nothing on localhost:8080

What might I be doing incorrectly... ?

Image doesn't appear to start.

$ docker ps
CONTAINER ID        IMAGE               COMMAND             CREATED             STATUS              PORTS               NAMES

@ghost
Copy link

ghost commented Sep 21, 2016

What's 5889f4564ab1? ImageID?

Give it a shot this way:

docker run --rm -t -v /var/run/docker.sock:/var/run/docker.sock codenvy/che:nightly start

@wiserweb
Copy link
Author

wiserweb commented Sep 21, 2016

Yes, image ID. Tried that command, same result.

docker ps
CONTAINER ID        IMAGE               COMMAND             CREATED             STATUS              PORTS               NAMES

I will restart the docker host.

@wiserweb
Copy link
Author

wiserweb commented Sep 21, 2016

@eivantsov Fresh boot.

docker run --rm -t -v /var/run/docker.sock:/var/run/docker.sock codenvy/che:nightly start

!!!
!!! Running 'docker' succeeded, but 'docker ps' failed. 
The file /var/run/docker.sock does not have appropriate permissions. 
OWNER READ:  r 
OWNER WRITE: w 
GROUP READ:  r 
GROUP WRITE: w 
OTHER READ:  - 
OTHER WRITE: - 
Run 'sudo chmod 666 /var/run/docker.sock' to give the right permissions.
!!!

root@opteron:~# sudo chmod 666 /var/run/docker.sock
root@opteron:~# docker run --rm -t -v /var/run/docker.sock:/var/run/docker.sock codenvy/che:nightly start

############## HOW TO CONNECT YOUR CHE CLIENT ###############
After Che server has booted, you can connect your clients by:
1. Open browser to http://localhost:8080, or:
2. Open native chromium app.
#############################################################

Using CATALINA_BASE:   /home/user/che/tomcat
Using CATALINA_HOME:   /home/user/che/tomcat
Using CATALINA_TMPDIR: /home/user/che/tomcat/temp
Using JRE_HOME:        /usr/lib/jvm/default-jvm/jre
Using CLASSPATH:       /home/user/che/tomcat/conf/:/usr/lib/jvm/default-jvm/jre/lib/tools.jar:/home/user/che/tomcat/bin/bootstrap.jar:/home/user/che/tomcat/bin/tomcat-juli.jar
Tomcat started.
root@opteron:~# docker ps
CONTAINER ID        IMAGE               COMMAND             CREATED             STATUS              PORTS               NAMES
root@opteron:~# 

Any clue what might be happening.

The host is Ubuntu 16.04.

$ uname -a
Linux opteron 4.4.0-38-generic #57-Ubuntu SMP Tue Sep 6 15:42:33 UTC 2016 x86_64 x86_64 x86_64 GNU/Linux

It's 3am my time... I will resume this tomorrow.

Confirmed working on beta.codenvy.com, able to select text in Terminal.

Issue may be related to setting CHE_HOST_IP and running on non localhost...?

Initially host environment variable was set to

export CHE_HOST_IP=192.168.1.111

It is possible that could be causing the non-select behavior... ?

Possible root cause. Confirmed w

@ghost
Copy link

ghost commented Sep 21, 2016

docker run --rm -v /var/run/docker.sock:/var/run/docker.sock codenvy/che:nightly start what if you drop -t?

@wiserweb
Copy link
Author

wiserweb commented Sep 21, 2016

@eivantsov new command doesn't seem to bring up any instances. Docker ps is still empty.

At least I can select text with the hosted edition at beta.codenvy.com so the root cause might be that it was configured with a different CHE_HOST_IP... cannot investigate until tomorrow, err, later today.

Thanks for assistance.

@ghost
Copy link

ghost commented Sep 21, 2016

You need to add -p 8080:8080 and drop --rm

@wiserweb
Copy link
Author

@eivantsov I think I found something.

If started with CLI with che.sh the terminal output is not selectable. Perhaps the issue resides with the CLI script instead of Eclipse Che itself.

root@opteron:/home/owner# export CHE_HOST_IP=192.168.1.111
root@opteron:/home/owner# echo $CHE_HOST_IP
192.168.1.111
root@opteron:/home/owner# ./che.sh start
WARNING: No swap limit support
---------------------------------------
ERROR: !!!
ERROR: !!! 
           A container running ECLIPSE CHE named "che-server" already exists.
             1. Use "info" to find it's URL.
             2. Use "restart" to stop it and start anew.
             3. Stop it with "stop".
             4. Remove it manually (docker rm -f che-server) and try again. Or:
             5. Set CHE_SERVER_CONTAINER_NAME to a different value and try again.
ERROR: !!!
---------------------------------------
root@opteron:/home/owner# docker rm -f che-server
che-server
root@opteron:/home/owner# ./che.sh start
WARNING: No swap limit support
INFO: ECLIPSE CHE: Found image codenvy/che-server:latest
INFO: ECLIPSE CHE: Starting container...
INFO: ECLIPSE CHE: Server logs at "docker logs -f che-server"
INFO: ECLIPSE CHE: Server booting...
INFO: ECLIPSE CHE: Booted and reachable
INFO: ECLIPSE CHE: Ver: 4.7.2
INFO: ECLIPSE CHE: Use: http://192.168.1.111:8080
INFO: ECLIPSE CHE: API: http://192.168.1.111:8080/swagger

I will try -p 8080:8080 tomorrow to see if this makes a difference.

@wiserweb
Copy link
Author

wiserweb commented Sep 22, 2016

@eivantsov Here's an update.

root@opteron:/home/owner# che info
WARNING: No swap limit support
INFO: ---------------------------------------
INFO: -------------   CLI INFO   ------------
INFO: ---------------------------------------
INFO: 
INFO: ---------  PLATFORM INFO  -------------
INFO: CLI DEFAULT PROFILE       = not set
INFO: CHE_VERSION               = latest
INFO: CHE_UTILITY_VERSION       = nightly
INFO: DOCKER_INSTALL_TYPE       = native
INFO: DOCKER_HOST_IP            = 192.168.1.111
INFO: IS_NATIVE                 = YES
INFO: IS_WINDOWS                = NO
INFO: IS_DOCKER_FOR_WINDOWS     = NO
INFO: IS_DOCKER_FOR_MAC         = NO
INFO: IS_BOOT2DOCKER            = NO
INFO: HAS_DOCKER_FOR_WINDOWS_IP = NO
INFO: IS_MOBY_VM                = NO
INFO: HAS_CHE_ENV_VARIABLES     = YES
INFO: HAS_TEMP_CHE_PROPERTIES   = NO
INFO: HAS_INTERACTIVE           = YES
INFO: HAS_PSEUDO_TTY            = YES
INFO: 
INFO: ---------------------------------------
INFO: ---------   LAUNCHER INFO  ------------
INFO: ---------------------------------------
INFO: 
INFO: ---------  PLATFORM INFO  -------------
INFO: DOCKER_INSTALL_TYPE       = native
WARNING: No swap limit support
INFO: DOCKER_HOST_OS            = Ubuntu 16.04.1 LTS
INFO: DOCKER_HOST_IP            = 172.17.0.1
INFO: DOCKER_HOST_EXTERNAL_IP   = not set
INFO: DOCKER_DAEMON_VERSION     = 1.11.2
INFO: 
INFO: 
INFO: --------- CHE INSTANCE INFO  ----------
INFO: CHE CONTAINER EXISTS      = YES
INFO: CHE CONTAINER STATUS      = stopped
INFO: 
INFO: 
INFO: ----  CURRENT COMMAND LINE OPTIONS  ---
INFO: CHE_PORT                  = 8080
INFO: CHE_VERSION               = latest
INFO: CHE_RESTART_POLICY        = no
INFO: CHE_USER                  = root
INFO: CHE_HOST_IP               = 192.168.1.111
INFO: CHE_LOG_LEVEL             = info
INFO: CHE_DEBUG_SERVER          = false
INFO: CHE_DEBUG_SERVER_PORT     = 8000
INFO: CHE_HOSTNAME              = localhost
INFO: CHE_DATA_FOLDER           = /home/user/che
INFO: CHE_CONF_FOLDER           = not set
INFO: CHE_LOCAL_BINARY          = not set
INFO: CHE_SERVER_CONTAINER_NAME = che-server
INFO: CHE_SERVER_IMAGE_NAME     = codenvy/che-server
root@opteron:/home/owner# che profile list
WARNING: No swap limit support
INFO: Available che CLI profiles:
wiserweb
INFO: Default profile currently unset.
root@opteron:/home/owner# che profile set wiserweb
WARNING: No swap limit support
INFO: 
INFO: Set active che CLI profile to ~/.che/profiles/wiserweb.
INFO: 
root@opteron:/home/owner# che info --networking
WARNING: No swap limit support
INFO: ECLIPSE CHE: Loaded profile wiserweb
INFO: 
INFO: ---------------------------------------
INFO: --------   CONNECTIVITY TEST   --------
INFO: ---------------------------------------
INFO: Browser             => Workspace Agent (Hostname)   : Connection succeeded
INFO: Browser             => Workspace Agent (External IP): Connection succeeded
INFO: Che Server          => Workspace Agent (External IP): Connection succeeded
INFO: Che Server          => Workspace Agent (Internal IP): Connection succeeded
root@opteron:/home/owner# che stop
WARNING: No swap limit support
INFO: ECLIPSE CHE: Loaded profile wiserweb
INFO: ECLIPSE CHE: Container is not running. Nothing to do.
root@opteron:/home/owner# che start
WARNING: No swap limit support
INFO: ECLIPSE CHE: Loaded profile wiserweb
---------------------------------------
ERROR: !!!
ERROR: !!! 
           A container running ECLIPSE CHE named "che-server" already exists.
             1. Use "info" to find it's URL.
             2. Use "restart" to stop it and start anew.
             3. Stop it with "stop".
             4. Remove it manually (docker rm -f che-server) and try again. Or:
             5. Set CHE_SERVER_CONTAINER_NAME to a different value and try again.
ERROR: !!!
---------------------------------------
root@opteron:/home/owner# docker rm -f che-server
che-server
root@opteron:/home/owner# che start
WARNING: No swap limit support
INFO: ECLIPSE CHE: Loaded profile wiserweb
INFO: ECLIPSE CHE: Found image codenvy/che-server:latest
INFO: ECLIPSE CHE: Starting container...
INFO: ECLIPSE CHE: Server logs at "docker logs -f che-server"
INFO: ECLIPSE CHE: Server booting...
INFO: ECLIPSE CHE: Booted and reachable
INFO: ECLIPSE CHE: Ver: 4.7.2
INFO: ECLIPSE CHE: Use: http://192.168.1.111:8080
INFO: ECLIPSE CHE: API: http://192.168.1.111:8080/swagger
root@opteron:/home/owner# 

Results:

ws-machine pane, text is selectable.
Terminal pane, text is not selectable.

Tested on localhost:8080, and using IP 192.168.1.111:8080

@ghost
Copy link

ghost commented Sep 22, 2016

@wiserweb you aren't using a nightly image. I see :latest tag.

@wiserweb
Copy link
Author

wiserweb commented Sep 22, 2016

Hi, @eivantsov ,

I just tried :nightly with pure docker commands, no CLI.

And did a fresh pull of nightly images using

$ che update

root@opteron:~/.che/profiles# docker run -p 8080:8080 -v /var/run/docker.sock:/var/run/docker.sock codenvy/che:nightly start

############## HOW TO CONNECT YOUR CHE CLIENT ###############
After Che server has booted, you can connect your clients by:
1. Open browser to http://localhost:8080, or:
2. Open native chromium app.
#############################################################

Tomcat started.
root@opteron:~/.che/profiles# docker ps
CONTAINER ID        IMAGE               COMMAND             CREATED             STATUS              PORTS               NAMES
root@opteron:~/.che/profiles# docker run -p 8080:8080 -t -v /var/run/docker.sock:/var/run/docker.sock codenvy/che:nightly start

############## HOW TO CONNECT YOUR CHE CLIENT ###############
After Che server has booted, you can connect your clients by:
1. Open browser to http://localhost:8080, or:
2. Open native chromium app.
#############################################################

Using CATALINA_BASE:   /home/user/che/tomcat
Using CATALINA_HOME:   /home/user/che/tomcat
Using CATALINA_TMPDIR: /home/user/che/tomcat/temp
Using JRE_HOME:        /usr/lib/jvm/default-jvm/jre
Using CLASSPATH:       /home/user/che/tomcat/conf/:/usr/lib/jvm/default-jvm/jre/lib/tools.jar:/home/user/che/tomcat/bin/bootstrap.jar:/home/user/che/tomcat/bin/tomcat-juli.jar
Tomcat started.
root@opteron:~/.che/profiles# 

No Docker instances are initiated using these commands.

When I use CLI I can select output in ws-machine but not in Terminal... this is odd.

@wiserweb
Copy link
Author

Here's the debug output.

Could you kindly compare with expected value?

root@opteron:~/.che/profiles# docker run  --rm -t -v /var/run/docker.sock:/var/run/docker.sock codenvy/che:nightly --debug start
USE_BLOCKING_ENTROPY: false
USE_DOCKER: false
CHE_DOCKER_TAG: latest
CHE_PORT: 8080
CHE_IP: ""
LOGGING_LEVEL: DEBUG
CHE_DOCKER_MACHINE: che
COPY_LIB: true
MACHINE_DRIVER: virtualbox
LAUNCH_REGISTRY: false
SKIP_PRINT_CLIENT: false
SKIP_DOCKER_UID: false
SKIP_JAVA_VERSION: false
USE_HELP: false
CHE_SERVER_ACTION: start
USE_DEBUG: true

############## HOW TO CONNECT YOUR CHE CLIENT ###############
After Che server has booted, you can connect your clients by:
1. Open browser to http://localhost:8080, or:
2. Open native chromium app.
#############################################################

Using CATALINA_BASE:   /home/user/che/tomcat
Using CATALINA_HOME:   /home/user/che/tomcat
Using CATALINA_TMPDIR: /home/user/che/tomcat/temp
Using JRE_HOME:        /usr/lib/jvm/default-jvm/jre
Using CLASSPATH:       /home/user/che/tomcat/conf/:/usr/lib/jvm/default-jvm/jre/lib/tools.jar:/home/user/che/tomcat/bin/bootstrap.jar:/home/user/che/tomcat/bin/tomcat-juli.jar
Tomcat started.
root@opteron:~/.che/profiles# 

@TylerJewell
Copy link

This output doesn't help. Please can you rerun with the CLI. 'Export CHE_VERSION=NIGHTLY' and then rerun. Thanks.

@wiserweb
Copy link
Author

wiserweb commented Sep 22, 2016

Success!!!

Steps to reproduce:

Make changes to environment profile.

$ sudo nano /etc/sudoers.d/che

Ensure it contains

Defaults        env_keep +="CHE_HOST_IP"
Defaults        env_keep +="CHE_VERSION"

With regular user, export environment variables.

export CHE_HOST_IP=192.168.1.111
export CHE_VERSION=nightly

Note: 'nightly' must be lowercase, doesn't appear to work with uppercase.

As regular user use env to verify environment variables have taken.

$ env
USER=owner
CHE_HOST_IP=192.168.1.111
CHE_VERSION=nightly
...

As root user, use env to ensure environment variables were preserved.

$ sudo su
$ env
SUDO_USER=owner
SUDO_UID=1000
USERNAME=root
CHE_HOST_IP=192.168.1.111
CHE_VERSION=nightly
...

Start che nightly instance with root user.

root@opteron:/home/owner# che start
WARNING: No swap limit support
INFO: ECLIPSE CHE: Found image codenvy/che-server:nightly
INFO: ECLIPSE CHE: Starting container...
INFO: ECLIPSE CHE: Server logs at "docker logs -f che-server"
INFO: ECLIPSE CHE: Server booting...
INFO: ECLIPSE CHE: Booted and reachable
INFO: ECLIPSE CHE: Ver: 5.0.0-M3-SNAPSHOT
INFO: ECLIPSE CHE: Use: http://192.168.1.111:8080
INFO: ECLIPSE CHE: API: http://192.168.1.111:8080/swagger

Now able to select text in both ws-machine and Terminal panes.

Big thanks to @eivantsov and @TylerJewell for helping to figure this one out.

It seems that as of this writing the :latest seems to be a problematic build for selecting Terminal pane output.

@TylerJewell
Copy link

Ok - great! Then we can feel good that this is fixed in the 5.0 release stream.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
kind/question Questions that haven't been identified as being feature requests or bugs.
Projects
None yet
Development

No branches or pull requests

2 participants