Mailing List Archive

intermittent 500 error with Link.pm
I'm seeing a fair number of 500s in my apache2 access_log which
correlate to these in my apache2 error_log:

Software caused connection abort at Interchange/Link.pm line 772.\n

Line 772 is 'print @out;' from below:

$r->content_type($set_content);
my $no_blank_lines = $r->dir_config('NoBlankLines');
while (<SOCK>) {
push @out, $_ unless $no_blank_lines and ! /\S/;
}
close (SOCK) or die "close: $!\n";
print @out;

I'm sometimes able to duplicate the problem in a browser by clicking a
new link before the previously clicked link has delivered its HTML.
My perl skills are weak but does Link.pm need to handle some kind of
an exception at line 772?

- Grant

_______________________________________________
interchange-users mailing list
interchange-users@icdevgroup.org
http://www.icdevgroup.org/mailman/listinfo/interchange-users
Re: intermittent 500 error with Link.pm [ In reply to ]
On Fri, 30 Sep 2016, Grant wrote:

> I'm seeing a fair number of 500s in my apache2 access_log which
> correlate to these in my apache2 error_log:
>
> Software caused connection abort at Interchange/Link.pm line 772.\n
>
> Line 772 is 'print @out;' from below:
>
> $r->content_type($set_content);
> my $no_blank_lines = $r->dir_config('NoBlankLines');
> while (<SOCK>) {
> push @out, $_ unless $no_blank_lines and ! /\S/;
> }
> close (SOCK) or die "close: $!\n";
> print @out;
>
> I'm sometimes able to duplicate the problem in a browser by clicking a
> new link before the previously clicked link has delivered its HTML.
> My perl skills are weak but does Link.pm need to handle some kind of
> an exception at line 772?

My guess would be that that is happening when the client's connection is
broken and Apache closes its filehandles that the program is writing to.

It's pretty amazing how many connections fail to complete on any given day
out there in the wild.

Jon


--
Jon Jensen
End Point Corporation
https://www.endpoint.com/

_______________________________________________
interchange-users mailing list
interchange-users@icdevgroup.org
http://www.icdevgroup.org/mailman/listinfo/interchange-users
Re: intermittent 500 error with Link.pm [ In reply to ]
>> I'm seeing a fair number of 500s in my apache2 access_log which
>> correlate to these in my apache2 error_log:
>>
>> Software caused connection abort at Interchange/Link.pm line 772.\n
>>
>> Line 772 is 'print @out;' from below:
>>
>> $r->content_type($set_content);
>> my $no_blank_lines = $r->dir_config('NoBlankLines');
>> while (<SOCK>) {
>> push @out, $_ unless $no_blank_lines and ! /\S/;
>> }
>> close (SOCK) or die "close: $!\n";
>> print @out;
>>
>> I'm sometimes able to duplicate the problem in a browser by clicking a
>> new link before the previously clicked link has delivered its HTML.
>> My perl skills are weak but does Link.pm need to handle some kind of
>> an exception at line 772?
>
>
> My guess would be that that is happening when the client's connection is
> broken and Apache closes its filehandles that the program is writing to.
>
> It's pretty amazing how many connections fail to complete on any given day
> out there in the wild.


I think you're exactly right but can I handle that scenario properly
in Link.pm so that a 500 is not produced?

- Grant

_______________________________________________
interchange-users mailing list
interchange-users@icdevgroup.org
http://www.icdevgroup.org/mailman/listinfo/interchange-users
Re: intermittent 500 error with Link.pm [ In reply to ]
On Sat, 1 Oct 2016, Grant wrote:

>> My guess would be that that is happening when the client's connection
>> is broken and Apache closes its filehandles that the program is writing
>> to.
>
> I think you're exactly right but can I handle that scenario properly in
> Link.pm so that a 500 is not produced?

I'm not sure.

But what do you think it should do if not a 500? It certainly isn't a 2xx
result.

The C-based vlink program that we normally use throws 500s in this
situation too.

Jon


--
Jon Jensen
End Point Corporation
https://www.endpoint.com/

_______________________________________________
interchange-users mailing list
interchange-users@icdevgroup.org
http://www.icdevgroup.org/mailman/listinfo/interchange-users
Re: intermittent 500 error with Link.pm [ In reply to ]
>>> My guess would be that that is happening when the client's connection is
>>> broken and Apache closes its filehandles that the program is writing to.
>>
>>
>> I think you're exactly right but can I handle that scenario properly in
>> Link.pm so that a 500 is not produced?
>
>
> I'm not sure.
>
> But what do you think it should do if not a 500? It certainly isn't a 2xx
> result.
>
> The C-based vlink program that we normally use throws 500s in this situation
> too.


Should it be an internal server error though? It sounds like this
happens due to normal client activity and the server should hopefully
be able to handle that gracefully and return a more accurate HTTP
status code without bothering the error_log.

I tried this in Link.pm but no change in error.log output:

print @out or die "print: $!\n";

- Grant

_______________________________________________
interchange-users mailing list
interchange-users@icdevgroup.org
http://www.icdevgroup.org/mailman/listinfo/interchange-users
Re: intermittent 500 error with Link.pm [ In reply to ]
>>>> My guess would be that that is happening when the client's connection is
>>>> broken and Apache closes its filehandles that the program is writing to.
>>>
>>>
>>> I think you're exactly right but can I handle that scenario properly in
>>> Link.pm so that a 500 is not produced?
>>
>>
>> I'm not sure.
>>
>> But what do you think it should do if not a 500? It certainly isn't a 2xx
>> result.
>>
>> The C-based vlink program that we normally use throws 500s in this situation
>> too.
>
>
> Should it be an internal server error though? It sounds like this
> happens due to normal client activity and the server should hopefully
> be able to handle that gracefully and return a more accurate HTTP
> status code without bothering the error_log.
>
> I tried this in Link.pm but no change in error.log output:
>
> print @out or die "print: $!\n";
>
> - Grant


