Segfault-Inc / Multicorn

Data Access Library
https://multicorn.org/
PostgreSQL License
699 stars 145 forks source link

Create Server Failure: SYSCALL error: EOF detected #211

Closed yellowandy closed 5 years ago

yellowandy commented 5 years ago

Greetings, I'm getting the following failure when attempting to create a server:

SYSCALL error: EOF detected

Everything is pretty vanilla and I went through the installation steps as outlined. Anyway I can try to debug this issue?

linux d 4.15.0-29-generic #31-Ubuntu

thanks!

yellowandy commented 5 years ago

This is interesting as I found that when I disable ssl within postgres everyhting works fine. I re-created keys and set ssl_renegotiation_limit to 0 but an still seeing the issue. Would like to resolve it so I can leave ssl turned on. Anybody have any ideas? I'm not sure how the FDW actually works.

phrrngtn commented 5 years ago

What is the server you are trying to create? For the avoidance of doubt, let's go though the steps and you can identify which one is failing:

  1. Build the multicorn extension and install it
  2. Enable the extension: sql CREATE EXTENSION multicorn;
  3. Create a SERVER e.g. sql CREATE SERVER multicorn_imap FOREIGN DATA WRAPPER multicorn options ( wrapper 'multicorn.imapfdw.ImapFdw' ); 1.Create a foreign table ``sql create foreign table gmail ( ... ) server multicorn_imap options ()```

One easy way to start debugging is to put in lots of calls to python log_to_postgres(). If you are implementing just python execute(), get_rel_size() and get_path_keys() then I have found it fairly straightforward to debug that code standalone with test quals. Most of the juicy errors come up when you have a tool flinging lots of generated SQL at the tables (e.g. Tableau) but, again, you can capture the quals from the live system and then debug the code like you do with ordinary Python.

yellowandy commented 5 years ago

Hi, we figured out the problem and wanted to share. We were using the enterprisedb builds for both 10.4 and 10.5 with ssl mode set to on. For whatever reason they must not have compiled those builds with a certain flag that was causing the malloc issue. Reverting to ubunutu builds did the trick and the edb builds with ssl off worked fine. The failure seemed to only occur with the wrapper "multicorn.sqlalchemyfdw.SqlAlchemyFdw". Hope this helps somebody else.