Page 4 of 4

Re: Error System uptime

Posted: Fri 01 Sep 2023 2:54 pm
by HansR
broadstairs wrote: Fri 01 Sep 2023 2:29 pm I've done some more testing and the only errors I get now are that it cannot find forecast but I'll take a look at the wiki and see if I can sort that as I use WXSim for mine.
Indeed read the Wiki: there is a WxSim forecast possible, just set it to WxSim and put your WxSimURL in the specific parameter.
broadstairs wrote: Fri 01 Sep 2023 2:29 pm The other issue is that it does not like uploading to the lib su-directory.
The lib sub-directory of the CumulusMX should not be a su directory. There is nothing superuser there or at least it does not have to be. But anyway: like or dislike, in the lib and css directories below CumulusMX is where the js files and css files go. If you had made a separate CUtils directory they would have been subs under that directory. It's all about choices and placement of upload.php.

If it does not like uploading to the lib directory then the problem is definitely in ownership or rights.

Re: Error System uptime

Posted: Fri 01 Sep 2023 3:27 pm
by broadstairs
Sorry that is a typo I meant sub-directory. :groan:

Stuart

Re: Error System uptime

Posted: Fri 01 Sep 2023 3:59 pm
by HansR
broadstairs wrote: Fri 01 Sep 2023 3:27 pm Sorry that is a typo I meant sub-directory. :groan:
OK :)

Re: Error System uptime

Posted: Fri 01 Sep 2023 4:53 pm
by broadstairs
OK so after some extensive playing around and installing the WXSim forecast I now have it all running with no errors doing a full run with the Website option.

The issue would appear to be that the PHP upload fails if the file does not already exist on the server because I have been through the log on each run and checked for the upload failure to see which file it was and in each case the file did NOT exist already on the server but after a manual upload each error disappeared until now I have no errors on a full Website run and the index.html now loads up and displays everything fine. Run attached from the final error free run.

You can see the result now at https://www.stella-maris.org.uk/CumulusMX/index.html also CMX is running again as a service.

I'd suggest talking with Mark to see what his view is and whether or not my supposition about replace is correct?

Stuart

Re: Error System uptime

Posted: Fri 01 Sep 2023 5:34 pm
by HansR
broadstairs wrote: Fri 01 Sep 2023 4:53 pm OK so after some extensive playing around and installing the WXSim forecast I now have it all running with no errors doing a full run with the Website option.
OK, that's good
broadstairs wrote: Fri 01 Sep 2023 4:53 pm The issue would appear to be that the PHP upload fails if the file does not already exist on the server because I have been through the log on each run and checked for the upload failure to see which file it was and in each case the file did NOT exist already on the server but after a manual upload each error disappeared until now I have no errors on a full Website run and the index.html now loads up and displays everything fine. Run attached from the final error free run.

OK, one of the things developing this, is that I rarely (never) test from scratch. This is a scratch situation , thanks for that :D

Two points:
  1. On my own system I removed the contents of the lib-directory, ran CUtils for website and concluded that it did upload the files where they did not exist. This contradicts your claim.
  2. Your log still contains:

    Code: Select all

    Cannot create file https://www.stella-maris.org.uk/CumulusMX/lib/suncalc.js with mode w
    It should not.
    How did you check the replacement actually did take place? Filedates?
broadstairs wrote: Fri 01 Sep 2023 4:53 pm You can see the result now at https://www.stella-maris.org.uk/CumulusMX/index.html also CMX is running again as a service.
Looks good.
broadstairs wrote: Fri 01 Sep 2023 4:53 pm I'd suggest talking with Mark to see what his view is and whether or not my supposition about replace is correct?
Maybe but we're not done yet ;)

For e.g. CUlanguage.js my logfile says:

Code: Select all

