Fossil SCM

The /errorlog page (Admin access only) now recognizes timeouts and WAL recovery notifications as separate error categories.

drh 2025-12-08 11:23 trunk
Commit 9225f7d3e001d542922dd195d8fc196c86f2720b3df4061471e0e2f90bf5c0cf
1 file changed +37 -8
--- src/security_audit.c
+++ src/security_audit.c
@@ -837,21 +837,23 @@
837837
** y=0x008 Show POST requests from a different origin
838838
** y=0x010 Show SQLITE_AUTH and similar
839839
** y=0x020 Show SMTP error reports
840840
** y=0x040 Show TH1 vulnerability reports
841841
** y=0x080 Show SQL errors
842
-** y=0x800 Show other uncategorized messages
842
+** y=0x100 Show timeouts
843
+** y=0x200 Show WAL recoveries
844
+** y=0x8000 Show other uncategorized messages
843845
**
844846
** If y is omitted or is zero, a count of the various message types is
845847
** shown.
846848
*/
847849
void errorlog_page(void){
848850
i64 szFile;
849851
FILE *in;
850852
char *zLog;
851853
const char *zType = P("y");
852
- static const int eAllTypes = 0x8ff;
854
+ static const int eAllTypes = 0x83ff;
853855
long eType = 0;
854856
int bOutput = 0;
855857
int prevWasTime = 0;
856858
int nHack = 0;
857859
int nPanic = 0;
@@ -860,10 +862,12 @@
860862
int nXPost = 0;
861863
int nAuth = 0;
862864
int nSmtp = 0;
863865
int nVuln = 0;
864866
int nSqlErr = 0;
867
+ int nTimeout = 0;
868
+ int nRecover = 0;
865869
char z[10000];
866870
char zTime[10000];
867871
868872
login_check_credentials();
869873
if( !g.perm.Admin ){
@@ -945,11 +949,17 @@
945949
@ <li>TH1 vulnerabilities
946950
}
947951
if( eType & 0x80 ){
948952
@ <li>SQL errors
949953
}
950
- if( eType & 0x800 ){
954
+ if( eType & 0x100 ){
955
+ @ <li>Timeouts
956
+ }
957
+ if( eType & 0x200 ){
958
+ @ <li>WAL recoveries
959
+ }
960
+ if( eType & 0x8000 ){
951961
@ <li>Other uncategorized messages
952962
}
953963
@ </ul>
954964
}
955965
@ <hr>
@@ -960,19 +970,30 @@
960970
if( prevWasTime ){
961971
if( strncmp(z,"possible hack attempt - 418 ", 27)==0 ){
962972
bOutput = (eType & 0x01)!=0;
963973
nHack++;
964974
}else
965
- if( (strncmp(z,"panic: ", 7)==0 && strncmp(z+7,"Timeout",7)!=0)
966
- || strstr(z," assertion fault ")!=0
967
- ){
975
+ if( strncmp(z,"panic: ", 7)==0 ){
976
+ if( strncmp(z+7,"Timeout",7) ){
977
+ bOutput = (eType & 0x100)!=0;
978
+ nTimeout++;
979
+ }else{
980
+ bOutput = (eType & 0x02)!=0;
981
+ nPanic++;
982
+ }
983
+ }else
984
+ if( strstr(z,"assertion fault")!=0 ){
968985
bOutput = (eType & 0x02)!=0;
969986
nPanic++;
970987
}else
971988
if( strncmp(z,"SMTP:", 5)==0 ){
972989
bOutput = (eType & 0x20)!=0;
973990
nSmtp++;
991
+ }else
992
+ if( sqlite3_strglob("warning: SQLITE_NOTICE(283):*",z)==0 ){
993
+ bOutput = (eType & 0x200)!=0;
994
+ nRecover++;
974995
}else
975996
if( sqlite3_strglob("warning: backoffice process * still *",z)==0 ){
976997
bOutput = (eType & 0x04)!=0;
977998
nHang++;
978999
}else
@@ -993,11 +1014,11 @@
9931014
if( strstr(z,"statement aborts at ") ){
9941015
bOutput = (eType & 0x80)!=0;
9951016
nSqlErr++;
9961017
}else
9971018
{
998
- bOutput = (eType & 0x800)!=0;
1019
+ bOutput = (eType & 0x8000)!=0;
9991020
nOther++;
10001021
}
10011022
if( bOutput ){
10021023
@ %h(zTime)\
10031024
}
@@ -1036,10 +1057,18 @@
10361057
}
10371058
if( nSqlErr>0 ){
10381059
@ <tr><td align="right">%d(nSqlErr)</td>
10391060
@ <td><a href="./errorlog?y=128">SQL Errors</a></td>
10401061
}
1062
+ if( nTimeout>0 ){
1063
+ @ <tr><td align="right">%d(nTimeout)</td>
1064
+ @ <td><a href="./errorlog?y=256">Timeouts</a></td>
1065
+ }
1066
+ if( nRecover>0 ){
1067
+ @ <tr><td align="right">%d(nRecover)</td>
1068
+ @ <td><a href="./errorlog?y=512">WAL recoveries</a></td>
1069
+ }
10411070
if( nHang>0 ){
10421071
@ <tr><td align="right">%d(nHang)</td>
10431072
@ <td><a href="./errorlog?y=4">Hung Backoffice</a></td>
10441073
}
10451074
if( nXPost>0 ){
@@ -1054,11 +1083,11 @@
10541083
@ <tr><td align="right">%d(nSmtp)</td>
10551084
@ <td><a href="./errorlog?y=32">SMTP faults</a></td>
10561085
}
10571086
if( nOther>0 ){
10581087
@ <tr><td align="right">%d(nOther)</td>
1059
- @ <td><a href="./errorlog?y=2048">Other</a></td>
1088
+ @ <td><a href="./errorlog?y=32768">Other</a></td>
10601089
}
10611090
@ <tr><td align="right">%d(nTotal)</td>
10621091
if( nTotal>0 ){
10631092
@ <td><a href="./errorlog?y=4095">All Messages</a></td>
10641093
}else{
10651094
--- src/security_audit.c
+++ src/security_audit.c
@@ -837,21 +837,23 @@
837 ** y=0x008 Show POST requests from a different origin
838 ** y=0x010 Show SQLITE_AUTH and similar
839 ** y=0x020 Show SMTP error reports
840 ** y=0x040 Show TH1 vulnerability reports
841 ** y=0x080 Show SQL errors
842 ** y=0x800 Show other uncategorized messages
 
 
843 **
844 ** If y is omitted or is zero, a count of the various message types is
845 ** shown.
846 */
847 void errorlog_page(void){
848 i64 szFile;
849 FILE *in;
850 char *zLog;
851 const char *zType = P("y");
852 static const int eAllTypes = 0x8ff;
853 long eType = 0;
854 int bOutput = 0;
855 int prevWasTime = 0;
856 int nHack = 0;
857 int nPanic = 0;
@@ -860,10 +862,12 @@
860 int nXPost = 0;
861 int nAuth = 0;
862 int nSmtp = 0;
863 int nVuln = 0;
864 int nSqlErr = 0;
 
 
865 char z[10000];
866 char zTime[10000];
867
868 login_check_credentials();
869 if( !g.perm.Admin ){
@@ -945,11 +949,17 @@
945 @ <li>TH1 vulnerabilities
946 }
947 if( eType & 0x80 ){
948 @ <li>SQL errors
949 }
950 if( eType & 0x800 ){
 
 
 
 
 
 
951 @ <li>Other uncategorized messages
952 }
953 @ </ul>
954 }
955 @ <hr>
@@ -960,19 +970,30 @@
960 if( prevWasTime ){
961 if( strncmp(z,"possible hack attempt - 418 ", 27)==0 ){
962 bOutput = (eType & 0x01)!=0;
963 nHack++;
964 }else
965 if( (strncmp(z,"panic: ", 7)==0 && strncmp(z+7,"Timeout",7)!=0)
966 || strstr(z," assertion fault ")!=0
967 ){
 
 
 
 
 
 
 
968 bOutput = (eType & 0x02)!=0;
969 nPanic++;
970 }else
971 if( strncmp(z,"SMTP:", 5)==0 ){
972 bOutput = (eType & 0x20)!=0;
973 nSmtp++;
 
 
 
 
974 }else
975 if( sqlite3_strglob("warning: backoffice process * still *",z)==0 ){
976 bOutput = (eType & 0x04)!=0;
977 nHang++;
978 }else
@@ -993,11 +1014,11 @@
993 if( strstr(z,"statement aborts at ") ){
994 bOutput = (eType & 0x80)!=0;
995 nSqlErr++;
996 }else
997 {
998 bOutput = (eType & 0x800)!=0;
999 nOther++;
1000 }
1001 if( bOutput ){
1002 @ %h(zTime)\
1003 }
@@ -1036,10 +1057,18 @@
1036 }
1037 if( nSqlErr>0 ){
1038 @ <tr><td align="right">%d(nSqlErr)</td>
1039 @ <td><a href="./errorlog?y=128">SQL Errors</a></td>
1040 }
 
 
 
 
 
 
 
 
1041 if( nHang>0 ){
1042 @ <tr><td align="right">%d(nHang)</td>
1043 @ <td><a href="./errorlog?y=4">Hung Backoffice</a></td>
1044 }
1045 if( nXPost>0 ){
@@ -1054,11 +1083,11 @@
1054 @ <tr><td align="right">%d(nSmtp)</td>
1055 @ <td><a href="./errorlog?y=32">SMTP faults</a></td>
1056 }
1057 if( nOther>0 ){
1058 @ <tr><td align="right">%d(nOther)</td>
1059 @ <td><a href="./errorlog?y=2048">Other</a></td>
1060 }
1061 @ <tr><td align="right">%d(nTotal)</td>
1062 if( nTotal>0 ){
1063 @ <td><a href="./errorlog?y=4095">All Messages</a></td>
1064 }else{
1065
--- src/security_audit.c
+++ src/security_audit.c
@@ -837,21 +837,23 @@
837 ** y=0x008 Show POST requests from a different origin
838 ** y=0x010 Show SQLITE_AUTH and similar
839 ** y=0x020 Show SMTP error reports
840 ** y=0x040 Show TH1 vulnerability reports
841 ** y=0x080 Show SQL errors
842 ** y=0x100 Show timeouts
843 ** y=0x200 Show WAL recoveries
844 ** y=0x8000 Show other uncategorized messages
845 **
846 ** If y is omitted or is zero, a count of the various message types is
847 ** shown.
848 */
849 void errorlog_page(void){
850 i64 szFile;
851 FILE *in;
852 char *zLog;
853 const char *zType = P("y");
854 static const int eAllTypes = 0x83ff;
855 long eType = 0;
856 int bOutput = 0;
857 int prevWasTime = 0;
858 int nHack = 0;
859 int nPanic = 0;
@@ -860,10 +862,12 @@
862 int nXPost = 0;
863 int nAuth = 0;
864 int nSmtp = 0;
865 int nVuln = 0;
866 int nSqlErr = 0;
867 int nTimeout = 0;
868 int nRecover = 0;
869 char z[10000];
870 char zTime[10000];
871
872 login_check_credentials();
873 if( !g.perm.Admin ){
@@ -945,11 +949,17 @@
949 @ <li>TH1 vulnerabilities
950 }
951 if( eType & 0x80 ){
952 @ <li>SQL errors
953 }
954 if( eType & 0x100 ){
955 @ <li>Timeouts
956 }
957 if( eType & 0x200 ){
958 @ <li>WAL recoveries
959 }
960 if( eType & 0x8000 ){
961 @ <li>Other uncategorized messages
962 }
963 @ </ul>
964 }
965 @ <hr>
@@ -960,19 +970,30 @@
970 if( prevWasTime ){
971 if( strncmp(z,"possible hack attempt - 418 ", 27)==0 ){
972 bOutput = (eType & 0x01)!=0;
973 nHack++;
974 }else
975 if( strncmp(z,"panic: ", 7)==0 ){
976 if( strncmp(z+7,"Timeout",7) ){
977 bOutput = (eType & 0x100)!=0;
978 nTimeout++;
979 }else{
980 bOutput = (eType & 0x02)!=0;
981 nPanic++;
982 }
983 }else
984 if( strstr(z,"assertion fault")!=0 ){
985 bOutput = (eType & 0x02)!=0;
986 nPanic++;
987 }else
988 if( strncmp(z,"SMTP:", 5)==0 ){
989 bOutput = (eType & 0x20)!=0;
990 nSmtp++;
991 }else
992 if( sqlite3_strglob("warning: SQLITE_NOTICE(283):*",z)==0 ){
993 bOutput = (eType & 0x200)!=0;
994 nRecover++;
995 }else
996 if( sqlite3_strglob("warning: backoffice process * still *",z)==0 ){
997 bOutput = (eType & 0x04)!=0;
998 nHang++;
999 }else
@@ -993,11 +1014,11 @@
1014 if( strstr(z,"statement aborts at ") ){
1015 bOutput = (eType & 0x80)!=0;
1016 nSqlErr++;
1017 }else
1018 {
1019 bOutput = (eType & 0x8000)!=0;
1020 nOther++;
1021 }
1022 if( bOutput ){
1023 @ %h(zTime)\
1024 }
@@ -1036,10 +1057,18 @@
1057 }
1058 if( nSqlErr>0 ){
1059 @ <tr><td align="right">%d(nSqlErr)</td>
1060 @ <td><a href="./errorlog?y=128">SQL Errors</a></td>
1061 }
1062 if( nTimeout>0 ){
1063 @ <tr><td align="right">%d(nTimeout)</td>
1064 @ <td><a href="./errorlog?y=256">Timeouts</a></td>
1065 }
1066 if( nRecover>0 ){
1067 @ <tr><td align="right">%d(nRecover)</td>
1068 @ <td><a href="./errorlog?y=512">WAL recoveries</a></td>
1069 }
1070 if( nHang>0 ){
1071 @ <tr><td align="right">%d(nHang)</td>
1072 @ <td><a href="./errorlog?y=4">Hung Backoffice</a></td>
1073 }
1074 if( nXPost>0 ){
@@ -1054,11 +1083,11 @@
1083 @ <tr><td align="right">%d(nSmtp)</td>
1084 @ <td><a href="./errorlog?y=32">SMTP faults</a></td>
1085 }
1086 if( nOther>0 ){
1087 @ <tr><td align="right">%d(nOther)</td>
1088 @ <td><a href="./errorlog?y=32768">Other</a></td>
1089 }
1090 @ <tr><td align="right">%d(nTotal)</td>
1091 if( nTotal>0 ){
1092 @ <td><a href="./errorlog?y=4095">All Messages</a></td>
1093 }else{
1094

Keyboard Shortcuts

Open search /
Next entry (timeline) j
Previous entry (timeline) k
Open focused entry Enter
Show this help ?
Toggle theme Top nav button