Can we use eval on the print line to catch this error and dump it and
return a 499?

- Grant

_______________________________________________
interchange-users mailing list
interchange-users@icdevgroup.org
http://www.icdevgroup.org/mailman/listinfo/interchange-users
Re: intermittent 500 error with Link.pm [ In reply to ]
Grant wrote:
>>>> My guess would be that that is happening when the client's connection is
>>>> broken and Apache closes its filehandles that the program is writing to.
>>>
>>> I think you're exactly right but can I handle that scenario properly in
>>> Link.pm so that a 500 is not produced?
>>
>> I'm not sure.
>>
>> But what do you think it should do if not a 500? It certainly isn't a 2xx
>> result.
>>
>> The C-based vlink program that we normally use throws 500s in this situation
>> too.
>
> Should it be an internal server error though? It sounds like this
> happens due to normal client activity and the server should hopefully
> be able to handle that gracefully and return a more accurate HTTP
> status code without bothering the error_log.
>
> I tried this in Link.pm but no change in error.log output:
>
> print @out or die "print: $!\n";
>
> - Grant
>
> _______________________________________________
> interchange-users mailing list
> interchange-users@icdevgroup.org
> http://www.icdevgroup.org/mailman/listinfo/interchange-users
>
Are you using Postgresql?

I built the Strap Store on Ubuntu 15.04 before it was released and I
fixed a problem which sounds like that one by reverting back to Mysql.
The problem was occurring specifically in a Matrix option ie only on
pages with options displayed.



_______________________________________________
interchange-users mailing list
interchange-users@icdevgroup.org
http://www.icdevgroup.org/mailman/listinfo/interchange-users
Re: intermittent 500 error with Link.pm [ In reply to ]
>>>>> My guess would be that that is happening when the client's connection is
>>>>> broken and Apache closes its filehandles that the program is writing to.
>>>>
>>>> I think you're exactly right but can I handle that scenario properly in
>>>> Link.pm so that a 500 is not produced?
>>>
>>> I'm not sure.
>>>
>>> But what do you think it should do if not a 500? It certainly isn't a 2xx
>>> result.
>>>
>>> The C-based vlink program that we normally use throws 500s in this situation
>>> too.
>>
>> Should it be an internal server error though? It sounds like this
>> happens due to normal client activity and the server should hopefully
>> be able to handle that gracefully and return a more accurate HTTP
>> status code without bothering the error_log.
>>
>> I tried this in Link.pm but no change in error.log output:
>>
>> print @out or die "print: $!\n";
>>
> Are you using Postgresql?
>
> I built the Strap Store on Ubuntu 15.04 before it was released and I
> fixed a problem which sounds like that one by reverting back to Mysql.
> The problem was occurring specifically in a Matrix option ie only on
> pages with options displayed.


I'm using mysql with IC (and postgresql with Odoo) and I actually
don't use IC options at all. This seems to be a pretty common issue
with apache2. There's some discussion about it as it relates to a
different software package here:

https://github.com/eprints/eprints/issues/119

Here's how they work around it:

https://github.com/QUTlib/eprints/commit/cc46ff68c19d7251ee525842fbef391e54e269c5

- Grant

_______________________________________________
interchange-users mailing list
interchange-users@icdevgroup.org
http://www.icdevgroup.org/mailman/listinfo/interchange-users
Re: intermittent 500 error with Link.pm [ In reply to ]
Grant wrote:
>>>>>> My guess would be that that is happening when the client's connection is
>>>>>> broken and Apache closes its filehandles that the program is writing to.
>>>>> I think you're exactly right but can I handle that scenario properly in
>>>>> Link.pm so that a 500 is not produced?
>>>> I'm not sure.
>>>>
>>>> But what do you think it should do if not a 500? It certainly isn't a 2xx
>>>> result.
>>>>
>>>> The C-based vlink program that we normally use throws 500s in this situation
>>>> too.
>>> Should it be an internal server error though? It sounds like this
>>> happens due to normal client activity and the server should hopefully
>>> be able to handle that gracefully and return a more accurate HTTP
>>> status code without bothering the error_log.
>>>
>>> I tried this in Link.pm but no change in error.log output:
>>>
>>> print @out or die "print: $!\n";
>>>
>> Are you using Postgresql?
>>
>> I built the Strap Store on Ubuntu 15.04 before it was released and I
>> fixed a problem which sounds like that one by reverting back to Mysql.
>> The problem was occurring specifically in a Matrix option ie only on
>> pages with options displayed.
>
> I'm using mysql with IC (and postgresql with Odoo) and I actually
> don't use IC options at all. This seems to be a pretty common issue
> with apache2. There's some discussion about it as it relates to a
> different software package here:
>
> https://github.com/eprints/eprints/issues/119
>
> Here's how they work around it:
>
> https://github.com/QUTlib/eprints/commit/cc46ff68c19d7251ee525842fbef391e54e269c5
>
> - Grant
>
> _______________________________________________
> interchange-users mailing list
> interchange-users@icdevgroup.org
> http://www.icdevgroup.org/mailman/listinfo/interchange-users
>
Thankyou Grant. I got my server from home working really nicely, but it
was months of work. Maybe I'm not a real computer guy, but generally I
find that nothing works, but I am a stubborn German and always succeed
in the end.


_______________________________________________
interchange-users mailing list
interchange-users@icdevgroup.org
http://www.icdevgroup.org/mailman/listinfo/interchange-users