2023-09-01 19:01:30.365 Information Upload File values: localfile: utils/CUlanguage.js
2023-09-01 19:01:30.365 Information Upload File values: remotefile: lib/CUlanguage.js
2023-09-01 19:01:30.434 Information Incremental = False; filename = CUlanguage.js; ext = .js; HoursInGraph = 72
2023-09-01 19:01:30.501 Information InetPhp: lib/CUlanguage.js: Response code = 200: OK
2023-09-01 19:01:30.502 Information InetPhp: lib/CUlanguage.js: Response text follows:
Unzipping data
Opening text file lib/CUlanguage.js for replacement
Writing text file lib/CUlanguage.js
Write complete
2023-09-01 19:01:30.502 Information PHP UploadFile: Success
2023-09-01 19:01:30.502 Information CheckPackageAndCopy: Uploaded utils/CUlanguage.js to lib/CUlanguage.js
While your logfile says:

Code: Select all

2023-09-01 17:41:58.791 Information Upload File values: localfile: utils/CUlanguage.js
2023-09-01 17:41:58.791 Information Upload File values: remotefile: https://www.stella-maris.org.uk/CumulusMX/lib/CUlanguage.js
2023-09-01 17:41:58.791 Information Incremental = False; filename = CUlanguage.js; ext = .js; HoursInGraph = 72
2023-09-01 17:41:58.887 Information InetPhp: https://www.stella-maris.org.uk/CumulusMX/lib/CUlanguage.js: Response code = 200: OK
2023-09-01 17:41:58.887 Information InetPhp: https://www.stella-maris.org.uk/CumulusMX/lib/CUlanguage.js: Response text follows:
ACTION: replace
FILE: https://www.stella-maris.org.uk/CumulusMX/lib/CUlanguage.js
TS: 1693586518
SIGNATURE: dddddd
BINARY: 0
UTF8: 1
Content-Encoding: gzip
Content-Length: 29831
Host: www.stella-maris.org.uk
X-HTTPS: 1
CWD = /home/stelguk1/public_html/CumulusMX
Unzipping data
Opening text file https://www.stella-maris.org.uk/CumulusMX/lib/CUlanguage.js for replacement
Cannot create file https://www.stella-maris.org.uk/CumulusMX/lib/CUlanguage.js with mode w
2023-09-01 17:41:58.887 Information PHP UploadFile: Success
2023-09-01 17:41:58.887 Information CheckPackageAndCopy: Uploaded utils/CUlanguage.js to lib/CUlanguage.js
These ouputs are different. Does this mean you have set $debug = true; ?
If so take care as the SIGNATURE is published as well, change it or remove your logs (I have seen them) and set DEBUG back to false in upload.php

As you see, in my output the remote file does not have the URL.
Could I see your cumulusutils.ini file please?

Re: Error System uptime

Posted: Fri 01 Sep 2023 9:17 pm
by broadstairs
Yes I did have debug on, I had two copies of the upload.php and managed to upload the test one. Fixed now. I've removed attachments.

As for the URL I am wondering if it because I have both ftp details in CMX as well as PHP, I did not remove the ftp details from cumulus.ini when I turned on PHP as there was no need and saves me re-entering the details if I need to switch back I just switched in the dashboard settings, cumulusutils.ini shows

Code: Select all

[FTP site]
FtpLog=On
DoUploadFTP=true
UploadDir=https://www.stella-maris.org.uk/CumulusMX
what should it say in that section?

There seems to be nothing relating to PHP uploads in the utils ini file.

I did not actually check to see if the file was replaced, just assumed as no error that it was.

Its late here now and I'm out tomorrow so anything further will have to wait until Sunday.

Stuart

Re: Error System uptime

Posted: Sat 02 Sep 2023 1:37 am
by HansR
Aha... Mark was right in his suspicion and I was wrong stating it worked everywhere. I wrongly assumed you had UploadDir empty.

The reason is you filled in UploadDir :!:

