tds-fdw / tds_fdw

A PostgreSQL foreign data wrapper to connect to TDS databases (Sybase and Microsoft SQL Server)
Other
381 stars 102 forks source link

tds_fdw crashes when querying any foreign object #170

Closed SudoerWithAnOpinion closed 6 years ago

SudoerWithAnOpinion commented 6 years ago

I have built tds_fdw successfully in alpine (for a Docker container) The extension was working perfectly using commit 7d660567 I have since moved my docker-compose to another machine and build the image successfully with no issues. All of a sudden, new builds are now failing and I have checked my version of docker/postgres/tds_fdw/alpine to find a cause.

Bottom line is queries that need to get data from a remote server are now crashing that postgres process and causing the server backend to restart itself.

The old build has been running for weeks and suddenly started experiencing the same issue, despite no changes on it, but I can't seem to determine what is causing the crash as I am given no details in the logs (with msg_handler = notice) and postgresql log level set to log.

I have re-tried building the image in ubuntu 14/16/18 with no success. I have also pulled the latest commit to see if that might be causing it. Any ideas what might be causing it? Every build succeeds, but the server still crashes. I think it might be a setting on the MS SQL server side, but I can't figure it out.

UPDATE: I have looked at the old server where it was failing and changed the IP in the connection to a backup server and it's working again. New builds are still crashing though.

SudoerWithAnOpinion commented 6 years ago

Looks like I worked it out. The new builds were building FreeTDS version 1.00.87-r0 The older one was using 1.00.44-r0 which worked. Pinning the old one (and dev variant) seems to resolve the issue.

For those using this in docker-alpine (postgresql) you need to add

echo 'http://dl-cdn.alpinelinux.org/alpine/v3.7/main' >> /etc/apk/repositories

to your Dockerfile

@GeoffMontee: can you confirm compatibility with newer versions of FreeTDS?

SudoerWithAnOpinion commented 6 years ago

I've confirmed on multiple systems that FreeTDS 87 is incompatible. I'm closing this issue.