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

"Required RAG Services" doesn't populate #504

Open
pwilkin opened this issue Feb 8, 2025 · 14 comments
Open

"Required RAG Services" doesn't populate #504

pwilkin opened this issue Feb 8, 2025 · 14 comments

Comments

@pwilkin
Copy link

pwilkin commented Feb 8, 2025

I'm using IntelliJ 2024.3.2.2 on Ubuntu 24 (Java 21) and when I try to enable the RAG feature, the "RAG Required Services" table does not render anything at all (I installed a docker image of ChromaDB already and I even downgraded it to 0.6.2 but still nothing).

@stephanj
Copy link
Collaborator

stephanj commented Feb 8, 2025

DevoxxGenie will try to pull/start ChromaDB, same for pulling Nomic embed model from Ollama.
Can you share some screenshots and/or logs?

@mydeveloperplanet
Copy link
Collaborator

I use ubuntu 22.04, devoxxgenie 0.4.16 (works on my machine :-)), it should show something like below (probably you need to pull the chroma image or models if not yet present)

Image

@pwilkin
Copy link
Author

pwilkin commented Feb 8, 2025

Window is empty.

Image

idea.log shows the following error:

025-02-08 22:56:23,214 [ 125578] SEVERE - #c.i.o.a.i.FlushQueue - Unable to locate JNA native support library java.lang.UnsatisfiedLinkError: Unable to locate JNA native support library at com.sun.jna.Native.loadNativeDispatchLibrary(Native.java:1018) at com.sun.jna.Native.<clinit>(Native.java:221) at com.github.dockerjava.transport.DomainSocket.<clinit>(DomainSocket.java:54) at com.github.dockerjava.transport.UnixSocket.get(UnixSocket.java:29) at com.github.dockerjava.httpclient5.ApacheDockerHttpClientImpl$2.createSocket(ApacheDockerHttpClientImpl.java:154) at org.apache.hc.client5.http.impl.io.DefaultHttpClientConnectionOperator.connect(DefaultHttpClientConnectionOperator.java:125) at org.apache.hc.client5.http.impl.io.PoolingHttpClientConnectionManager.connect(PoolingHttpClientConnectionManager.java:409) at org.apache.hc.client5.http.impl.classic.InternalExecRuntime.connectEndpoint(InternalExecRuntime.java:164) at org.apache.hc.client5.http.impl.classic.InternalExecRuntime.connectEndpoint(InternalExecRuntime.java:174) at org.apache.hc.client5.http.impl.classic.ConnectExec.execute(ConnectExec.java:135) at org.apache.hc.client5.http.impl.classic.ExecChainElement.execute(ExecChainElement.java:51) at org.apache.hc.client5.http.impl.classic.ExecChainElement$1.proceed(ExecChainElement.java:57) at org.apache.hc.client5.http.impl.classic.ProtocolExec.execute(ProtocolExec.java:172) at org.apache.hc.client5.http.impl.classic.ExecChainElement.execute(ExecChainElement.java:51) at org.apache.hc.client5.http.impl.classic.ExecChainElement$1.proceed(ExecChainElement.java:57) at org.apache.hc.client5.http.impl.classic.HttpRequestRetryExec.execute(HttpRequestRetryExec.java:93) at org.apache.hc.client5.http.impl.classic.ExecChainElement.execute(ExecChainElement.java:51) at org.apache.hc.client5.http.impl.classic.ExecChainElement$1.proceed(ExecChainElement.java:57) at org.apache.hc.client5.http.impl.classic.ContentCompressionExec.execute(ContentCompressionExec.java:128) at org.apache.hc.client5.http.impl.classic.ExecChainElement.execute(ExecChainElement.java:51) at org.apache.hc.client5.http.impl.classic.ExecChainElement$1.proceed(ExecChainElement.java:57) at org.apache.hc.client5.http.impl.classic.RedirectExec.execute(RedirectExec.java:116) at org.apache.hc.client5.http.impl.classic.ExecChainElement.execute(ExecChainElement.java:51) at org.apache.hc.client5.http.impl.classic.InternalHttpClient.doExecute(InternalHttpClient.java:178) at org.apache.hc.client5.http.impl.classic.CloseableHttpClient.execute(CloseableHttpClient.java:67) at com.github.dockerjava.httpclient5.ApacheDockerHttpClientImpl.execute(ApacheDockerHttpClientImpl.java:206) at com.github.dockerjava.httpclient5.ApacheDockerHttpClient.execute(ApacheDockerHttpClient.java:9) at com.github.dockerjava.core.DefaultInvocationBuilder.execute(DefaultInvocationBuilder.java:228) at com.github.dockerjava.core.DefaultInvocationBuilder.get(DefaultInvocationBuilder.java:202) at com.github.dockerjava.core.exec.PingCmdExec.execute(PingCmdExec.java:26) at com.github.dockerjava.core.exec.PingCmdExec.execute(PingCmdExec.java:12) at com.github.dockerjava.core.exec.AbstrSyncDockerCmdExec.exec(AbstrSyncDockerCmdExec.java:21) at com.github.dockerjava.core.command.AbstrDockerCmd.exec(AbstrDockerCmd.java:33) at com.devoxx.genie.service.rag.validator.ChromeDBValidator.isDockerRunning(ChromeDBValidator.java:77) at com.devoxx.genie.service.rag.validator.ChromeDBValidator.isValid(ChromeDBValidator.java:26)

