Page 2 of 4

Re: Error System uptime

Posted: Thu 31 Aug 2023 12:37 pm
by broadstairs
Well the version I tested complained that it couldn't find it so I installed it and got past that problem.

Stuart

Re: Error System uptime

Posted: Thu 31 Aug 2023 1:36 pm
by HansR
Ah... you said lsb-release and I blindly used that to find but it is lsb_release.
I should pay more attention :bash:

Re: Error System uptime

Posted: Thu 31 Aug 2023 2:00 pm
by broadstairs
Both names work on openSUSE to execute.

Stuart

Re: Error System uptime

Posted: Thu 31 Aug 2023 2:03 pm
by broadstairs
The error I mentioned shows up as

Code: Select all

2023-08-31 12:01:12.273 Testing PHP upload compression on https://www.stella-maris.org.uk/CumulusMX/upload.php
2023-08-31 12:01:12.401 Information PHP upload supports gzip compression
2023-08-31 12:01:12.401 Information Upload File values: localfile: utils/cumuluscharts.txt
2023-08-31 12:01:12.401 Information Upload File values: remotefile: https://www.stella-maris.org.uk/CumulusMX/cumuluscharts.txt
2023-08-31 12:01:12.404 Information Incremental = False; filename = cumuluscharts.txt; ext = .txt; HoursInGraph = 72
2023-08-31 12:01:12.527 Information InetPhp: https://www.stella-maris.org.uk/CumulusMX/cumuluscharts.txt: Response code = 500: InternalServerError
2023-08-31 12:01:12.529 Information InetPhp: https://www.stella-maris.org.uk/CumulusMX/cumuluscharts.txt: Response text follows:
Error: Cannot create the target file https://www.stella-maris.org.uk/CumulusMX/cumuluscharts.txt with this user 
Stuart

Re: Error System uptime

Posted: Thu 31 Aug 2023 2:09 pm
by HansR
Is that the only error you get with upload.php by CUtils?

Re: Error System uptime

Posted: Thu 31 Aug 2023 2:18 pm
by HansR
Is there - for any reason - a file with same name by any other user in that location, thus prohibiting the creation?

Re: Error System uptime

Posted: Thu 31 Aug 2023 2:59 pm
by broadstairs
It's the same directory that my CMX website is in which doesn't use the index.htm file but has a different naming convention but does use some text files from CMX.

Stuart

Re: Error System uptime

Posted: Thu 31 Aug 2023 3:45 pm
by HansR
You use the standard CMX website which uses index.htm. CUtils uses index.html so there should be no conflict (this changes when the new proposal by Neil becomes the standard).

All other files of CUtils do not conflict with CMX hence my question for cumuluscharts.txt: does it exist already for some other user (and other rights)?

Also my question about the occurrence of any other CUtils upload errors for the other txt files. There are many uploads (assuming you run cumulusutils.exe website), if there are no other errors you MUST have some exceptional situation concerning that file.

Seriously, I could do with the complete logfile, it would save us some posts back and forth...

Re: Error System uptime

Posted: Thu 31 Aug 2023 4:31 pm
by broadstairs
There are only files uploaded by CMX in the directory and the cumuluscharts.txt does not already exist. I am puzzled as to why the full url is shown in the log file since PHP is being used by CMX for uploading and upload.php is in the CumulusMX directory so anything can be uploaded to that directory or any other sub-directory in it.

Anyway here is the full log.

Stuart

Re: Error System uptime

Posted: Thu 31 Aug 2023 6:02 pm
by HansR
Thanks. The error occurs for all files generated by CUtils so the most likely issue is a rights issue where CUtils/upload.php do not have the right to write in that directory. I don't know why that is. Is it possible CUtils is run under different rights than CMX?
broadstairs wrote: Thu 31 Aug 2023 4:31 pm There are only files uploaded by CMX in the directory and the cumuluscharts.txt does not already exist.
OK, as said above apparently there are no rights to create the file(s). This must be something in your system, there are others who do the same as you and have no problems.

An alternative may be to create a directory CUtils and use the parameter UploadDir (section FTP site). This will make it possible to experiment more freely without interference with the standard CMX site.
broadstairs wrote: Thu 31 Aug 2023 4:31 pm I am puzzled as to why the full url is shown in the log file since PHP is being used by CMX for uploading and upload.php is in the CumulusMX directory so anything can be uploaded to that directory or any other sub-directory in it.
The full URL is a parameter to the procedure and is offered as such to upload.php.

