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 on executing remote operation server, no server available with Java Client on K8S HA installation #1949

Open
cdelbecq opened this issue Feb 7, 2025 · 0 comments

Comments

@cdelbecq
Copy link

cdelbecq commented Feb 7, 2025

Here after the detail of the issue i got => any idea ?

1/ Context of the issue :

     - K8S cluster OK on localhost:2480 , installed on local Docker Desktop
     - version 25.1.1
     - Studio OK with commands working fine on the DB i created with name "pocdb"
     - client side : java 17 console client with RemoreDatabase connection strategie
     - log : default.svc.cluster.local:2424) successfully connected

2 / Server logs :

2025-02-05 16:05:33.698 INFO [HAServer] NEW CLUSTER CONFIGURATION

+----------+--------------------------------------------------+-------+-------+---------+-------+-----------+-------+
|SERVER |HOST:PORT |ROLE |STATUS |JOINED ON|LEFT ON|THROUGHPUT |LATENCY|
+----------+--------------------------------------------------+-------+-------+---------+-------+-----------+-------+
|arcadedb-0|arcadedb-0.arcadedb.default.svc.cluster.local:2424|Leader |ONLINE |16:05:32 | | | |
|arcadedb-1|arcadedb-1.arcadedb.default.svc.cluster.local:2424|Replica|JOINING| | |111b (0b/s)| |
+----------+--------------------------------------------------+-------+-------+---------+-------+-----------+-------+

2025-02-05 16:05:33.728 INFO [Leader2ReplicaNetworkExecutor$4] Replica server 'arcadedb-1' is ONLINE
2025-02-05 16:05:33.730 INFO [HAServer] NEW CLUSTER CONFIGURATION

+----------+--------------------------------------------------+-------+------+---------+-------+-----------------+-------+
|SERVER |HOST:PORT |ROLE |STATUS|JOINED ON|LEFT ON|THROUGHPUT |LATENCY|
+----------+--------------------------------------------------+-------+------+---------+-------+-----------------+-------+
|arcadedb-0|arcadedb-0.arcadedb.default.svc.cluster.local:2424|Leader |ONLINE|16:05:32 | | | |
|arcadedb-1|arcadedb-1.arcadedb.default.svc.cluster.local:2424|Replica|ONLINE|16:05:33 | |111b (108.40KB/s)| |
+----------+--------------------------------------------------+-------+------+---------+-------+-----------------+-------+

2025-02-05 16:05:33.731 INFO [HAServer] Change election status from LEADER_WAITING_FOR_QUORUM to DONE
2025-02-05 16:05:34.755 INFO [Leader2ReplicaNetworkExecutor] Remote Replica server 'arcadedb-2' (arcadedb-2.arcadedb.default.svc.cluster.local:2424) successfully connected

3/ here after the code snipped of my java client**

package com.hypervolume;

import java.util.ArrayList;
import java.util.List;
import com.arcadedb.remote.RemoteDatabase;
import com.arcadedb.remote.RemoteServer;

/**

  • Hello world!

*/
public class App
{
public static void main( String[] args )
{

    System.out.println( "Starting HypervolumeDB POC" );
    
    RemoteServer server = new RemoteServer("localhost", 2480, "root", "selfcockpit");
    
    var leader = server.getLeaderAddress(); // =======> OK
    if (!server.exists("pocdb")) // ======> OK
         server.create("pocdb"); ====> Not
  
    var replicates = server.getReplicaAddresses(); //====> OK
    List<String> databases= new ArrayList<>();
    databases.add("pocdb");
    String[] roles = {"reader", "writer"};
    try {
        server.createUser("selfcockpit", "selfcockpit",databases); // ====> OK the first Time
    } catch (Exception e) {
        e.printStackTrace();
    }
    
    RemoteDatabase db = new RemoteDatabase("localhost", 2480, "pocdb", "selfcockpit", "selfcockpit"); // =====> OK
    var classp = db.getClass(); //=====> OK
    var dbn = db.getName(); // ====> OK
    List<String> dbs = server.databases(); // =====> KO with com.arcadedb.remote.RemoteException: Error on executing remote operation server, no server available
    db.isOpen();
        if (!db.isOpen())
            {
                System.out.println( "!!!!!!!!!!! db pocdb not opened !!!!!!!!!!" );
            }   
        else
        {
                 System.out.println( "db universe opened " ); // =====> OK
        }           
        String schema =
            """
                create vertex type Customer if not exists;
                create property Customer.name if not exists string;
                create property Customer.surname if not exists string;
                create index if not exists on Customer (name, surname) unique;
            """;
        db.command("sqlscript", schema); // =====> KO with no server available exeption
       
        db.close();
        
        }

}

4/ The stack trace logs

Starting HypervolumeDB POC
Exception in thread "main" com.arcadedb.remote.RemoteException: Error on executing remote operation server, no server available
at com.arcadedb.remote.RemoteHttpComponent.httpCommand(RemoteHttpComponent.java:196)
at com.arcadedb.remote.RemoteServer.serverCommand(RemoteServer.java:131)
at com.arcadedb.remote.RemoteServer.databases(RemoteServer.java:48)
at com.hypervolume.App.main(App.java:53)
Caused by: java.net.UnknownHostException: arcadedb-0.arcadedb.default.svc.cluster.local
at java.base/sun.nio.ch.NioSocketImpl.connect(NioSocketImpl.java:572)
at java.base/java.net.Socket.connect(Socket.java:633)
at java.base/sun.net.NetworkClient.doConnect(NetworkClient.java:178)
at java.base/sun.net.www.http.HttpClient.openServer(HttpClient.java:533)
at java.base/sun.net.www.http.HttpClient.openServer(HttpClient.java:638)
at java.base/sun.net.www.http.HttpClient.(HttpClient.java:281)
at java.base/sun.net.www.http.HttpClient.New(HttpClient.java:386)
at java.base/sun.net.www.http.HttpClient.New(HttpClient.java:408)
at java.base/sun.net.www.protocol.http.HttpURLConnection.getNewHttpClient(HttpURLConnection.java:1324)
at java.base/sun.net.www.protocol.http.HttpURLConnection.plainConnect0(HttpURLConnection.java:1257)
at java.base/sun.net.www.protocol.http.HttpURLConnection.plainConnect(HttpURLConnection.java:1143)
at java.base/sun.net.www.protocol.http.HttpURLConnection.connect(HttpURLConnection.java:1072)
at java.base/sun.net.www.protocol.http.HttpURLConnection.getOutputStream0(HttpURLConnection.java:1466)
at java.base/sun.net.www.protocol.http.HttpURLConnection.getOutputStream(HttpURLConnection.java:1437)
at com.arcadedb.remote.RemoteHttpComponent.setRequestPayload(RemoteHttpComponent.java:381)
at com.arcadedb.remote.RemoteHttpComponent.httpCommand(RemoteHttpComponent.java:165)
... 3 more

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

1 participant