gpfdist distribution on windows on Pivotal Greenplum 4.x, 5.x, and 6.x. It occurs only when your select query that had a LIMIT. The gpfdist log only has a generic 500 error even if you use the -V option.
2019-11-28 04:52:56 416 INFO [0:119:0:316] got a request at port 59632: GET /data/data.csv HTTP/1.1 2019-11-28 04:52:56 416 INFO [0:119:0:316] request headers: 2019-11-28 04:52:56 416 INFO [0:119:0:316] Host:10.1.1.12:8080 2019-11-28 04:52:56 416 INFO [0:119:0:316] Accept:*/* 2019-11-28 04:52:56 416 INFO [0:119:0:316] X-GP-XID:1574502463-0006786288 2019-11-28 04:52:56 416 INFO [0:119:0:316] X-GP-CID:0 2019-11-28 04:52:56 416 INFO [0:119:0:316] X-GP-SN:0 2019-11-28 04:52:56 416 INFO [0:119:0:316] X-GP-SEGMENT-ID:149 2019-11-28 04:52:56 416 INFO [0:119:0:316] X-GP-SEGMENT-COUNT:588 2019-11-28 04:52:56 416 INFO [0:119:0:316] X-GP-LINE-DELIM-LENGTH:-1 2019-11-28 04:52:56 416 INFO [0:119:0:316] X-GP-PROTO:1 2019-11-28 04:52:56 416 INFO [0:119:0:316] X-GP-MASTER_HOST:10.2.4.11 2019-11-28 04:52:56 416 INFO [0:119:0:316] X-GP-MASTER_PORT:5977 2019-11-28 04:52:56 416 INFO [0:119:0:316] X-GP-CSVOPT:m1x34q34h1n0 2019-11-28 04:52:56 416 INFO [0:119:0:316] X-GP_SEG_PG_CONF:/data06/primary/gpseg149/postgresql.conf 2019-11-28 04:52:56 416 INFO [0:119:0:316] X-GP_SEG_DATADIR:/data06/primary/gpseg149 2019-11-28 04:52:56 416 INFO [0:119:0:316] X-GP-DATABASE:gpadmin 2019-11-28 04:52:56 416 INFO [0:119:0:316] X-GP-USER:gpadmin 2019-11-28 04:52:56 416 INFO [0:119:0:316] X-GP-SEG-PORT:40005 2019-11-28 04:52:56 416 INFO [0:119:0:316] X-GP-SESSION-ID:375567 2019-11-28 04:52:56 416 WARN [0:119:149:316] HTTP ERROR: 10.2.2.3 - 500 session error
This issue is caused by an incorrect error handling if there is a new attach request after the gpfdist session is closed. gpfdist should just ignore the request and return an empty HTTP OK instead of reporting HTTP error.
gpfdison on Windows, you should upgrade the gpfdist client.