Suspected corrupt file

If you’ve been reading my posts about disk problems on my servers you’ll know that I’m working to get them resolved ASAP. One site that I need to move to the new servers is:

I suspect there’s a corrupt file somewhere because the site doesn’t display and if I turn on error reporting I get:

Warning: Trying to access array offset on value of type bool in /var/www/html/pwsWD/PWS_livedata.php on line 241
Warning: Trying to access array offset on value of type null in /var/www/html/pwsWD/PWS_livedata.php on line 241
Warning: Trying to access array offset on value of type null in /var/www/html/pwsWD/PWS_livedata.php on line 241
Deprecated: str_replace(): Passing null to parameter #3 ($subject) of type array|string is deprecated in /var/www/html/pwsWD/PWS_shared.php on line 165
Fatal error: Uncaught TypeError: array_key_exists(): Argument #2 ($array) must be of type array, bool given in /var/www/html/pwsWD/PWS_livedata.php:321 Stack trace: #0 /var/www/html/pwsWD/PWS_index2.php(30): include() #1 /var/www/html/pwsWD/index.php(38): include('...') #2 {main} thrown in /var/www/html/pwsWD/PWS_livedata.php on line 321

I can load easyweathersetup and can’t see anything wrong. The update checker isn’t reporting that I’ve got anything out of date. Data seems to be arriving from the weather station through the API. The site does the same on the old servers, so it’s not something I’ve caused during the transfer.

Any suggestions of what to look at to fix this problem?

Edit: There’s a post reporting a similar error in the forum, but that was related to Weatherflow lightning. The station in this case is an Ecowitt Wittboy so that issue doesn’t seem to be related.

This is the error:

Warning : Trying to access array offset on value of type bool in /var/www/html/pwsWD/PWS_livedata.php on line 241

I suspect you moved the pwsWD/ folder to another server path.
Please run PWS_easyweathersetup.php and click the green save button.
That should save the correct paths for the files.

The data should arrive in ecowitt/ecco_api.arr
And the data seems correct: PWS_listfile.php?file=ecowitt/ecco_api.arr&type=arr


The only file which could give a problem is _my_settings/history.txt

PWS_listfile.php?file=./_my_settings/history.txt

That file is incorrect (empty).
Copy an old one from the previous server or rename the current one.
A new history will be rebuild.

Succes,
Wim

That was it. I found an old file and copied that which has fixed the problem. Zero length files were the main problem with corruption on the old server so I guess the history file got truncated.

Thanks for finding the fix for me :smiley:

I see the “Current” column in History is labelled “Other Units”, probably as a result of the change mentioned here?

It does appear to be…or was. I’ve changed it back now