Welcome to the Cumulus Support forum.

Latest Cumulus MX V4 release 4.0.1 (build 4023) - 16 May 2024

(Note that 4.1.0 (build 4024) - 05 June 2024 remains available, but usage of this version is not recommended - particularly for Davis stations - and the included utility in this distribution for migrating to v4 is known to contain errors affecting conversion of dayfile.txt)

Latest Cumulus MX V3 release 3.28.6 (build 3283) - 21 March 2024

Legacy Cumulus 1 release 1.9.4 (build 1099) - 28 November 2014
(a patch is available for 1.9.4 build 1099 that extends the date range of drop-down menus to 2030)

Download the Software (Cumulus MX / Cumulus 1 and other related items) from the Wiki

PHP upload POST stopped working

From build 3044 the development baton passed to Mark Crossley. Mark has been responsible for all the Builds since. He has made the code available on GitHub. It is Mark's hope that others will join in this development, but at the very least he welcomes your ideas for future developments (see Cumulus MX Development suggestions).

Moderator: mcrossley

Post Reply
davidrowe
Posts: 5
Joined: Tue 07 Apr 2015 12:56 pm
Weather Station: Davis Vantage Vue
Operating System: Raspberry Pi
Location: United Kingdom

PHP upload POST stopped working

Post by davidrowe »

Hello,

I'm having an issue with PHP uploads that started yesterday (I've been using them just fine for the past month or two). Uploads using GET work fine (e.g., realtimegauges.txt, realtime.txt) but larger files sent with POST are failing with a 403 forbidden error.

Cumulus (running on a raspberry PI is version Cumulus MX 3.28.3 b3280) and the server it's uploading to us running PHP 7.4.33.

Does anyone have any ideas how to debug this further. Thanks in advance? Below is a MXdiags log of a POST and a GET.

Code: Select all

2024-03-15 09:41:34.254 Upload Now: Starting process
2024-03-15 09:41:34.256 Upload Now: Flagging the graph data files for recreation and upload/copy
2024-03-15 09:41:34.257 Upload Now: Flagging graph data files for full upload rather than incremental
2024-03-15 09:41:34.258 Upload Now: Flagging the daily graph data files for recreation and upload/copy
2024-03-15 09:41:34.258 Upload Now: Starting the main update process in the background
2024-03-15 09:41:34.260 Upload Now: Process complete
2024-03-15 09:41:34.260 Interval: Creating standard web files
2024-03-15 09:41:34.262 Interval: Done creating standard Data file
2024-03-15 09:41:34.262 Interval: Creating graph data files
2024-03-15 09:41:34.262 Interval: Done creating graph data files
2024-03-15 09:41:34.263 Interval: Creating extra files
2024-03-15 09:41:34.263 Interval: Done creating extra files
2024-03-15 09:41:34.263 PHP[Int]: Upload process starting
2024-03-15 09:41:34.264 PHP[Int]: Extra Files upload starting
2024-03-15 09:41:34.265 PHP[Int]: Uploading Extra file: /home/pi/CumulusMX/web/CUtags.txt to: CUtags.php (Processed)
2024-03-15 09:41:35.205 PHP[Int]: Uploading to CUtags.php
2024-03-15 09:41:35.252 PHP[Int]: Sending via POST
2024-03-15 09:41:35.335 PHP[Int]: Upload to CUtags.php: Response text follows:
<!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML 2.0//EN">
<html><head>
<title>403 Forbidden</title>
</head><body>
<h1>Forbidden</h1>
<p>You don't have permission to access this resource.</p>
<p>Additionally, a 403 Forbidden
error was encountered while trying to use an ErrorDocument to handle the request.</p>
</body></html>

2024-03-15 09:41:35.347 PHP[Int]: Sending via POST
2024-03-15 09:41:35.402 PHP[Int]: Upload to CUtags.php: Response text follows:
<!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML 2.0//EN">
<html><head>
<title>403 Forbidden</title>
</head><body>
<h1>Forbidden</h1>
<p>You don't have permission to access this resource.</p>
<p>Additionally, a 403 Forbidden
error was encountered while trying to use an ErrorDocument to handle the request.</p>
</body></html>

2024-03-15 09:41:35.403 PHP[Int]: HTTP Error uploading to CUtags.php: Response code = 403: Forbidden
2024-03-15 09:41:35.404 PHP[Int]: Standard files upload starting
2024-03-15 09:41:35.404 PHP[Int]: Uploading Extra file: /home/pi/CumulusMX/web/realtimegaugesT.txt to: realtimegauges.txt (Processed)
2024-03-15 09:41:35.416 PHP[Int]: Uploading to realtimegauges.txt
2024-03-15 09:41:35.418 PHP[Int]: Sending via GET
2024-03-15 09:41:35.472 PHP[Int]: Upload to realtimegauges.txt: Response code = 200: OK
2024-03-15 09:41:35.473 PHP[Int]: Graph files upload starting
2024-03-15 09:41:35.473 PHP[Int]: Uploading standard Data file: websitedata.json
2024-03-15 09:41:35.614 PHP[Int]: Uploading to websitedata.json
2024-03-15 09:41:35.628 PHP[Int]: Sending via POST
....
This upload failed....
User avatar
mcrossley
Posts: 12966
Joined: Thu 07 Jan 2010 9:44 pm
Weather Station: Davis VP2/WLL
Operating System: Bullseye Lite rPi
Location: Wilmslow, Cheshire, UK
Contact:

Re: PHP upload POST stopped working

Post by mcrossley »

The userid that PHP is running under no longer has permission to write to the file system where you are storing the data.

PHP often runs under "www-data" on Linux systems.
davidrowe
Posts: 5
Joined: Tue 07 Apr 2015 12:56 pm
Weather Station: Davis Vantage Vue
Operating System: Raspberry Pi
Location: United Kingdom

Re: PHP upload POST stopped working

Post by davidrowe »

Thanks for the quick response. I did some further investigation, tried setting the folder permissions to 777 (just to test) but the only files that would get created/updated were ones updated with a GET method. When using HTTP POST I was getting a 403 forbidden error.

I got in contact with my hosting company (I'm using a web hosting service) and it was at their end - their mod_security (or may have been modsecurity) module in their webserver was issuing a false positive - they've now whitelisted the URL/originating server and we're all good now.
Post Reply