Page 1 of 1

degree days and temp sump charts not loading

Posted: Thu 13 May 2021 10:44 am
by liddelljs
Ok - I've clearly missed something pretty basic but have been tearing my hair out trying to get these charts to load on the standard web site (new version) on b3130. They just stay blank with the 'loading' message displayed. I thought it might have been due to some customisation I had done to a few web pages and js files so I loaded the vanilla release files but having the same problem. No problems displaying on the MX interface. I'm assuming the json files are alldailydegdaydata and alltempsumdata. These seem to be processing and are ftp'ing to my var/www folder (I'm hosting on an RPi). Any pointers much appreciated. I have cleared the cache. I have also ensured that these charts are checked as visible as per the release notes.

Cheers
Steve

Re: degree days and temp sump charts not loading

Posted: Thu 13 May 2021 10:53 am
by The Dalek Hunter
Working fine when I view them

Re: degree days and temp sump charts not loading

Posted: Thu 13 May 2021 10:59 am
by liddelljs
Many thanks for the prompt response. I didn't make myself very clear - apologies. It is specifically the degree days and temp sum charts on the historic charts page that don't load. All the other charts are fine.

Cheers
Steve

Re: degree days and temp sump charts not loading

Posted: Thu 13 May 2021 11:12 am
by beteljuice
The json files are returning 403 (forbidden) to the historic chart call.

Re: degree days and temp sump charts not loading

Posted: Thu 13 May 2021 11:13 am
by mcrossley
The web server is returning a 403 error - Forbidden.

I'd check the file permissions for those new json files in your web server folder.

Re: degree days and temp sump charts not loading

Posted: Thu 13 May 2021 11:27 am
by liddelljs
Thanks Beteljuice and Mark for your feedback. The file permissions in the web folder are clearly different (-rw-r----- vs -rw-r--r---) but they are identical to all the other json files in the MX web directory. Clearly showing my lack of knowledge on Linux file permissions here but don't understand how this could happen.

Cheers
Steve

Re: degree days and temp sump charts not loading

Posted: Thu 13 May 2021 11:30 am
by freddie
How about the owner and group of the new files? Are they different from the other JSON files?

Re: degree days and temp sump charts not loading

Posted: Thu 13 May 2021 11:40 am
by liddelljs
Hi Freddie,
As far as my limited linux file permissions goes, the new files have owner read and write, user group read and no world permissions (hence why they won't load). All the other json files in the web directory have owner read and write, user group read and world read. In the MX web directory, all json files in the web directory have owner read and write, user group read and world read.

I did just erase the new json files in the web directory and manually copy the files from the MX folder. File permissions are all good and the charts display. I'll check tomorrow when the files update at rollover to see if the permissions are retained when they ftp across.

Cheers
Steve

Re: degree days and temp sump charts not loading

Posted: Thu 13 May 2021 12:00 pm
by freddie
Hi Steve, I was wondering what the actual owner and group was in relation to the existing JSON files - but you have fixed the problem so all is good :)

Re: degree days and temp sump charts not loading

Posted: Thu 13 May 2021 12:08 pm
by liddelljs
Thanks Freddie. The owner and group of the Jason files are both pi.

Cheers
Steve

Re: degree days and temp sump charts not loading

Posted: Thu 13 May 2021 1:38 pm
by freddie
Okay, so you needed world read on the files, as you discovered. Your web server is probably running as a user such as www-data which is highly unlikely to be a member of the pi group - hence world read required.

Re: degree days and temp sump charts not loading

Posted: Fri 14 May 2021 9:22 am
by liddelljs
Hi Freddie,
Many thanks for taking the time to respond. All makes sense and I remember reading this when trawling the net on linux file permissions. Files updated today with no issues so looks like problem solved. Not sure what happened on the first transfer.

Cheers
Steve

Re: degree days and temp sump charts not loading

Posted: Fri 14 May 2021 10:34 am
by freddie
liddelljs wrote: Fri 14 May 2021 9:22 amNot sure what happened on the first transfer.
It will be due to something known as umask setting. This is basically the default permissions given to files when created on the host for the first time. Looks like your umask setting doesn't include world read. Note that whatever software you use to transfer files may well have its own behaviour when it comes to permissions of newly created files. A command line FTP client will likely do a different thing to something like Filezilla or even SCP/WinSCP. They should all use the host's umask setting initially, but then may apply their own settings on top of this.