From owner-freebsd-questions@freebsd.org Wed Jun 9 20:35:21 2021 Return-Path: Delivered-To: freebsd-questions@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 23C41652FBF for ; Wed, 9 Jun 2021 20:35:21 +0000 (UTC) (envelope-from galtsev@kicp.uchicago.edu) Received: from kicp.uchicago.edu (kicp.uchicago.edu [128.135.20.70]) by mx1.freebsd.org (Postfix) with ESMTP id 4G0f4S2LlWz3jcn for ; Wed, 9 Jun 2021 20:35:20 +0000 (UTC) (envelope-from galtsev@kicp.uchicago.edu) Received: from point.uchicago.edu (point.uchicago.edu [128.135.52.6]) (Authenticated sender: galtsev) by kicp.uchicago.edu (Postfix) with ESMTPSA id 683714E65E for ; Wed, 9 Jun 2021 15:35:19 -0500 (CDT) Subject: Re: Weird problem with Apache and php To: freebsd-questions@freebsd.org References: From: Valeri Galtsev Message-ID: Date: Wed, 9 Jun 2021 15:35:19 -0500 User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:78.0) Gecko/20100101 Thunderbird/78.10.2 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 4G0f4S2LlWz3jcn X-Spamd-Bar: + Authentication-Results: mx1.freebsd.org; dkim=none; dmarc=fail reason="No valid SPF, No valid DKIM" header.from=uchicago.edu (policy=none); spf=none (mx1.freebsd.org: domain of galtsev@kicp.uchicago.edu has no SPF policy when checking 128.135.20.70) smtp.mailfrom=galtsev@kicp.uchicago.edu X-Spamd-Result: default: False [1.10 / 15.00]; RCVD_VIA_SMTP_AUTH(0.00)[]; ARC_NA(0.00)[]; MID_RHS_MATCH_FROM(0.00)[]; FROM_HAS_DN(0.00)[]; RBL_DBL_DONT_QUERY_IPS(0.00)[128.135.20.70:from]; TO_MATCH_ENVRCPT_ALL(0.00)[]; NEURAL_HAM_LONG(-1.00)[-1.000]; MIME_GOOD(-0.10)[text/plain]; TO_DN_NONE(0.00)[]; PREVIOUSLY_DELIVERED(0.00)[freebsd-questions@freebsd.org]; NEURAL_SPAM_MEDIUM(1.00)[1.000]; RCPT_COUNT_ONE(0.00)[1]; SPAMHAUS_ZRD(0.00)[128.135.20.70:from:127.0.2.255]; NEURAL_SPAM_SHORT(1.00)[1.000]; R_SPF_NA(0.00)[no SPF record]; RCVD_NO_TLS_LAST(0.10)[]; FROM_EQ_ENVFROM(0.00)[]; R_DKIM_NA(0.00)[]; MIME_TRACE(0.00)[0:+]; ASN(0.00)[asn:160, ipnet:128.135.0.0/16, country:US]; RCVD_COUNT_TWO(0.00)[2]; MAILMAN_DEST(0.00)[freebsd-questions]; DMARC_POLICY_SOFTFAIL(0.10)[uchicago.edu : No valid SPF, No valid DKIM,none] X-BeenThere: freebsd-questions@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: User questions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 09 Jun 2021 20:35:21 -0000 On 6/9/21 2:48 PM, Niels Kobschätzki wrote: > Hi, > > I have a weird problem on an old machine (FBSD 11.2, Apache 2.4, php 7.1 - please don’t ask): I am trying to upload files via a simple php-script. I am using mod_proxy_fcgi for connecting Apache to php-fpm. When I try to upload a file of a size between 63 and 64 KByte it works fine. As soon as the file is 1 Byte bigger the following happens: > The upload starts and I see the temporary file popping up in /tmp and it is at max ca 40KByte in size. Interestingly it was today a different size in Bytes then with my tests yesterday but it is over the day always the exact same size. Then php hangs and suddenly php-fpm disconnects and errors out and the browser shows that something went wrong - maybe the server is busy, but no error code. That suddenly is always around 18 seconds and it is also always the same time. > > I attached truss to the php-fpm-process that handles the upload and you see it start, then nothing happens and php-fpm releases the connection. I did a tcpdump on the loopback-interface on port 9000 and you see that the upload starts and suddenly there is an error uploading the file-message in the dump. > > I checked the post_max_size and the upload_max_size, they are at over 100MB. I would also check memory_limit and make it larger than the above. Just a shot in the dark. Valeri > My request timeout is at 60 seconds. I tried a higher timeout for the proxy from mod_proxy and it didn’t help. The login-class looks good. In /tmp are files bigger than that size and there is no quota. I tried to play around with mod_reqtimeout and it didn’t help. I found something that this might happen when Apache is compiled with AP2FILTER and it isn’t. I checked the involved .htaccess and there are php value-directives. > > The crazy thing is: I have an Ubuntu 18.04 with pho 7.1, the same php-settings and Apache-configuration (or as close as I could get them) and there it works perfectly fine. > > Does anybody have any idea what could be the problem or another idea where I could look? I checked now everything I could imagine and I just can’t explain why the php suddenly hangs, then dies and unlinks the temporary file. There are no errors in the php_error.log. There is nothing in the php-fpm.log. > I see only this in the Apache-log: > > [Tue Jun 08 14:23:56.744245 2021] [proxy_fcgi:error] [pid 2700:tid 34504518400] (70007)The timeout specified has expired: [client XXX.XXX.XXX.XXX:51340] AH01075: Error dispatching request to : (reading input brigade), referer: https://website.TLD/path/to/script.php > > Any idea would be helpful. Maybe a sysctl that could matter? Some config in /etc I am overlooking? I just can’t explain it. > > Desperate greetings, > > Niels > -- ++++++++++++++++++++++++++++++++++++++++ Valeri Galtsev Sr System Administrator Department of Astronomy and Astrophysics Kavli Institute for Cosmological Physics University of Chicago Phone: 773-702-4247 ++++++++++++++++++++++++++++++++++++++++