You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@jena.apache.org by Mikael Pesonen <mi...@lingsoft.fi> on 2020/03/04 13:36:18 UTC

502 Bad Gateway from Fuseki

Hi,

We have reverse proxy on Fuseki.

I'm getting this error occasionally when posting data to fuseki dataset 
endpoint and data is containing some error. Instead of Fuseki response 
400 client gets 502. Our technical support thinks this might be because 
Fuseki sends respond before receiving the entire data and reverse proxy 
doesn't know how to handle that.

Any ideas how to handle this? Is there a setting that makes Fuseki wait 
for entore input before response?

<!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML 2.0//EN">
<html><head>
<title>502 Bad Gateway</title>
</head><body>
<h1>Bad Gateway</h1>
<p>The proxy server received an invalid
response from an upstream server.<br />
</p>
<hr>
<address>Apache/2.4.18 (Ubuntu) Server at xxx.fi Port
443</address>
</body></html>

Thanks!

Re: 502 Bad Gateway from Fuseki

Posted by Mikael Pesonen <mi...@lingsoft.fi>.
We have HTTP connector, default version which is probably 1.1.

On 07/03/2020 14.14, Andy Seaborne wrote:
> Which connector are you using from the Apache httpd reverse proxy to 
> Fuseki?
>
> I'm finding that Jetty itself ensures the connection isn't broken - it 
> must be consuming the data to ensure Content-Length is respected. Yes, 
> the response can go out before that is completed although I can't 
> find, one way or the other, what the correct behaviour is (by spec).
>
> If that is correct, there is no reason why Fuseki can't consume the 
> data itself before sending a response to keep the reverse proxy happy 
> even if strictly it isn't necessary.
>
> Maybe it is related to the connector being used.  Which is it?
>
>     Andy
>
> On 05/03/2020 09:53, Mikael Pesonen wrote:
>> Created
>>
>> https://issues.apache.org/jira/browse/JENA-1854
>>
>> On 05/03/2020 11.28, Andy Seaborne wrote:
>>> Because it's curl, it is sending the length.
>>>
>>> Content-Length is necessary for keeping connections open (even if, 
>>> here, curl isn't doing that).
>>>
>>> Sending data without Content-Length is a one-time us of connection, 
>>> which can be dropped.
>>>
>>> If you are using curl as shown, there are no problems - the 
>>> connection is dropped on exit anyway
>>>
>>> Could you please raise a JIRA ticket?
>>>
>>> This isn't a point fix (though the fix looks straight forward) - 
>>> there needs to be checking in the client libraries as well.
>>>
>>> Send my thanks to your technical support people.
>>>
>>>     Andy
>>>
>>> On 04/03/2020 15:23, Mikael Pesonen wrote:
>>>>
>>>> The error is
>>>>
>>>> [2020-03-04 16:51:56] Fuseki     INFO  [553] POST 
>>>> http://insight-dev.lingsoft.fi/ds?graph=https://resource.lingsoft.fi/graph/lsauth-demo 
>>>>
>>>> [2020-03-04 16:51:56] Fuseki     ERROR [line: 1, col: 34] Undefined 
>>>> prefix: ebucore
>>>> [2020-03-04 16:51:56] Fuseki     INFO  [553] 400 Parse error: 
>>>> [line: 1, col: 34] Undefined prefix: ebucore (4 ms)
>>>>
>>>> So it wouldn't seem odd to me if Fuseki returned the error as soon 
>>>> as it sees it, since rest of the 40k of data won't affect the error.
>>>>
>>>>
>>>> On 04/03/2020 16.43, Andy Seaborne wrote:
>>>>> What makes your tech support think that?
>>>>> What operation is being called?
>>>>>
>>>>>     Andy
>>>>>
>>>>> On 04/03/2020 13:36, Mikael Pesonen wrote:
>>>>>>
>>>>>> Hi,
>>>>>>
>>>>>> We have reverse proxy on Fuseki.
>>>>>>
>>>>>> I'm getting this error occasionally when posting data to fuseki 
>>>>>> dataset endpoint and data is containing some error. Instead of 
>>>>>> Fuseki response 400 client gets 502. Our technical support thinks 
>>>>>> this might be because Fuseki sends respond before receiving the 
>>>>>> entire data and reverse proxy doesn't know how to handle that.
>>>>>>
>>>>>> Any ideas how to handle this? Is there a setting that makes 
>>>>>> Fuseki wait for entore input before response?
>>>>>>
>>>>>> <!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML 2.0//EN">
>>>>>> <html><head>
>>>>>> <title>502 Bad Gateway</title>
>>>>>> </head><body>
>>>>>> <h1>Bad Gateway</h1>
>>>>>> <p>The proxy server received an invalid
>>>>>> response from an upstream server.<br />
>>>>>> </p>
>>>>>> <hr>
>>>>>> <address>Apache/2.4.18 (Ubuntu) Server at xxx.fi Port
>>>>>> 443</address>
>>>>>> </body></html>
>>>>>>
>>>>>> Thanks!
>>>>>>
>>>>
>>

-- 
Lingsoft - 30 years of Leading Language Management

www.lingsoft.fi

Speech Applications - Language Management - Translation - Reader's and Writer's Tools - Text Tools - E-books and M-books

Mikael Pesonen
System Engineer

e-mail: mikael.pesonen@lingsoft.fi
Tel. +358 2 279 3300

Time zone: GMT+2

Helsinki Office
Eteläranta 10
FI-00130 Helsinki
FINLAND

Turku Office
Kauppiaskatu 5 A
FI-20100 Turku
FINLAND


Re: 502 Bad Gateway from Fuseki

Posted by Andy Seaborne <an...@apache.org>.
Which connector are you using from the Apache httpd reverse proxy to Fuseki?

I'm finding that Jetty itself ensures the connection isn't broken - it 
must be consuming the data to ensure Content-Length is respected. Yes, 
the response can go out before that is completed although I can't find, 
one way or the other, what the correct behaviour is (by spec).

If that is correct, there is no reason why Fuseki can't consume the data 
itself before sending a response to keep the reverse proxy happy even if 
strictly it isn't necessary.

Maybe it is related to the connector being used.  Which is it?

     Andy

On 05/03/2020 09:53, Mikael Pesonen wrote:
> Created
> 
> https://issues.apache.org/jira/browse/JENA-1854
> 
> On 05/03/2020 11.28, Andy Seaborne wrote:
>> Because it's curl, it is sending the length.
>>
>> Content-Length is necessary for keeping connections open (even if, 
>> here, curl isn't doing that).
>>
>> Sending data without Content-Length is a one-time us of connection, 
>> which can be dropped.
>>
>> If you are using curl as shown, there are no problems - the connection 
>> is dropped on exit anyway
>>
>> Could you please raise a JIRA ticket?
>>
>> This isn't a point fix (though the fix looks straight forward) - there 
>> needs to be checking in the client libraries as well.
>>
>> Send my thanks to your technical support people.
>>
>>     Andy
>>
>> On 04/03/2020 15:23, Mikael Pesonen wrote:
>>>
>>> The error is
>>>
>>> [2020-03-04 16:51:56] Fuseki     INFO  [553] POST 
>>> http://insight-dev.lingsoft.fi/ds?graph=https://resource.lingsoft.fi/graph/lsauth-demo 
>>>
>>> [2020-03-04 16:51:56] Fuseki     ERROR [line: 1, col: 34] Undefined 
>>> prefix: ebucore
>>> [2020-03-04 16:51:56] Fuseki     INFO  [553] 400 Parse error: [line: 
>>> 1, col: 34] Undefined prefix: ebucore (4 ms)
>>>
>>> So it wouldn't seem odd to me if Fuseki returned the error as soon as 
>>> it sees it, since rest of the 40k of data won't affect the error.
>>>
>>>
>>> On 04/03/2020 16.43, Andy Seaborne wrote:
>>>> What makes your tech support think that?
>>>> What operation is being called?
>>>>
>>>>     Andy
>>>>
>>>> On 04/03/2020 13:36, Mikael Pesonen wrote:
>>>>>
>>>>> Hi,
>>>>>
>>>>> We have reverse proxy on Fuseki.
>>>>>
>>>>> I'm getting this error occasionally when posting data to fuseki 
>>>>> dataset endpoint and data is containing some error. Instead of 
>>>>> Fuseki response 400 client gets 502. Our technical support thinks 
>>>>> this might be because Fuseki sends respond before receiving the 
>>>>> entire data and reverse proxy doesn't know how to handle that.
>>>>>
>>>>> Any ideas how to handle this? Is there a setting that makes Fuseki 
>>>>> wait for entore input before response?
>>>>>
>>>>> <!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML 2.0//EN">
>>>>> <html><head>
>>>>> <title>502 Bad Gateway</title>
>>>>> </head><body>
>>>>> <h1>Bad Gateway</h1>
>>>>> <p>The proxy server received an invalid
>>>>> response from an upstream server.<br />
>>>>> </p>
>>>>> <hr>
>>>>> <address>Apache/2.4.18 (Ubuntu) Server at xxx.fi Port
>>>>> 443</address>
>>>>> </body></html>
>>>>>
>>>>> Thanks!
>>>>>
>>>
> 

Re: 502 Bad Gateway from Fuseki

Posted by Mikael Pesonen <mi...@lingsoft.fi>.
Created

https://issues.apache.org/jira/browse/JENA-1854

On 05/03/2020 11.28, Andy Seaborne wrote:
> Because it's curl, it is sending the length.
>
> Content-Length is necessary for keeping connections open (even if, 
> here, curl isn't doing that).
>
> Sending data without Content-Length is a one-time us of connection, 
> which can be dropped.
>
> If you are using curl as shown, there are no problems - the connection 
> is dropped on exit anyway
>
> Could you please raise a JIRA ticket?
>
> This isn't a point fix (though the fix looks straight forward) - there 
> needs to be checking in the client libraries as well.
>
> Send my thanks to your technical support people.
>
>     Andy
>
> On 04/03/2020 15:23, Mikael Pesonen wrote:
>>
>> The error is
>>
>> [2020-03-04 16:51:56] Fuseki     INFO  [553] POST 
>> http://insight-dev.lingsoft.fi/ds?graph=https://resource.lingsoft.fi/graph/lsauth-demo 
>>
>> [2020-03-04 16:51:56] Fuseki     ERROR [line: 1, col: 34] Undefined 
>> prefix: ebucore
>> [2020-03-04 16:51:56] Fuseki     INFO  [553] 400 Parse error: [line: 
>> 1, col: 34] Undefined prefix: ebucore (4 ms)
>>
>> So it wouldn't seem odd to me if Fuseki returned the error as soon as 
>> it sees it, since rest of the 40k of data won't affect the error.
>>
>>
>> On 04/03/2020 16.43, Andy Seaborne wrote:
>>> What makes your tech support think that?
>>> What operation is being called?
>>>
>>>     Andy
>>>
>>> On 04/03/2020 13:36, Mikael Pesonen wrote:
>>>>
>>>> Hi,
>>>>
>>>> We have reverse proxy on Fuseki.
>>>>
>>>> I'm getting this error occasionally when posting data to fuseki 
>>>> dataset endpoint and data is containing some error. Instead of 
>>>> Fuseki response 400 client gets 502. Our technical support thinks 
>>>> this might be because Fuseki sends respond before receiving the 
>>>> entire data and reverse proxy doesn't know how to handle that.
>>>>
>>>> Any ideas how to handle this? Is there a setting that makes Fuseki 
>>>> wait for entore input before response?
>>>>
>>>> <!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML 2.0//EN">
>>>> <html><head>
>>>> <title>502 Bad Gateway</title>
>>>> </head><body>
>>>> <h1>Bad Gateway</h1>
>>>> <p>The proxy server received an invalid
>>>> response from an upstream server.<br />
>>>> </p>
>>>> <hr>
>>>> <address>Apache/2.4.18 (Ubuntu) Server at xxx.fi Port
>>>> 443</address>
>>>> </body></html>
>>>>
>>>> Thanks!
>>>>
>>

-- 
Lingsoft - 30 years of Leading Language Management

www.lingsoft.fi

Speech Applications - Language Management - Translation - Reader's and Writer's Tools - Text Tools - E-books and M-books

Mikael Pesonen
System Engineer

e-mail: mikael.pesonen@lingsoft.fi
Tel. +358 2 279 3300

Time zone: GMT+2

Helsinki Office
Eteläranta 10
FI-00130 Helsinki
FINLAND

Turku Office
Kauppiaskatu 5 A
FI-20100 Turku
FINLAND


Re: 502 Bad Gateway from Fuseki

Posted by Andy Seaborne <an...@apache.org>.
Because it's curl, it is sending the length.

Content-Length is necessary for keeping connections open (even if, here, 
curl isn't doing that).

Sending data without Content-Length is a one-time us of connection, 
which can be dropped.

If you are using curl as shown, there are no problems - the connection 
is dropped on exit anyway

Could you please raise a JIRA ticket?

This isn't a point fix (though the fix looks straight forward) - there 
needs to be checking in the client libraries as well.

Send my thanks to your technical support people.

     Andy

On 04/03/2020 15:23, Mikael Pesonen wrote:
> 
> The error is
> 
> [2020-03-04 16:51:56] Fuseki     INFO  [553] POST 
> http://insight-dev.lingsoft.fi/ds?graph=https://resource.lingsoft.fi/graph/lsauth-demo 
> 
> [2020-03-04 16:51:56] Fuseki     ERROR [line: 1, col: 34] Undefined 
> prefix: ebucore
> [2020-03-04 16:51:56] Fuseki     INFO  [553] 400 Parse error: [line: 1, 
> col: 34] Undefined prefix: ebucore (4 ms)
> 
> So it wouldn't seem odd to me if Fuseki returned the error as soon as it 
> sees it, since rest of the 40k of data won't affect the error.
> 
> 
> On 04/03/2020 16.43, Andy Seaborne wrote:
>> What makes your tech support think that?
>> What operation is being called?
>>
>>     Andy
>>
>> On 04/03/2020 13:36, Mikael Pesonen wrote:
>>>
>>> Hi,
>>>
>>> We have reverse proxy on Fuseki.
>>>
>>> I'm getting this error occasionally when posting data to fuseki 
>>> dataset endpoint and data is containing some error. Instead of Fuseki 
>>> response 400 client gets 502. Our technical support thinks this might 
>>> be because Fuseki sends respond before receiving the entire data and 
>>> reverse proxy doesn't know how to handle that.
>>>
>>> Any ideas how to handle this? Is there a setting that makes Fuseki 
>>> wait for entore input before response?
>>>
>>> <!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML 2.0//EN">
>>> <html><head>
>>> <title>502 Bad Gateway</title>
>>> </head><body>
>>> <h1>Bad Gateway</h1>
>>> <p>The proxy server received an invalid
>>> response from an upstream server.<br />
>>> </p>
>>> <hr>
>>> <address>Apache/2.4.18 (Ubuntu) Server at xxx.fi Port
>>> 443</address>
>>> </body></html>
>>>
>>> Thanks!
>>>
> 

Re: 502 Bad Gateway from Fuseki

Posted by Mikael Pesonen <mi...@lingsoft.fi>.
The error is

[2020-03-04 16:51:56] Fuseki     INFO  [553] POST 
http://insight-dev.lingsoft.fi/ds?graph=https://resource.lingsoft.fi/graph/lsauth-demo
[2020-03-04 16:51:56] Fuseki     ERROR [line: 1, col: 34] Undefined 
prefix: ebucore
[2020-03-04 16:51:56] Fuseki     INFO  [553] 400 Parse error: [line: 1, 
col: 34] Undefined prefix: ebucore (4 ms)

So it wouldn't seem odd to me if Fuseki returned the error as soon as it 
sees it, since rest of the 40k of data won't affect the error.


On 04/03/2020 16.43, Andy Seaborne wrote:
> What makes your tech support think that?
> What operation is being called?
>
>     Andy
>
> On 04/03/2020 13:36, Mikael Pesonen wrote:
>>
>> Hi,
>>
>> We have reverse proxy on Fuseki.
>>
>> I'm getting this error occasionally when posting data to fuseki 
>> dataset endpoint and data is containing some error. Instead of Fuseki 
>> response 400 client gets 502. Our technical support thinks this might 
>> be because Fuseki sends respond before receiving the entire data and 
>> reverse proxy doesn't know how to handle that.
>>
>> Any ideas how to handle this? Is there a setting that makes Fuseki 
>> wait for entore input before response?
>>
>> <!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML 2.0//EN">
>> <html><head>
>> <title>502 Bad Gateway</title>
>> </head><body>
>> <h1>Bad Gateway</h1>
>> <p>The proxy server received an invalid
>> response from an upstream server.<br />
>> </p>
>> <hr>
>> <address>Apache/2.4.18 (Ubuntu) Server at xxx.fi Port
>> 443</address>
>> </body></html>
>>
>> Thanks!
>>

-- 
Lingsoft - 30 years of Leading Language Management

www.lingsoft.fi

Speech Applications - Language Management - Translation - Reader's and Writer's Tools - Text Tools - E-books and M-books

Mikael Pesonen
System Engineer

e-mail: mikael.pesonen@lingsoft.fi
Tel. +358 2 279 3300

Time zone: GMT+2

Helsinki Office
Eteläranta 10
FI-00130 Helsinki
FINLAND

Turku Office
Kauppiaskatu 5 A
FI-20100 Turku
FINLAND


Re: 502 Bad Gateway from Fuseki

Posted by Mikael Pesonen <mi...@lingsoft.fi>.
The exact command is

curl -X   POST -H "Content-type: text/turtle" --data-binary 
@/tmp/subtitle.ttl 
https://xxx.fi/fuseki/ds?graph=https://example.com/graph/demo

and according to ngrep result was returned before the entire sending.

This https://xxx.fi/fuseki/ds is proxy address pointing to 
http://127.0.0.1:3030/ds <http://127.0.0.1:3030/>

Subtitle.ttl is 41kb in size.





On 04/03/2020 16.43, Andy Seaborne wrote:
> What makes your tech support think that?
> What operation is being called?
>
>     Andy
>
> On 04/03/2020 13:36, Mikael Pesonen wrote:
>>
>> Hi,
>>
>> We have reverse proxy on Fuseki.
>>
>> I'm getting this error occasionally when posting data to fuseki 
>> dataset endpoint and data is containing some error. Instead of Fuseki 
>> response 400 client gets 502. Our technical support thinks this might 
>> be because Fuseki sends respond before receiving the entire data and 
>> reverse proxy doesn't know how to handle that.
>>
>> Any ideas how to handle this? Is there a setting that makes Fuseki 
>> wait for entore input before response?
>>
>> <!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML 2.0//EN">
>> <html><head>
>> <title>502 Bad Gateway</title>
>> </head><body>
>> <h1>Bad Gateway</h1>
>> <p>The proxy server received an invalid
>> response from an upstream server.<br />
>> </p>
>> <hr>
>> <address>Apache/2.4.18 (Ubuntu) Server at xxx.fi Port
>> 443</address>
>> </body></html>
>>
>> Thanks!
>>

-- 
Lingsoft - 30 years of Leading Language Management

www.lingsoft.fi

Speech Applications - Language Management - Translation - Reader's and Writer's Tools - Text Tools - E-books and M-books

Mikael Pesonen
System Engineer

e-mail: mikael.pesonen@lingsoft.fi
Tel. +358 2 279 3300

Time zone: GMT+2

Helsinki Office
Eteläranta 10
FI-00130 Helsinki
FINLAND

Turku Office
Kauppiaskatu 5 A
FI-20100 Turku
FINLAND


Re: 502 Bad Gateway from Fuseki

Posted by Andy Seaborne <an...@apache.org>.
What makes your tech support think that?
What operation is being called?

     Andy

On 04/03/2020 13:36, Mikael Pesonen wrote:
> 
> Hi,
> 
> We have reverse proxy on Fuseki.
> 
> I'm getting this error occasionally when posting data to fuseki dataset 
> endpoint and data is containing some error. Instead of Fuseki response 
> 400 client gets 502. Our technical support thinks this might be because 
> Fuseki sends respond before receiving the entire data and reverse proxy 
> doesn't know how to handle that.
> 
> Any ideas how to handle this? Is there a setting that makes Fuseki wait 
> for entore input before response?
> 
> <!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML 2.0//EN">
> <html><head>
> <title>502 Bad Gateway</title>
> </head><body>
> <h1>Bad Gateway</h1>
> <p>The proxy server received an invalid
> response from an upstream server.<br />
> </p>
> <hr>
> <address>Apache/2.4.18 (Ubuntu) Server at xxx.fi Port
> 443</address>
> </body></html>
> 
> Thanks!
>