mainSavannah Administration - Support: sr #110988, (wishlist) more php warnings

 
 

sr #110988: (wishlist) more php warnings

Submitter:  Jing Luo <jing>
Submitted:  Fri 22 Dec 2023 03:46:02 PM UTC
   
 
Category:  Savane Priority:  5 - Normal
Severity:  1 - Wish Status:  Done
Privacy:  Public Assigned to:  ineiev
Operating System:  None Open/Closed:  Closed
* Mandatory Fields

Add a New Comment Rich Markup
   

Jump to the original submission

Thu 28 Dec 2023 04:24:59 PM UTC, comment #11: 

comment #10:

> AH01071: Got error 'rms.php:666: [E_WARNING] Trying to access array offset on value of type null\nbacktrace:\n{\n\n}
>
> rms.php?


userperms.php truncated, I guess.

Now I've found and fixed it; thanks.

Ineiev <ineiev>
Site Administrator
Thu 28 Dec 2023 01:53:51 PM UTC, comment #10: 


comment #9:

> comment #6:
> > [Tue Dec 26 20:42:47.401643 2023] [proxy_fcgi:error] [pid 67929:tid 140014675506880] [remote 240b::] AH01071: Got error 'PHP message: /usr/local/share/savane/frontend/php/include/sane.php:421: [E_WARNING] foreach() argument must be of type array|object, string given
> ...


OK, this one is my fault. I played around with the code.

> > And then a big one spamming error.log, referer: project/admin/useradmin.php, trimming a part of the message:
>
> I can't reproduce these.


Did you use php 8.2? It seems to me that php is complaining about the null value from the db "groups" table, but the backtrace is incomplete.

And here's a spooky one:

AH01071: Got error 'rms.php:666: [E_WARNING] Trying to access array offset on value of type null\nbacktrace:\n{\n\n}

rms.php?

Jing Luo <jing>
Group Member
Thu 28 Dec 2023 12:04:55 PM UTC, comment #9: 

comment #6:

> [Tue Dec 26 20:42:47.401643 2023] [proxy_fcgi:error] [pid 67929:tid 140014675506880] [remote 240b::] AH01071: Got error 'PHP message: /usr/local/share/savane/frontend/php/include/sane.php:421: [E_WARNING] foreach() argument must be of type array|object, string given

...

> And then a big one spamming error.log, referer: project/admin/useradmin.php, trimming a part of the message:


I can't reproduce these.

Ineiev <ineiev>
Site Administrator
Thu 28 Dec 2023 09:36:51 AM UTC, comment #8: 

comment #7:

> another one:
>
> AH01071: Got error 'PHP message: /usr/local/share/savane/frontend/php/include/account.php:188:

...

> PHP message: /usr/local/share/savane/frontend/php/include/account.php:193:...


Thank you, fixed.

Ineiev <ineiev>
Site Administrator
Tue 26 Dec 2023 01:30:56 PM UTC, comment #7: 

another one:

AH01071: Got error 'PHP message: /usr/local/share/savane/frontend/php/include/account.php:188: [E_DEPRECATED] preg_match(): Passing null to parameter #2 ($subject) of type string is deprecated
backtrace:
{
/usr/local/share/savane/frontend/php/project/admin/squadadmin.php:76:account_realname_valid(<NULL>)
}

PHP message: /usr/local/share/savane/frontend/php/include/account.php:193: [E_DEPRECATED] strtr(): Passing null to parameter #1 ($string) of type string is deprecated
backtrace:
{
/usr/local/share/savane/frontend/php/project/admin/squadadmin.php:77:account_sanitize_realname(<NULL>)
}

The real name in database is "Unreal Test", it should not have been NULL.

Jing Luo <jing>
Group Member
Tue 26 Dec 2023 12:51:45 PM UTC, comment #6: 

Another one:

[Tue Dec 26 20:42:47.401643 2023] [proxy_fcgi:error] [pid 67929:tid 140014675506880] [remote 240b::] AH01071: Got error 'PHP message: /usr/local/share/savane/frontend/php/include/sane.php:421: [E_WARNING] foreach() argument must be of type array|object, string given
backtrace:
{

}
request params _SERVER: ['REQUEST_URI' => '/account/login.php',
'QUERY_STRING' => '',
'REQUEST_METHOD' => 'POST']
POST: ['uri' => '/',
'form_loginname' => 'drop_database',
'form_pw' => '+K$EEiU39v4SUL=',
'login' => 'Login',
'website' => 'http://']
',

And then a big one spamming error.log, referer: project/admin/useradmin.php, trimming a part of the message:

[Sat Dec 23 15:46:01.483458 2023] [proxy_fcgi:error] [pid 17677:tid 140014725863104] [remote 240b::] AH01071: Got error '; PHP message: /usr/local/share/savane/frontend/php/project/admin/userperms.php:621: [E_WARNING] Trying to access array offset on value of type null\nbacktrace:\n{\n/usr/local/share/savane/frontend/php/project/admin/userperms.php:721:print_group_posting_defaults('105', Group Object\n(\n    [error_state] => \n    [error_messag
e] => \n    [data_array] => Array\n        (\n            [0] => 105\n            [group_id] => 105\n            [1] => savane testing 1\n            [group_name] => savane testing 1\n            [2] => 2\n            [type] => 2\n    
       [3] => 1\n            [is_public] => 1\n            [4] => A\n            [status] => A\n            [5] => svtest1\n            [unix_group_name] => svtest1\n            [6] => 70001\n            [gidNumber] => 70001\n         
  [7] => testing\n            [short_description] => testing\n            [8] => gplv3orlater\n            [license] => gplv3orlater\n            [9] => Test 1sssssssssssssssssssFDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDdddddddddddddddddddxs\n  
       ...; PHP message: /usr/local/share/savane/frontend/php/project/admin/userperms.php:621: [E_WARNING] Trying to access array offset on value of type null\nbacktrace:\n{\n/usr/local/share/savane/frontend/php/project/admin/userperms.
php:721:print_group_posting_defaults('105', Group Object\n(\n    [error_state] => \n    [error_message] => \n    [data_array] => Array\n        (\n            [0] => 105\n            [group_id] => 105\n            [1] => savane testing
1\n            [group_name] => savane testing 1\n            [2] => 2\n            [type] => 2\n            [3] => 1\n            [is_public] => 1\n            [4] => A\n            [status] => A\n            [5] => svtest1\n          
 [unix_group_name] => svtest1\n            [6] => 70001\n            [gidNumber] => 70001\n            [7] => testing\n            [short_description] => testing\n            [8] => gplv3orlater\n            [license] => gplv3orlater\n
           [9] => Test 1sssssssssssssssssssFDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDdddddddddddddddddddxs\n          ...; PHP message: /usr/local/share/savane/frontend/php/project/admin/userperms.php:621: [E_WARNING] Trying to access array offse
t on value of type null\nbacktrace:\n{\n/usr/local/share/savane/frontend/php/project/admin/userperms.php:721:print_group_posting_defaults('105', Group Object\n(\n    [error_state] => \n    [error_message] => \n    [data_array] => Array\
n        (\n            [0] => 105\n            [group_id] => 105\n            [1] => savane testing 1\n            [group_name] => savane testing 1\n            [2] => 2\n            [type] => 2\n            [3] => 1\n            [is_p
ublic] => 1\n            [4] => A\n            [status] => A\n            [5] => svtest1\n            [unix_group_name] => svtest1\n            [6] => 70001\n            [gidNumber] => 70001\n            [7] => testing\n            [sho
rt_description] => testing\n            [8] => gplv3orlater\n            [license] => gplv3orlater\n            [9] => Test 1sssssssssssssssssssFDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDdddddddddddddddddddxs\n          ...;

Can this be avoided? I can see from the database there are lots of fields with NULL.

Jing Luo <jing>
Group Member
Mon 25 Dec 2023 10:58:16 AM UTC, comment #5: 

comment #4:

> Thank you, fixed.
>
> Any other errors?


Probably, it's up to you to close this sr or leave it open.

Jing Luo <jing>
Group Member
Sat 23 Dec 2023 12:53:25 PM UTC, comment #4: 

Thank you, fixed.

Any other errors?

Ineiev <ineiev>
Site Administrator
Sat 23 Dec 2023 06:40:13 AM UTC, comment #3: 

more places that have "Passing null to parameter ... of type string is deprecated"

AH01071: Got error 'PHP message: /usr/local/share/savane/frontend/php/my/admin/editsshkeys.php:93: [E_DEPRECATED] explode(): Passing null to parameter #2 ($string) of type string is deprecated
AH01071: Got error 'PHP message: /usr/local/share/savane/frontend/php/my/admin/editsshkeys.php:142: [E_DEPRECATED] explode(): Passing null to parameter #2 ($string) of type string is deprecated
AH01071: Got error 'PHP message: /usr/local/share/savane/frontend/php/my/admin/index.php:141: [E_DEPRECATED] explode(): Passing null to parameter #2 ($string) of type string is deprecated

Jing Luo <jing>
Group Member
Sat 23 Dec 2023 02:27:36 AM UTC, comment #2: 

PHP complains about the HTTP header, slightly prettified from the raw apache error log:

[Fri Dec 22 00:16:00.017652 2023][proxy_fcgi:error] [pid 1355:tid 140014767826624] [remote 240b::] AH01071: Got error 'PHP message: /usr/local/share/savane/frontend/php/include/utils.php:794: [E_WARNING] Cannot modify header information - headers already sent by (output started at /usr/local/share/savane/frontend/php/include/layout.php:276)
backtrace:
{
/usr/local/share/savane/frontend/php/siteadmin/retestconfig.php:52:include('/usr/local/share/savane/frontend/php/testconfig.php')
-> /usr/local/share/savane/frontend/php/testconfig.php:598:test_sysconfigs()
-> /usr/local/share/savane/frontend/php/testconfig.php:554:utils_set_csp_headers()
}
request params _SERVER: ['REQUEST_URI' => '/siteadmin/retestconfig.php',
'QUERY_STRING' => '',
'REQUEST_METHOD' => 'GET']
GET: []
; PHP message: /usr/local/share/savane/frontend/php/include/utils.php:796: [E_WARNING] Cannot modify header information - headers already sent by (output started at /usr/local/share/savane/frontend/php/include/layout.php:276)
backtrace:
{
/usr/local/share/savane/frontend/php/siteadmin/retestconfig.php:52:include('/usr/local/share/savane/frontend/php/testconfig.php')
-> /usr/local/share/savane/frontend/php/testconfig.php:598:test_sysconfigs()
-> /usr/local/share/savane/frontend/php/testconfig.php:554:utils_set_csp_headers()
}
request params _SERVER: ['REQUEST_URI' => '/siteadmin/retestconfig.php',
'QUERY_STRING' => '',
'REQUEST_METHOD' => 'GET']
GET: []
; PHP message: /usr/local/share/savane/frontend/php/include/utils.php:804: [E_WARNING] Cannot modify header information - headers already sent by (output started at /usr/local/share/savane/frontend/php/include/layout.php:276)
backtrace:
{
/usr/local/share/savane/frontend/php/siteadmin/retestconfig.php:52:include('/usr/local/share/savane/frontend/php/testconfig.php')
-> /usr/local/share/savane/frontend/php/testconfig.php:598:test_sysconfigs()
-> /usr/local/share/savane/frontend/php/testconfig.php:554:utils_set_csp_headers()
}
request params _SERVER: ['REQUEST_URI' => '/siteadmin/retestconfig.php',
'QUERY_STRING' => '',
'REQUEST_METHOD' => 'GET']
GET: []
'

Jing Luo <jing>
Group Member
Fri 22 Dec 2023 05:21:53 PM UTC, comment #1: 

original submission:

>
> [proxy_fcgi:error] [pid 1355:tid 140014751041216] [remote 240b::] AH01071: Got error 'PHP message: /usr/share/php/Image/Text.php:956: [E_DEPRECATED] Implicit conversion from float 21.587572929065995 to int loses precision\nbacktrace:\n{\n/usr/local/share/savane/frontend/php/captcha.php:144:run_image() [...]


This error is in the captcha library rather than in Savane.

> [proxy_fcgi:error] [pid 1354:tid 140014709077696] [remote 240b::] AH01071: Got error 'PHP message: /usr/local/share/savane/frontend/php/git/admin/index.php:146: [E_DEPRECATED] preg_replace(): Passing null to parameter #3 ($subject) of type array|string is deprecated [...]


Fixed, thank you.

> [proxy_fcgi:error] [pid 1355:tid 140014767826624] [remote 240b::] AH01071: Got error 'PHP message: /usr/local/share/savane/frontend/php/include/utils.php:794: [E_WARNING] Cannot
> modify header information - headers already sent by (output started at /usr/local/share/savane/frontend/php/include/layout.php:276) [...]


The message is incomplete, I can't find the relevant code.

> About the last one: I force the charset=utf-8 in apache conf, could this be the reason?


I don't think so. it's about the order of output.

Ineiev <ineiev>
Site Administrator
Fri 22 Dec 2023 03:46:02 PM UTC, original submission:  

These are the warnings I don't know the meaning of or the solutions to...

[proxy_fcgi:error] [pid 1355:tid 140014751041216] [remote 240b::] AH01071: Got error 'PHP message: /usr/share/php/Image/Text.php:956: [E_DEPRECATED] Implicit conversion from float 21.587572929065995 to int loses precision\nbacktrace:\n{\n/usr/local/share/savane/frontend/php/captcha.php:144:run_image() [...]
[proxy_fcgi:error] [pid 1354:tid 140014709077696] [remote 240b::] AH01071: Got error 'PHP message: /usr/local/share/savane/frontend/php/git/admin/index.php:146: [E_DEPRECATED] preg_replace(): Passing null to parameter #3 ($subject) of type array|string is deprecated [...]
[proxy_fcgi:error] [pid 1355:tid 140014767826624] [remote 240b::] AH01071: Got error 'PHP message: /usr/local/share/savane/frontend/php/include/utils.php:794: [E_WARNING] Cannot
modify header information - headers already sent by (output started at /usr/local/share/savane/frontend/php/include/layout.php:276) [...]

About the last one: I force the charset=utf-8 in apache conf, could this be the reason?

Jing Luo <jing>
Group Member

 

(Note: upload size limit is set to 16384 kB, after insertion of the required escape characters.)

Attach Files:
   
   
Comment:
   

No files currently attached

 

Depends on the following items: None found

Items that depend on this one: None found

 

Carbon-Copy List
  • -email is unavailable- added by ineiev (Posted a comment)
  • -email is unavailable- added by jing (Submitted the item)
  •  

    There are 0 votes so far. Votes easily highlight which items people would like to see resolved in priority, independently of the priority of the item set by tracker managers.

    Only logged-in users can vote.

     

    Follow 4 latest changes.

    Date Changed by Updated Field Previous Value => Replaced by
    2024-01-01 ineiev StatusIn Progress Done
        Open/ClosedOpen Closed
    2023-12-22 ineiev StatusNone In Progress
        Assigned toNone ineiev

    Back to the top

    Powered by Savane 3.13-04b1.
    Corresponding source code