If you want the files to be transferred to the same place as CMX does you do NOT fill in anything here. CUtils takes the transfer parameters straight from the CMX inifile (always!). It is only when you want CUtils output to be transferred into some other directory you fill this in. Although maybe not entirely clear the Wiki says (in the FTP facility section):
If the destination in CumulusUtils is NOT specified (UploadDir is empty) then the destination specified in Cumulus.ini is used (Directory).
And then it points to the the PHP Uploads section which says:
If the ''upload.php'' file is installed for CMX and the protocol works for CMX then it will also work for CUtils and the file locations will be relative to the location of the ''upload.php'' file (which therefore will be the root location of your website).
In short (and I will make that more explicit in the PHP Upload section): UploadDir specifies a subdirectory for CUtils relative to the webroot (the location of upload.php) without any specification of the URL (as that is implicit in the use of upload.PHP.

Yes @Mark, you were right! Apologies for missing the point.
So, in short @broadstairs : empty the UploadDir parameter.

NOTE: if you ever want CUtils to be in a different directory on the same level as CumulusMX, then move upload.php one level up i.s.o. changing $limitPath. If you want it in a subdirectory to CumulusMX, then you set the value to UploadDir for CUtils. All specs are always relative to the location of upload.php.

Re: Error System uptime

Posted: Sun 03 Sep 2023 12:37 pm
by HansR
OK, I see you generated new this morning and did not post so I assume everything is OK now.

While we are at it, you are no longer on the map? When running website it is not possible to avoid that from withing CUtils.
Did you block the outgoing message in the firewall? And why?

Re: Error System uptime

Posted: Sun 03 Sep 2023 1:05 pm
by broadstairs
Yes I've been testing quite a lot. Firstly I at a loss to know why uploaddir is completed like that as that is not correct syntax and I would not have manually added it like that so I have no idea how that got there as I would have added as a valid directory not a URL. Anyway now with it empty it works and how that happened I have no ideas at all.

I've not looked into the Map option yet so nothing is setup and I'll change it to false. Nothing is blocked in the firewall. I don't want to publish my CMX websites at all as they are in testing and will probably change considerably as I need to find a way to get the data I need to replicate what I have on my Weather Display main site. Not everything on them works yet and some that does will not return to the CMX site but the WD one. My live WD site has been running since 2005 and I really need to be able to replicate as much as I can with CMX before it can go live.

Stuart

Re: Error System uptime

Posted: Sun 03 Sep 2023 1:46 pm
by HansR
broadstairs wrote: Sun 03 Sep 2023 1:05 pm Yes I've been testing quite a lot. Firstly I at a loss to know why uploaddir is completed like that as that is not correct syntax and I would not have manually added it like that so I have no idea how that got there as I would have added as a valid directory not a URL. Anyway now with it empty it works and how that happened I have no ideas at all.
Well, Cutils does not add anything to this parameter so :groan:
broadstairs wrote: Sun 03 Sep 2023 1:05 pm I've not looked into the Map option yet so nothing is setup and I'll change it to false. Nothing is blocked in the firewall. I don't want to publish my CMX websites at all as they are in testing and will probably change considerably as I need to find a way to get the data I need to replicate what I have on my Weather Display main site. Not everything on them works yet and some that does will not return to the CMX site but the WD one. My live WD site has been running since 2005 and I really need to be able to replicate as much as I can with CMX before it can go live.
OK. Running CUtils with website as argument always sends out the signature file once per 24 hrs. The only option you have is to fill in the website or not (I prefer it in of course ;) ). So that fact that you were on the map but not anymore is at least surprising. There have been issues with the datetime differences for certain locales before so it would be interesting to see what happens if you remove the DoneToday parameter in section [Maps]. Just remove and let the system do the rest. I assume you run at least once per day (crontab?) and at higher frequency for e.g. sysinfo, UserAskedData, UserReports?

Re: Error System uptime

Posted: Sun 03 Sep 2023 7:47 pm
by HansR
OK. Found the issue. Map is not your problem.

Re: Error System uptime

Posted: Mon 04 Sep 2023 9:46 am
by broadstairs
Re Map thanks for confirming that.

As for that strange url in FTP the only thing I can think is that I had intended to insert that elsewhere in the file and hit ctrl-V to paste and saved without checking the cursor was on the correct line. I would never have deliberately inserted a url in that field. But I guess we will never know for sure.

Stuart

Re: Error System uptime

Posted: Mon 04 Sep 2023 11:00 am
by HansR
broadstairs wrote: Mon 04 Sep 2023 9:46 am As for that strange url in FTP the only thing I can think is that I had intended to insert that elsewhere in the file and hit ctrl-V to paste and saved without checking the cursor was on the correct line. I would never have deliberately inserted a url in that field. But I guess we will never know for sure.
That's OK Stuart, wouldn't worry about it.
Some error made somewhere... we've all been there done that.