Re: Error System uptime

Posted: Thu 31 Aug 2023 6:54 pm
by HansR
And the forecast is not correctly generated (the file forecast.txt) does not exist and therefore the generation does not complete.

Not sure what causes this as it is intended that the default (the seven day YourWeather forecast) works fine but you have to configure your account. If you do not want that you may want to use one of the other possibilities (see the wiki).

Re: Error System uptime

Posted: Thu 31 Aug 2023 8:28 pm
by HansR
OK. I solved the forecast issue by resetting the default to SpotWx meaning you don't have to configure anything beforehand and no crash will occur. If you choose to change the forecast it will be an informed decision.

Find attached patch 2

Re: Error System uptime

Posted: Thu 31 Aug 2023 9:06 pm
by broadstairs
OK I'll try that.

As for the PHP upload issue I changed the upload.php (changed $limitPath = true; to $limitPath = false;) to allow updating anywhere not just in the CumulusMX directory and all uploads worked except cumulusutils.js to the lib directory. Now I do not want the upload allowing any uploads to anywhere except the CumulusMX directory so I will change it back.

Stuart

Re: Error System uptime

Posted: Thu 31 Aug 2023 9:11 pm
by broadstairs
Here's the log file from the new run with that second patch. Forecast still fails. NOt yet changed upload.php back to original yet so only cumulusutils.js still fails.

Stuart

Re: Error System uptime

Posted: Fri 01 Sep 2023 4:48 am
by HansR
broadstairs wrote: Thu 31 Aug 2023 9:11 pm Here's the log file from the new run with that second patch. Forecast still fails. NOt yet changed upload.php back to original yet so only cumulusutils.js still fails.
Sorry, my bad: pleae remove the section forecast from the inifile.
broadstairs wrote: Thu 31 Aug 2023 9:06 pm As for the PHP upload issue I changed the upload.php (changed $limitPath = true; to $limitPath = false;) to allow updating anywhere not just in the CumulusMX directory and all uploads worked except cumulusutils.js to the lib directory. Now I do not want the upload allowing any uploads to anywhere except the CumulusMX directory so I will change it back.
1) Not all files are OK! With all files I see the following:

Code: Select all

2023-08-31 22:08:25.106 Information Upload File values: localfile: utils/cumuluscharts.txt
2023-08-31 22:08:25.106 Information Upload File values: remotefile: https://www.stella-maris.org.uk/CumulusMX/cumuluscharts.txt
2023-08-31 22:08:25.109 Information Incremental = False; filename = cumuluscharts.txt; ext = .txt; HoursInGraph = 72
2023-08-31 22:08:25.223 Information InetPhp: https://www.stella-maris.org.uk/CumulusMX/cumuluscharts.txt: Response code = 200: OK
2023-08-31 22:08:25.225 Information InetPhp: https://www.stella-maris.org.uk/CumulusMX/cumuluscharts.txt: Response text follows:
Unzipping data
Opening text file https://www.stella-maris.org.uk/CumulusMX/cumuluscharts.txt for replacement
Cannot create file https://www.stella-maris.org.uk/CumulusMX/cumuluscharts.txt with mode w
2023-08-31 22:08:25.225 Information PHP UploadFile: Success
So even when giving success (for upload probably?) it says it cannot create the file with mode w. You really have to check whether those files indeed have been transferred correctly (are overwritten by the new versions).

Are dates and contents correct? What does this Cannot create file ... with mode w mean?

NOTE: with my Raspbian system files on the server are created with rw-r--r-- rights

2) I assume you have your upload.php file in the CumulusMX directory or in the webroot. $limitPath only takes care files are placed in the directory structure from where upload.php is, so in CumulusMX or webroot and below. That is exactly where all files should go, limitPath=true is correct and all files should transfer correctly to CumulusMX directory and below.

So where is your upload.php located exactly and what restrictions do you have on your PHP installation on your server (because that is where everything for the upload takes place)?

Do the CMX uploads have the same Cannot create file ... with mode w issue?

3) Wait... there have been - downward compatible - changes to upload.php. My version is the CMX b3248 distro is from 23-3-2023 11:10:44. The header of upload.php is:

Code: Select all

<?php
// Last modified: 2023/03/23 11:10:44

/*
******** PHP Upload script for Cumulus MX ********

Use as an alternative to FTP/SFTP upload of data

Mark Crossley - 2023

*/
Does this correspond with your server version?