e107inc / e107

e107 Bootstrap CMS (Content Management System) v2 with PHP, MySQL, HTML5, jQuery and Twitter Bootstrap. Issue Discussion Room: https://gitter.im/e107inc/e107
https://e107.org
GNU General Public License v3.0
318 stars 212 forks source link

[Bug]: white page after signup on e107.nl and after clicking on activating link in email #5131

Closed Jimmi08 closed 6 months ago

Jimmi08 commented 6 months ago

What e107 version are you using?

Latest Github version (just updated)

Bug description

When I registered on e107.nl I got first error page. I filled all form, if it is important - extended field, signature, avatar.

result after submitting button: image

After refresh page I got message that user with that name and email already exists, so this error was after creating account.

Registration email received. After click on activation link in email almost asap, I got white page (just white, no error visible), after refreshing I got message about Your account was activated.

This is time record from site (I think):

    7351    03 december 2023 13:55:48   633508  USER_13 Jimako  **IP**  Gebruiker ingelogd  Details
    7350    03 december 2023 13:55:48   631855  USER_13 Jimako  **IP**  Gebruiker ingelogd  Details
    7349    03 december 2023 13:50:23   488442  USER_12 Anoniem **IP**  Gebruiker bevestigde registratie    Details
    7348    03 december 2023 13:49:48   181208  USER_11 Anoniem **IP**  Gebruiker aangemeld Details

And this is from error log sent by Alex:



[Sun Dec 03 13:49:48.265865 2023] [proxy_fcgi:error] [pid 693983:tid 139901320136448] [remote 87.244.210.207:59417] 
AH01071: Got error 'PHP message: PHP Fatal error:  Uncaught TypeError: fwrite(): supplied resource is not a valid stream resource in ****e107_handlers/mail.php:492
Stack trace:
#0 ****e107_handlers/mail.php(492): fwrite()
#1 ****e107_handlers/mail.php(1059): e107Email->logLine()
#2 ****e107_handlers/mail.php(1111): e107Email->arraySet()
#3 ****e107_handlers/mail_manager_class.php(2007): e107Email->sendEmail()
#4 ****e107_handlers/notify_class.php(293): e107MailManager->sendEmails()
#5 ****e107_handlers/notify_class.php(114): notify->send()
#6 ****e107_handlers/event_class.php(232): notify->generic()
#7 ****signup.php(554): e107_event->trigger()
#8 {main}
...', referer: https://e107.nl/signup.php?stage1

[Sun Dec 03 13:50:01.583080 2023] [proxy_fcgi:error] [pid 693983:tid 139901513168640] [remote 62.84.245.223:37326] 
AH01071: Got error 'PHP message: PHP Warning:  compact(): Undefined variable $DOWNLOADS_DIRECTORY in ****class2.php on line 213
PHP message: PHP Warning:  compact(): Undefined variable $UPLOADS_DIRECTORY in ****class2.php on line 213
PHP message: PHP Warning:  compact(): Undefined variable $CACHE_DIRECTORY in ****class2.php on line 213
PHP message: PHP Warning:  compact(): Undefined variable $LOGS_DIRECTORY in ****class2.php on line 213
PHP message: PHP Warning:  compact(): Undefined variable $CORE_DIRECTORY in ****class2.php on line 213
PHP message: PHP Warning:  compact(): Undefined variable $WEB_DIRECTORY in ****class2.php on line 213'

[Sun Dec 03 13:50:23.528828 2023] [proxy_fcgi:error] [pid 693983:tid 139901261387520] [remote 87.244.210.207:59428] 
AH01071: Got error 'PHP message: PHP Fatal error:  Uncaught TypeError: fwrite(): supplied resource is not a valid stream resource in ****e107_handlers/mail.php:492
Stack trace:
#0 ****e107_handlers/mail.php(492): fwrite()
#1 ****e107_handlers/mail.php(1059): e107Email->logLine()
#2 ****e107_handlers/mail.php(1111): e107Email->arraySet()
#3 ****e107_handlers/mail_manager_class.php(2007): e107Email->sendEmail()
#4 ****e107_handlers/notify_class.php(293): e107MailManager->sendEmails()
#5 ****e107_handlers/notify_class.php(114): notify->send()
#6 ****e107_handlers/event_class.php(232): notify->generic()
#7 ****e107_handlers/e_signup_class.php(423): e107_event...'

### How to reproduce

Alex revert site to older version. He says that problem with signup was solved but activation is still there.

### Expected behavior

No white page

### What browser(s) are you seeing the problem on?

Chrome / Brave

### PHP Version

No sure, I forgot to ask, sorry.
Alex-e107nl commented 6 months ago

Thx @Jimmi08 PHP version with the problem is 8.1.25, Auto-login new user after clicking on signup link ON account gets activated but there's an error. When i use PHP 7.4.33 it all works as expected... Tomorrow i wil bring the e107.nl back at 2.3.3 and try it again on 7.4.33...

Deltik commented 6 months ago

I am able to reproduce a similar error if I close the file handle e107Email::$logHandle after opening it but before all the logging activities are completed.

After further examination, I found that e107Email::sendEmail() closes the file handle here or here, but e107Email::sendEmail() could be called more than once in this for loop in e107MailManager::sendEmails(). Although e107Email::openLog() runs again, it has no effect because it detects if there is a valid resource, and even a closed file handle is still a valid resource.

This is indeed a bug with e107.

Alex-e107nl commented 6 months ago

Thank you Deltik, it is really a php 8.1.25 problem, as soon as I run e107.nl on php 7.4.33 it works fine, create and activate an account and log in immediately after clicking on the activation link. I did my last test with e107 2.3.3 (official release).

Alex-e107nl commented 6 months ago

Tested and it works with PHP 7.4.33 and PHP 8.1.26, latest git (today), create new account, logged in directly with activation link on e107.nl! GREAT THX!