devpod icon indicating copy to clipboard operation
devpod copied to clipboard

Can’t use Intellij as IDE

Open jguidoux opened this issue 1 year ago • 8 comments

What happened?
I tried to use DevPod for testing with that repository: https://github.com/jguidoux/poc-devcontainers I used Docker as Provider and VSCode Browes or VSCode Desktop as IDE, and it works pretty well. Then I tried to use Intellij Idea as IDE and things went wrong. On my computer (an Ubuntu 23.10), I have Intellij Idea Community, Intellij Idea Ultimate and Jetbrains Gateway. They have been installed using Jetbrains ToolBox. image

But I have a message that inform me that Jetbrains Gateway is not installed image

What did you expect to happen instead?
I expect that DevPod find my installed Jetbrains Gateway and that I can use Intellij Idea as IDE

How can we reproduce the bug? (as minimally and precisely as possible)

My devcontainer.json:

{
	"name": "Java & PostgreSQL",
	"dockerComposeFile": "docker-compose.yml",
	"service": "app",
	"workspaceFolder": "/workspaces/${localWorkspaceFolderBasename}",
	"shutdownAction": "stopCompose",
	"remoteEnv": {
        "GIT_EDITOR": "code --wait"
    },
	"features": {
		"ghcr.io/devcontainers/features/docker-in-docker:2": {}
	}
}

You can use my git repository: https://github.com/jguidoux/poc-devcontainers

Local Environment:

  • DevPod Version: 0.5.6
  • Operating System: Linux, Ubuntu 23.10
  • ARCH of the OS: x86_64

DevPod Provider:

  • Local/remote provider: docker

Anything else we need to know?
I would like to know if I can use my Intellij Idea Ultimate version as IDE

Thanks for your help.

jguidoux avatar May 02 '24 19:05 jguidoux

Hey @jguidoux, does the jetbrains gateway application open if you run xdg-open jetbrains-gateway://connect?

pascalbreuninger avatar May 03 '24 05:05 pascalbreuninger

Yes, it works.

jguidoux avatar May 03 '24 08:05 jguidoux

@pascalbreuninger, do you have any idea why the command xdg-open jetbrains-gateway://connect? is working but Devpod can’t launch jetbrains-gateway ? Logs on debug don’t give much more information.

jguidoux avatar May 07 '24 19:05 jguidoux

Hi @jguidoux can you try using devpod CLI instead of the GUI?

89luca89 avatar May 08 '24 09:05 89luca89

Hi @89luca89, I tried to create one workspace using the CLI. And it works ! :) If I launched again the workspace created from the CLI with the GUI, I have the same issue. Maybe it is a user issue. I noticed that my workspace created from the GUI, the owner was not my user. It was root or another one. (I checked in that location ~/.devpod/agent/contexts/default/workspaces/. I deleted all workspaces. I installed the GUI using the appImage.

So the issue is only for the GUI, maybe installed as an appImage.

jguidoux avatar May 08 '24 10:05 jguidoux

Thanks a lot @jguidoux it indeed seems like an Appimage problem I'll investigate, thanks

89luca89 avatar May 08 '24 11:05 89luca89

I tried to recreate a workspace for this repository :  https://github.com/jguidoux/poc-devcontainer-medium This time, it seems that this workspace is created with the good user:

➜  ~ ll ~/.devpod/agent/contexts/default/workspaces/                       
total 8,0K
drwxr-xr-x 4 j.guidoux utilisa. du domaine 4,0K mai    8 13:52 poc-devcontainer-medium
drwxr-xr-x 4 j.guidoux utilisa. du domaine 4,0K mai    8 12:22 poc-devcontainers

When I launch the workspace using the GUI, I have this result: image

A ssh issue....

jguidoux avatar May 08 '24 12:05 jguidoux

Hi @89luca89 I did some more tests. Using the CLI, My both git repositories works (https://github.com/jguidoux/poc-devcontainers and https://github.com/jguidoux/poc-devcontainer-medium ) Using the GUI, both failed but for differerent reasons:

  • poc-devcontainers failed because he can’t find any installation of jetbrains-gateway (user issue ?)
  • poc-devcontainer-medium failed because of the ssh issue or for the installation issue. It seems to depends...

If i look in the poc-devcontainers contents : 

➜  ~ ll ~/.devpod/agent/contexts/default/workspaces/poc-devcontainers 
total 8,0K
drwxr-xr-x 10 creative  creative            4,0K mai    9 00:29 content
-rw-------  1 j.guidoux utilisa. du domaine 1,6K mai    9 00:42 workspace.json

I can see that the content/ directory is owned by another user. Why ? It is not the case when I launched using the GUI. Creative is a kind of root user. I have not created it. (This is a professional computer). I am on Linux ubuntu 23.10. Maybe this is due how appImage are installed.

And if I look in the other workspace

➜  ~ ll ~/.devpod/agent/contexts/default/workspaces/poc-devcontainer-medium 
total 8,0K
drwxr-xr-x 5 root      root                4,0K mai    9 00:47 content
-rw------- 1 j.guidoux utilisa. du domaine 1,6K mai    9 00:48 workspace.json

Now, the content/ directory is owned by root....

There is a user issue. Maybe linked with how appImage are installed. I don’t know.

jguidoux avatar May 08 '24 22:05 jguidoux

@jguidoux Another user reported something similiar in https://github.com/loft-sh/devpod/issues/1250, could you try the fix there and see if that works for you? Simply wrap the call to DevPod Desktop in a shell, something like

#! /usr/bin/env sh

exec $SHELL -c 'exec /Applications/DevPod.app/Contents/MacOS/DevPod'

I think it can't find jetbrains because it does not have access to the correct PATH

bkneis avatar Oct 17 '24 14:10 bkneis