edmondop commented on issue #190:
URL: 
https://github.com/apache/arrow-flight-sql-postgresql/issues/190#issuecomment-2332693689

   I figured it out reading carefully the logs that there was a previous 
problem that was hiding the real problem.
   
   ```
   postgres-1  |
   postgres-1  | 2024-09-01 21:32:09.143 UTC [1] LOG:  starting PostgreSQL 15.7 
(Debian 15.7-1.pgdg120+1) on x86_64-pc-linux-gnu, compiled by gcc (Debian 
12.2.0-14) 12.2.0, 64-bit
   postgres-1  | 2024-09-01 21:32:09.145 UTC [1] LOG:  listening on IPv4 
address "0.0.0.0", port 5432
   postgres-1  | 2024-09-01 21:32:09.145 UTC [1] LOG:  listening on IPv6 
address "::", port 5432
   postgres-1  | 2024-09-01 21:32:09.146 UTC [1] LOG:  listening on Unix socket 
"/var/run/postgresql/.s.PGSQL.5432"
   postgres-1  | 2024-09-01 21:32:09.153 UTC [76] LOG:  database system was 
shut down at 2024-09-01 21:32:08 UTC
   postgres-1  | 2024-09-01 21:32:09.170 UTC [1] LOG:  database system is ready 
to accept connections
   postgres-1  | 2024-09-01 21:32:09.210 UTC [81] LOG:  listening on 
grpc://127.0.0.1:15432 for Apache Arrow Flight SQL
   postgres-1  | 2024-09-01 21:37:09.256 UTC [74] LOG:  checkpoint starting: 
time
   ```
   
   I realized that the arrow-flight was only binding on 127.0.0.1 and my 
docker-compose was not mapping that, I discovered that via grpccurl. It might 
be a good idea to align the arrow-flight-sql binding behavior to the one of the 
"traditional" connector.
   
   However, this didn't solve the problem, I created a small snippet
   
   ```java
   public final class ArrowExample {
       public static void main(String []args) throws Exception{
           DriverManager.registerDriver(new ArrowFlightJdbcDriver());
           Driver driver = 
DriverManager.getDriver("jdbc:arrow-flight://localhost:15432");
           Connection connection = 
driver.connect("jdbc:arrow-flight-sql://localhost:15432/?username=postgres&password=mypassword&useEncryption=0&database=sahah_arrow",
 new Properties());
           Statement statement = connection.createStatement();
           ResultSet rs = statement.executeQuery("select * from public.people");
           System.out.println("Hello world");
       }
   }
   
   ```
   
   this fails like so:
   
   ```java
   java.sql.SQLException: Error while executing SQL "select * from 
public.people": Network closed for unknown reason
   ```
   
   If I enable useEncryption=1, it fails during TSL negotiation. 


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to