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

Error reported on the console after a task is completed and we re-select the terminal #5328

Open
lmcbout opened this issue May 31, 2019 · 5 comments · Fixed by #5359
Open
Labels
bug bugs found in the application terminal issues related to the terminal

Comments

@lmcbout
Copy link
Contributor

lmcbout commented May 31, 2019

Description

After executing a task which open a terminal and the task terminates, selecting another view in the bottom panel and back to the terminal, it generate the following error on the server console.

root ERROR Request getCwdURI failed with error: terminal "13" does not exist Error: terminal "13" does not exist
    at ShellTerminalServer.<anonymous> (/home/lmcbout/theia/theia/packages/terminal/lib/node/base-terminal-server.js:117:27)
    at step (/home/lmcbout/theia/theia/packages/terminal/lib/node/base-terminal-server.js:59:23)
    at Object.next (/home/lmcbout/theia/theia/packages/terminal/lib/node/base-terminal-server.js:40:53)
    at /home/lmcbout/theia/theia/packages/terminal/lib/node/base-terminal-server.js:34:71
    at new Promise (<anonymous>)
    at __awaiter (/home/lmcbout/theia/theia/packages/terminal/lib/node/base-terminal-server.js:30:12)
    at ShellTerminalServer.BaseTerminalServer.getCwdURI (/home/lmcbout/theia/theia/packages/terminal/lib/node/base-terminal-server.js:112:16)
    at JsonRpcProxyFactory.<anonymous> (/home/lmcbout/theia/theia/packages/core/lib/common/messaging/proxy-factory.js:217:73)
    at step (/home/lmcbout/theia/theia/packages/core/lib/common/messaging/proxy-factory.js:47:23)
    at Object.next (/home/lmcbout/theia/theia/packages/core/lib/common/messaging/proxy-factory.js:28:53)

Reproduction Steps

Open the browser with Theia as a workspace
Open the problem or output view in the bottom panel
Select Run Task -> npm: test browser
Wait the task finish (A popup message will tell you when the task is completed

==> Select the output view then re--select the terminal view, the error should show on the server console log

OS and Theia version:
Theia version : 0.7.0
OS: Ubuntu 16.04
Browser: Chrome

Diagnostics:

@akosyakov akosyakov added bug bugs found in the application terminal issues related to the terminal labels Jun 1, 2019
@lmcbout
Copy link
Contributor Author

lmcbout commented Jun 4, 2019

Another way to test, you can use the packages/task/test-resources as a workspace. Modify the task-long-running, replace 300 by 5, so it is enough. Add a return statement at the end, The error will be reported when completed the task.
Another way, use the following in the tasks.json and put focus on another view in the bottom panel and come back, the error is created again.
--> It looks like when the task is completed, it removes the terminal from the potential views even if it is still visible on the screen and when we put the focus back, the error is generated.

In tasks.json, replace by your environment:

    {
      "label": "list all files in Theia packages",
      "type": "shell",
      "cwd": "${workspaceFolder}",
      "command": "ls",
      "args": [
        "-alR",
        "$<theia folder>/packages"
      ]
    }

vince-fugnitto added a commit that referenced this issue Jun 5, 2019
Fixes #5328

Fix error thrown in the backend when after a task is completed.
Instead of calling the method `getCwdURI(terminalId)` first
check if the terminal with the given id truly exists.

Signed-off-by: Vincent Fugnitto <vincent.fugnitto@ericsson.com>
vince-fugnitto added a commit that referenced this issue Jun 5, 2019
Fixes #5328

Fix error thrown in the backend when after a task is completed.
Instead of calling the method `getCwdURI(terminalId)` first
check if the terminal with the given id truly exists.

Signed-off-by: Vincent Fugnitto <vincent.fugnitto@ericsson.com>
@lmcbout
Copy link
Contributor Author

lmcbout commented Jun 13, 2019

After re basing With the latest commit (commit 741876b) this morning, I noticed an issue that was fixed a week ago
"root ERROR Request getCwdURI failed with error: "

@lmcbout lmcbout reopened this Jun 13, 2019
@lmcbout
Copy link
Contributor Author

lmcbout commented Jun 13, 2019

To reproduce

  • Start a task, after completion, start again -> generate a second terminal
  • Kill one of the two created terminal and start the task again
    --> result: "root ERROR Request getCwdURI failed with error: "

@vince-fugnitto
Copy link
Member

@lmcbout are you sure the issue still exists?
I am unable to reproduce the error following your procedure.

@elaihau
Copy link
Contributor

elaihau commented Jul 4, 2019

@lmcbout are you sure the issue still exists?
I am unable to reproduce the error following your procedure.

I still see it happen from my local env.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug bugs found in the application terminal issues related to the terminal
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants