Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[2.1]: Multiple cron.php errors: Trying to access array offset on null; database value you're trying to insert does not exist; given array of integer values is empty #8301

Open
sbulen opened this issue Aug 4, 2024 · 3 comments

Comments

@sbulen
Copy link
Contributor

sbulen commented Aug 4, 2024

Basic Information

After approving a requestable membergroup request, several errors may be logged. The background task is not processed successfully, and the task stays in the queue. Subsequent runs of cron add additional errors. Clearing the background tasks usually (not always) resolves the issues.

Errors include:

  • 2: Trying to access array offset on null, Logging.php line 546
  • The database value you're trying to insert does not exist: id_member, Function: logActions, Logging.php line 559
  • Database error, given array of integer values is empty. (request_list), Function: execute, GroupAct-Notify.php line 33

Steps to reproduce

  1. Install new forum
  2. Create a requestable user group
  3. Create a new user
  4. Logon as that new user, and request entry into the requestable user group
  5. As admin/moderator, approve the request

Users are added to the group, but the notifications are not sent. Errors are logged, and the background tasks remain in the queue.

3.0 seems to work fine!!!

Expected result

Approval completion with notification.

Actual result

Approval is completed, user is added to group, but the notification is not sent and the background tasks queue gets clogged.

Version/Git revision

2.1.4

Database Engine

All

Database Version

8.4

PHP Version

8.3.8

Logs

Background task task_data:
{"member_id":1,"member_ip":"127.0.0.1","request_list":[],"status":"approve","reason":"","time":1722785847}

Additional Information

From the forum:
https://www.simplemachines.org/community/index.php?topic=589416.0
https://www.simplemachines.org/community/index.php?topic=587401.0

@sbulen
Copy link
Contributor Author

sbulen commented Aug 5, 2024

The 3rd error, the empty request_list in GroupAct-Notify.php line 33, I have only seen on some fresh installs, and is difficult to reproduce. I suspect it is tied to group maintenance between the request & the approval.

The other two errors are caused by $user_info not being defined in the task. Attempting to access it produces the Logging.php line 546 error, $memIP remains not defined, so the line 559 error results on the DB call.

(Interestingly, 546 invokes the error handler, which creates a skeletal $user_info full of blanks & zeroes... I'm not sure we want the error handler to do that?)

err1
err2

@sbulen
Copy link
Contributor Author

sbulen commented Aug 5, 2024

You can get slightly different errors in different versions of php, & whether or not the user has allowed email notifications.

Another common one is "2: Undefined array key "is_admin"" in Security.php, line 910. This appears to have the same root cause - undefined $user_info.

I believe 3.0 is OK because it no longer mixes globals & properties...

@sbulen
Copy link
Contributor Author

sbulen commented Aug 6, 2024

You can get the empty request_list error if you delete that particular membergroup while the request is mid-process.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant