News:

Want to get involved in developing SMF, then why not lend a hand on our github!

Main Menu

Errors on cron.php and Logging.php

Started by rottenrhino, August 02, 2024, 11:30:26 AM

Previous topic - Next topic

rottenrhino

Type of error
Critical
Error message
The database value you're trying to insert does not exist: id_member
Function: logActions
File
/smf/Sources/Logging.php
Line
559
URL of page causing the error
/smf/index.php
/smf/cron.php
Backtrace information

    #0: smf_db_error_backtrace()
    Called from /smf/Sources/Subs-Db-mysql.php on line 201
    #1: smf_db_replacement__callback()
    Called from unknown on line -1
    #2: preg_replace_callback()
    Called from /smf/Sources/Subs-Db-mysql.php on line 346
    #3: smf_db_quote()
    Called from /smf/Sources/Subs-Db-mysql.php on line 783
    #4: smf_db_insert()
    Called from /smf/Sources/Logging.php on line 559
    #5: logActions()
    Called from /smf/Sources/Logging.php on line 410
    #6: logAction()
    Called from /smf/Sources/Subs-Membergroups.php on line 612
    #7: addMembersToGroup()
    Called from /smf/Sources/tasks/GroupAct-Notify.php on line 65
    #8: execute()
    Called from /smf/cron.php on line 249
    #9: perform_task()
    Called from /smf/cron.php on line 131



Error
Type of error
Cron
Error message
2: Trying to access array offset on value of type null
File
/smf/Sources/Logging.php
Line
546
URL of page causing the error
/smf/cron.php
Backtrace information

    #0: smf_error_handler_cron()
    Called from /smf/Sources/Logging.php on line 546
    #1: logActions()
    Called from /smf/Sources/Logging.php on line 410
    #2: logAction()
    Called from /smf/Sources/Subs-Membergroups.php on line 612
    #3: addMembersToGroup()
    Called from /smf/Sources/tasks/GroupAct-Notify.php on line 65
    #4: execute()
    Called from /smf/cron.php on line 249
    #5: perform_task()
    Called from /smf/cron.php on line 131
Forum newly installed.
Not sure if relevant, but went through all files and changed all http calls to https.

I am not asking for a solution. Some help in debugging would be more than enough.

There seems to be an issue with an insert query with an empty id_member, but I can't find how to debug the query. Any help would be greatly appreciated.

shawnb61

I'd take a peek at this similar thread:
https://www.simplemachines.org/community/index.php?msg=4163599

My first suspicion is that this is a bug, due to a malformed background task.  The fix is to delete the background task.

The real issue is whether we can reproduce the bug.  Last time it seemed to be associated with membergroup creation/maintenance.  I wasn't able to reproduce it (to submit a bug fix), but deleting the background task caused the error to go away.
A question worth asking is born in experience & driven by necessity. - Fripp

rottenrhino

Quote from: shawnb61 on August 02, 2024, 12:46:11 PMI'd take a peek at this similar thread:
https://www.simplemachines.org/community/index.php?msg=4163599

My first suspicion is that this is a bug, due to a malformed background task.  The fix is to delete the background task.

The real issue is whether we can reproduce the bug.  Last time it seemed to be associated with membergroup creation/maintenance.  I wasn't able to reproduce it (to submit a bug fix), but deleting the background task caused the error to go away.

Yes, this began after I accepted a member into a membergroup. I will look for the tables where background tasks are stored and confirm if it went away. Thank you so much.

I am currently just testing, so if you'd like to break the forum, you are welcome to.

rottenrhino

Hi Shawn, I'm back. If you tell me which tables to truncate for tasks, I can make an attempt to reproduce the issue from a clean slate. I found two, smf_background_tasks and smf_log_scheduled_tasks. Truncate those and try again? Standing by...

Arantor

smf_background_tasks is the one to look for. Specifically an item that refers to GroupAct-Notify - a notification from a group action.
Holder of controversial views, all of which my own.


rottenrhino

#5
id_task    task_file    task_class    task_data    claimed_time
18    $sourcedir/tasks/GroupAct-Notify.php    GroupAct_Notify_Background    {"member_id":1,"member_ip":"10.254.254.200","request_list":["1"],"status":"approve","reason":"","time":1722149186}    1722628231

21    $sourcedir/tasks/GroupAct-Notify.php    GroupAct_Notify_Background    {"member_id":1,"member_ip":"10.254.254.200","request_list":["2"],"status":"approve","reason":"","time":1722537661}    1722615601
This was the only data in smf_background_tasks. Will truncate the table and report back...

Kindred

Слaва
Украинi

Please do not PM, IM or Email me with support questions.  You will get better and faster responses in the support boards.  Thank you.

"Loki is not evil, although he is certainly not a force for good. Loki is... complicated."

rottenrhino


rottenrhino

I think after 3 hours, it's safe to say that truncating the smf_background_tasks table resolved the errors issue. I will register a new user and attempt to recreate the error as soon as I can.

Steve

In that case, I'm going to mark this solved. If registering a new member still causes the problem, feel free to mark it not solved and let us not what is happening.
My pet rock is not feeling well. I think it's stoned.

rottenrhino

Will do, thanks everyone for your help!

shawnb61

Quote from: rottenrhino on August 02, 2024, 03:56:27 PMYes, this began after I accepted a member into a membergroup. I will look for the tables where background tasks are stored and confirm if it went away. Thank you so much.

That was helpful...  I was able to reproduce an issue here - I think...  But will need more time to verify.  I believe there are different error messages with different versions of php.

I believe this issue only happens with the very first group request & approval cycle, for requestable groups.  So...  That's why it's hard to reproduce.  But it does leave a broken background task record laying around, so when it happens, it creates recurring errors. 
A question worth asking is born in experience & driven by necessity. - Fripp

shawnb61

A question worth asking is born in experience & driven by necessity. - Fripp

Advertisement: