Every morning I have a "crash report" why?
-
@Gertjan hmm okay add this text to pfblockerng.inc line 8279?
this code?
$log = "\n[ {$pfb['grep']} -c ^ {$file_esc} ]{$logtab} CHECK ME line 8279 [ NOW ]";
where will the log be after adding this?
also how would I add this to that line I understand the basic debain commands but know zero FreeBSD commands
-
@BlueCoffee said in Every morning I have a "crash report" why?:
this code?
Like this :
$file_esc = escapeshellarg("{$pfbfolder}/{$header}.txt"); $list_cnt = exec("{$pfb['grep']} -c ^ {$file_esc}"); $log = "\n[ {$pfb['grep']} -c ^ {$file_esc} ]{$logtab} CHECK ME line 8279 [ NOW ]"; $alias_cnt = $alias_cnt + $list_cnt;
@BlueCoffee said in Every morning I have a "crash report" why?:
where will the log be after adding this?
Here I guess :
Firewall > pfBlockerNG > Update
and do a full update.Or eventually under :
-
This post is deleted! -
-
Not huge, it just contains the update date process, by the cron or manually, for the last several days.
Yours start at around 09/1/23 21:00:12Your latest update is from just now : UPDATE PROCESS ENDED [ 09/4/23 09:13:12 ]
But the log line didn't log - the offending code wasn't executed. So no PHP error.
Let's wait until next morning ^^
You should be able to find this text "CHECK ME" in the log, as it is a unique text sequence. -
@Gertjan said in Every morning I have a "crash report" why?:
Not huge, it just contains the update date process, by the cron or manually, for the last several days.
Yours start at around 09/1/23 21:00:12Your latest update is from just now : UPDATE PROCESS ENDED [ 09/4/23 09:13:12 ]
But the log line didn't log - the offending code wasn't executed. So no PHP error.
Let's wait until next morning ^^
You should be able to find this text "CHECK ME" in the log, as it is a unique text sequence.I will look out for it thanks Gertjan
-
@BlueCoffee So I got it today but its differant this time around?
Crash report begins. Anonymous machine information: amd64 14.0-CURRENT FreeBSD 14.0-CURRENT #1 RELENG_2_7_0-n255866-686c8d3c1f0: Wed Jun 28 04:21:19 UTC 2023 root@freebsd:/var/jenkins/workspace/pfSense-CE-snapshots-2_7_0-main/obj/amd64/LwYAddCr/var/jenkins/workspace/pfSense-CE-snapshots-2_7_0-main/sources/FreeBSD-src-REL Crash report details: PHP Errors: [08-Sep-2023 14:23:40 Europe/London] PHP Fatal error: Uncaught TypeError: Unsupported operand types: string / int in /etc/inc/util.inc:2409 Stack trace: #0 /etc/inc/pfsense-utils.inc(1902): get_memory() #1 /usr/local/www/includes/functions.inc.php(104): pfsense_default_state_size() #2 /usr/local/www/includes/functions.inc.php(35): get_pfstate() #3 /usr/local/www/getstats.php(40): get_stats(Array) #4 {main} thrown in /etc/inc/util.inc on line 2409
-
@BlueCoffee said in Every morning I have a "crash report" why?:
/etc/inc/util.inc:2409
Can you show that exact line on your pfSense ?
It's not https://github.com/pfsense/pfsense/blob/94eaa720e7f8c3c3106b3702ca0d16a519bf5b2e/src/etc/inc/util.inc#L2409C2-L2409C2 so you probably are using the System patches package, so lines are a bit different.
-
This is what I have on that line
return array(($physmem/1048576), ($realmem/1048576));
The whole function is
function get_memory() { $physmem = get_single_sysctl("hw.physmem"); $realmem = get_single_sysctl("hw.realmem"); /* convert from bytes to megabytes */ return array(($physmem/1048576), ($realmem/1048576));
-
@BlueCoffee said in Every morning I have a "crash report" why?:
return array(($physmem/1048576), ($realmem/1048576));
Ok, thanks.
For some reason, "$realmem" a PHP variable, didn't contain something that looks like an 'integer', but a text string like an error message ? or a null == "" string, which was in the past, after a implicit cast to a value integer '0', and now, with PHP 8,x, which uses far stronger type checking, it fails.
Take note : thinking out loud here."$realmem" should of course contain something like "4194304" which is 4 Mbytes for a 4 Mbytes system.
On your system, something else is return.
And that makes PHP fail .....edit : or $physmem
-
@Gertjan said in Every morning I have a "crash report" why?:
@BlueCoffee said in Every morning I have a "crash report" why?:
return array(($physmem/1048576), ($realmem/1048576));
Ok, thanks.
For some reason, "$realmem" a PHP variable, didn't contain something that looks like an 'integer', but a text string like an error message ? or a null == "" string, which was in the past, after a implicit cast to a value integer '0', and now, with PHP 8,x, which uses far stronger type checking, it fails.
Take note : thinking out loud here."$realmem" should of course contain something like "4194304" which is 4 Mbytes for a 4 Mbytes system.
On your system, something else is return.
And that makes PHP fail .....edit : or $physmem
All that seems way over my head pal im no coder :) I never had any errors on my old PFsense box. after I moved to this little box errors seem to be poping up all over.
Should I post this error ina new thread do you think?
-
@BlueCoffee said in Every morning I have a "crash report" why?:
Should I post this error ina new thread do you think?
We'll leave that to the forum admins ^^
here :
log_error(sprintf('hw.physmem = "%s" - hw.realmem = "%s"', $physmem, $realmem));
Do you think you can manage to edit the file, make it look like this :
Now go to the pfSense GUI dashboard.
And then to the location where the answers are : the logs :You saw I what I have. Both are probably strings that can easily be converted to integer numbers.
Now : your turn.@BlueCoffee said in Every morning I have a "crash report" why?:
I moved to this little box
What little box ?