Bug 63617

Summary: CGIDScriptTimeout ignored and request times out after 20 s
Product: Apache httpd-2 Reporter: Paul Menzel <pmenzel+bz.apache.org>
Component: CoreAssignee: Apache HTTPD Bugs Mailing List <bugs>
Status: RESOLVED DUPLICATE    
Severity: normal CC: pmenzel+bz.apache.org, ylavic.dev
Priority: P2    
Version: 2.4.39   
Target Milestone: ---   
Hardware: PC   
OS: Linux   

Description Paul Menzel 2019-07-29 10:54:31 UTC
There seems to be a regression between Apache HTTP Server 2.4.38 and 2.4.39. Unfortunately, I couldn’t spot anything related in the [change-log][1].

We have configured the directive below, and it, a Perl CGI script letting a user upload files, works with Apache HTTP Server 2.4.38 (and before).

        <Directory "/project/XXX/cgi-bin">
                SSLOptions +StdEnvVars
                Options FollowSymLinks
                CGIDScriptTimeout 900
        </Directory>

With Apache HTTP 2.4.39, the POST request is terminated after 20 seconds, and only the message below is logged.

     [cgid:error] [pid 25711:tid 140139315709696] (70007)The timeout specified has expired: [client 141.14.24.229:35350] AH01270: Error reading request entity data, referer: https://xxx.molgen.mpg.de/cgi-bin/XXX

How can I verify, which time-out values are set?

[1]: http://www.apache.org/dist/httpd/CHANGES_2.4.39
Comment 1 Eric Covener 2019-07-29 11:07:46 UTC
(In reply to Paul Menzel from comment #0)
> There seems to be a regression between Apache HTTP Server 2.4.38 and 2.4.39.
> Unfortunately, I couldn’t spot anything related in the [change-log][1].
> 
> We have configured the directive below, and it, a Perl CGI script letting a
> user upload files, works with Apache HTTP Server 2.4.38 (and before).
> 
>         <Directory "/project/XXX/cgi-bin">
>                 SSLOptions +StdEnvVars
>                 Options FollowSymLinks
>                 CGIDScriptTimeout 900
>         </Directory>
> 
> With Apache HTTP 2.4.39, the POST request is terminated after 20 seconds,
> and only the message below is logged.
> 
>      [cgid:error] [pid 25711:tid 140139315709696] (70007)The timeout
> specified has expired: [client 141.14.24.229:35350] AH01270: Error reading
> request entity data, referer: https://xxx.molgen.mpg.de/cgi-bin/XXX
> 
> How can I verify, which time-out values are set?
> 
> [1]: http://www.apache.org/dist/httpd/CHANGES_2.4.39

CGIDScriptTimeout only specifies the interval for how long the server will wait for the CGI to produce output, but your error above is a timeout on reading the HTTP request body from the client.  This would be dicatated by Timeout and mod_reqtimeout.  If you have mod_reqtimeout, it's possible some previous issue blocked it from being effective.
Comment 2 Paul Menzel 2019-07-29 12:53:25 UTC
Thank you, that was it. Disabling mod_reqtimeout fixes the issue.

In the change-log [1] I only the the entry below.

  *) mod_reqtimeout: Allow to configure (TLS-)handshake timeouts.
     PR 61310. [Yann Ylavic]

Yann, any idea, if your change fixed a non-working module reqtimeout in 2.4.38?

NB: This unfortunately, causes an annoying issue, that you cannot share a config between different versions, because Apache HTTPD 2.4.38 aborts with an error, because of the unknown parameter `handshake`.

[1]: https://www.apache.org/dist/httpd/CHANGES_2.4.39
Comment 3 Rainer Jung 2019-07-29 12:56:44 UTC
Yes, very likely a duplicate of

https://bz.apache.org/bugzilla/show_bug.cgi?id=63325

(regression in 2.4.39) with the fix

https://svn.apache.org/viewvc?view=revision&revision=1859376

which will be part of the next version 2.4.40.

You can try that patch if you like. If it doesn't fix your problem feel free to reopen this bug. 2.4.40 is not far away, but it might still be a few weeks before the release.

It is not yet in the published Changelog, because that is for 2.4.39 and this change will be in 2.4.40. The new item will be:

  *) mod_reqtimeout: Fix default rates missing (not applied) in 2.4.39.
     PR 63325. [Yann Ylavic]

*** This bug has been marked as a duplicate of bug 63325 ***