@pwilkin
Copy link
Author

pwilkin commented Feb 8, 2025

Oh yeah, the underlying error is this:
java.lang.NoClassDefFoundError: Could not initialize class com.github.dockerjava.transport.DomainSocket

@mydeveloperplanet
Copy link
Collaborator

It looks like your JRE is missing the JNA library. Which JRE are you using to start IntelliJ?

@pwilkin
Copy link
Author

pwilkin commented Feb 9, 2025

Using the bundled JetBrains JRE (21.0.5+8-631.30).

@pwilkin
Copy link
Author

pwilkin commented Feb 9, 2025

Found something like this, seems like the exact same problem: docker-java/docker-java#2171

@stephanj
Copy link
Collaborator

Just to be sure, the Docker service is running right?

@pwilkin
Copy link
Author

pwilkin commented Feb 10, 2025

Yes, and Chroma 0.6.2 is running on it.

@pwilkin
Copy link
Author

pwilkin commented Feb 10, 2025

BTW, don't know if it's relevant, but I'm running IntelliJ as a normal user and the user does not have access to the Docker socket.

@stephanj
Copy link
Collaborator

Maybe you can try this code in a standalone Java app using Gradle dependencies :

    implementation("com.github.docker-java:docker-java:3.4.0")
    implementation("com.github.docker-java:docker-java-transport-httpclient5:3.4.0")

or maven...

and then run the getDockerClient method logic. And see if you can connect, if not then you know the problem.

package com.devoxx.genie.util;

import com.github.dockerjava.api.DockerClient;
import com.github.dockerjava.core.DefaultDockerClientConfig;
import com.github.dockerjava.core.DockerClientBuilder;
import com.github.dockerjava.core.DockerClientConfig;
import com.github.dockerjava.httpclient5.ApacheDockerHttpClient;
import com.github.dockerjava.transport.DockerHttpClient;

import java.time.Duration;

public final class DockerUtil {

	private DockerUtil() {}

	/**
	 * Instantiate a docker client with dockerjava
	 *
	 * @return a docker client
	 */
	public static DockerClient getDockerClient() {
		DockerClientConfig config = DefaultDockerClientConfig.createDefaultConfigBuilder().build();
		DockerHttpClient httpClient = new ApacheDockerHttpClient.Builder()
				.dockerHost(config.getDockerHost())
				.sslConfig(config.getSSLConfig())
				.maxConnections(100)
				.connectionTimeout(Duration.ofSeconds(30))
				.responseTimeout(Duration.ofSeconds(45))
				.build();
		return DockerClientBuilder.getInstance(config)
				.withDockerHttpClient(httpClient)
				.build();
	}
}

@pwilkin
Copy link
Author

pwilkin commented Feb 10, 2025

After I added my user to the docker group, it started working. It seems the JNA thing in the docker library might just be broken and only triggers if for some reason it can't access the Unix socket in the first place.

However, now when I do "start indexing", the count says "indexed segments: 0". Nothing is recorded in the logs. Any idea what the issue could be?

@muzzah
Copy link

muzzah commented Feb 15, 2025

I just came across this plugin and installed it to use with a local project to find a similar problem where the view is not populated compared to your example images. Using Android studio on OSX here.

Just a question, Im wondering why you are forcing the user to have these installed locally? For example, I have a home server for these kind of things so that my laptop can be utilised for other things.

Would it make sense to just allow the user to specify where chromadb is running via port and hostname? That way your plugin becomes simpler (not having to worry about docker or anything else) and removes the need for a user to have docker running.

Maybe Im missing something here thats necessary for this configuration but I just thought Id ask as Im not really going to install docker on my laptop just for this functionality which seems rather important for such a plugin.

@stephanj
Copy link
Collaborator

Adding a hostname+port where ChromaDB is installed could ofc also work, we accept PR's :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants