Errors with latest version of PWS_loadfiles.php (SOLVED)

Firstly Happy New Year to everyone - May you all Live Long and Prosper

This problem was first posted in the “Update to PHP 8 thread” but it does not seem to be a PHP 8 problem

Digging around a little more the latest version of the PWS_loadfiles.php produces errors on by system and the cron job does not work.

This is the error when using _test.php

Fatal error: Uncaught TypeError: array_key_exists): Argument #2 (Sarray) must be of type array, bool given in /homepages/4/d720759433/htdocs/wxwatch/ps/PWS_load_files.php:62
Stack trace: #0 /homepages/4/d720759433/htdocs/wxwatch/pws/PWS_load_files.php(429): calc statuses() #1 {main} thrown in /homepages/4/d720759433/htdocs/wxwatch/pws/PWS_load_files.php on line 62

If I use an older version of the file (the one before the latest I think) all is perfect with no errors and the cron job works as expected.

At the moment the working file is on my site.

I attach a zip file containing the two files the two files - the working and the non working

Thanks


Archive.zip (13.6 KB)

Hi there
I had the same upgrading to PHP 8 You are using PHP 8.1
Take a look at this thread it might help?

Sorry it is returning an unwanted error also
https://wx-watch.co.uk/pws/PWS_load_files.php?test
Warning: foreach() argument must be of type array|object, bool given in /homepages/4/d720759433/htdocs/wxwatch/pws/PWS_load_files.php on line 62
That line is addressing the in-memory array “$statuses” but it disappeared.
The error is just a warning, all scripts continue, including the cron-job. Albeit with errors in logs depending on your server settings.

BUT: The latest official version has code to remove an optional file (auroro) to help multiple users having problems with the “stalled” file.
When the memory array $statuses has disappeared, the check if aurora-file exists results in a fatal error.
And the load-files script ends and the cron-job then also.

The real problem is the disappearance of the memory array $statuses, and AFAIK you are the only user with that error.

I attach a zip file containing the two files the two files - the working and the non working Thanks

I answered your questions here http://discourse.weather-watch.com/p/565386
Your answer http://discourse.weather-watch.com/p/565387

It has nothing to do with PHP 8.
The statuses array is lost somewhere during all the loads in the load_files sceript.

It is something in your specific setup. No other users known with the same error-message.
Can be any combination of multiple “small” problems.
Putting multiple messages about the same problem will not solve it.

To test what is happening at your website, I need time (after Jan 18) and full FTP access to a user website with that problem.

AGAIN
You should run the adapted script and that makes sure you have no errors in the log.

Wim

Thank you so much for your brilliant support - I do appreciate it - sorry if I am a bit slow at times - I am somewhat advanced in years!!!

I am away for a while. When I get back I will sort out FTP access for my site and let you know via PM if that’s ok so when you have time you can have a look.

Again many thanks

Hi Wim

I will send you a PM with the login details for my site if that’s ok.

Just to recap with the latest version of the PWS_load_files.php errors occur.

With an older version (the one I am using) it works fine.

All solved, there was an invalid/damaged _my_settings/status.arr

I uploaded the latest version of PWS_load_files.php, no errors anymore.

Wim

P.S. Can you please modify the Subject of your first post to Errors with latest version of PWS_loadfiles.php [Solved]

Brilliant!

Many may thanks