SimpleMachines / SMF

Simple Machines Forum — SMF in short — is free and open-source community forum software, delivering professional grade features in a package that allows you to set up your own online community within minutes!
https://www.simplemachines.org/
Other
587 stars 254 forks source link

[2.1.4]: 2: Undefined array key "code" #8279

Open andrew-davie opened 3 months ago

andrew-davie commented 3 months ago

Basic Information

My error log is showing several of this error per-day, apparently when someone tries to register (user is Guest). Essentially it just says "2: Undefined array key "code"

Steps to reproduce

I do not know how to reproduce. I have some successful registrations, and some of these log events suggesting registration basically works, but some condition causes it to fail sometimes, and trigger a code error. I have tried registering myself and it seemed to go OK. The message seems pretty straightforward, and the point in the code where it literally tries to access the array with the key 'code' is obvious. I just don't know the code well enough to understand why or what's going on.

Expected result

We should not be seeing an error in the log - this appears to be a code bug. In other words, failed registrations are a different issue to this.

Actual result

As noted, it's intermittent and appears to be related to new registrations. All that I know is the error log showing the message.

Screenshot 2024-07-02 at 5 51 00 PM Screenshot 2024-07-02 at 5 50 33 PM

Version/Git revision

2.1.4

Database Engine

MySQL

Database Version

5.7.44-percona-sure1-log

PHP Version

8.1

Logs

No response

Additional Information

No response

arekpietrzyk commented 2 months ago

Same issue here.

DiegoAndresCortes commented 2 months ago

Title of this issue needs to be updated to indicate it's for 2.1

sbulen commented 2 months ago

I can't reproduce, but note that this isn't a registration error - it's a search error. It's just using the function in Registration.php that validates the code.

But the "vid=search" indicates this is a search request.

So it appears the option to use verification on guest searches is enabled.

sbulen commented 2 months ago

I saw a user report on another forum that they got this code error after using the forgot password email link.

andrew-davie commented 2 months ago

Another observation - my last 8 error messages were from a consistent (almost) IP address. [52.230.152.*] where the last number varies. Strangely, this appears to be Microsoft. Just coincidence I suppose, but I thought I'd mention it.

arekpietrzyk commented 2 months ago

I have no past logs now, but for me, it started right after upgrading to 2.1.4