MyBB Community Forums

Full Version: Can't Login, can't fix error
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Pages: 1 2
Hi all - First post here! 

Having an issue with MyBB where I can't log in, nor can any user (there's only a few users so far). When I try to log in with my known-good credentials, I get this: 


"You have successfully been logged in. You will now be taken back to where you came from."

However, when it redirects me, it either never logs me in, or logs me out immediately. I can't get into the ACP to fix the error either. 

Additionally, I get this error in the header: 


"MyBB Internal: One or more warnings occurred. Please contact your administrator for assistance."

Attached is a screenshot of the error.

https://thecaliforniapines.com/forum/


I've got the site hosted, and I already tried to roll PHP back to 7.4; as that's as far back as I can go. I can access the backend stuff if I need to modify any code, too. 

Thank you![attachment=44919]
You can access the site on both http:// and https:// which may be the issue. Try on http://thecaliforniapines.com/forum/ instead, then if you can log in to the ACP there, go to Configuration > Site Details > set your Board URL to be https:// instead of http://, and set Secure Cookie Flag to Yes. You'll also want to set up a redirect to force https:// to be used.
(2022-02-23, 10:44 PM)Matt Wrote: [ -> ]You can access the site on both http:// and https:// which may be the issue. Try on http://thecaliforniapines.com/forum/ instead, then if you can log in to the ACP there, go to Configuration > Site Details > set your Board URL to be https:// instead of http://, and set Secure Cookie Flag to Yes. You'll also want to set up a redirect to force https:// to be used.

Thanks for the quick reply, Matt! 

Same login issue regardless of the S. However, when using the S, it doesn't want to load any of the style elements (guessing it's calling for a CSS that it can't find - plain text, page, basically)

Something also interesting to note: When I try to create a new account to see if it's just my admin account that's botched - the Captcha fails to load....

Digging into the forum error log, I'm getting two main warnings / errors:

[timestamp]PHP Warning:  Trying to access array offset on value of type null in [root]/forum/inc/functions_task.php on line 115
Whereas line 115-118 in the function_task.php file is


115: if(!$task['logging'])
116: {
117: return;
118: }


Error #2 is
[timestamp] PHP Fatal error:  Cannot declare class XMLParser, because the name is already in use in [root]/forum/inc/class_xml.php on line 17

Whereas line 17 is

17: class XMLParser {


I understand that a bunch of errors around XML parsing arose when PHP updated to version 8, so I rolled it back to 7.4, and am still getting errors.
The styling will be broken on https:// until the board URL is updated, that's expected - however I'd have thought logging in would work. Can you try clearing browser cookies and trying again?

I'm presuming you installed 1.8.29? Not sure why you'd have been getting the XMLParser error, and the error for function_task.php doesn't correlate with what's in the code.

I'm thinking maybe the cookie isn't being set because of the errors being output to the browser. Can you edit ./inc/settings.php, find the line for "errortypemedium", and set it to "none", like this:

$settings['errortypemedium'] = "none";

That should stop the errors showing and might allow you to log in. If it does, you'll need to edit this setting again under Server and Optimization Options so it updates the database.
(2022-02-24, 12:54 AM)Matt Wrote: [ -> ]The styling will be broken on https:// until the board URL is updated, that's expected - however I'd have thought logging in would work. Can you try clearing browser cookies and trying again?

I'm presuming you installed 1.8.29? Not sure why you'd have been getting the XMLParser error, and the error for function_task.php doesn't correlate with what's in the code.

I'm thinking maybe the cookie isn't being set because of the errors being output to the browser. Can you edit ./inc/settings.php, find the line for "errortypemedium", and set it to "none", like this:

$settings['errortypemedium'] = "none";

That should stop the errors showing and might allow you to log in. If it does, you'll need to edit this setting again under Server and Optimization Options so it updates the database.
The Error type line is already set to none, exactly as you suggested.
And the version is 1.8, according to the index.php.

The issue is I can’t login either to ensure that I get the HTTP, and HTTPS situation figured out either.

(2022-02-24, 01:33 AM)kylekruchok Wrote: [ -> ]
(2022-02-24, 12:54 AM)Matt Wrote: [ -> ]The styling will be broken on https:// until the board URL is updated, that's expected - however I'd have thought logging in would work. Can you try clearing browser cookies and trying again?

I'm presuming you installed 1.8.29? Not sure why you'd have been getting the XMLParser error, and the error for function_task.php doesn't correlate with what's in the code.

I'm thinking maybe the cookie isn't being set because of the errors being output to the browser. Can you edit ./inc/settings.php, find the line for "errortypemedium", and set it to "none", like this:

$settings['errortypemedium'] = "none";

That should stop the errors showing and might allow you to log in. If it does, you'll need to edit this setting again under Server and Optimization Options so it updates the database.
The Error type line is already set to none, exactly as you suggested.
And the version is 1.8, according to the index.php.

The issue is I can’t login either to ensure that I get the HTTP, and HTTPS situation figured out either.

Oh, and I’ve tried multiple browsers, devices, etc…

I’m sure there’s a folder I could replace to get this working again?
Do you know what specific version you're on though? It'll be in ./inc/class_core.php

As this isn't a newly installed forum, I'm presuming it's worked before? Did it just break without you doing anything?
(2022-02-24, 11:15 AM)Matt Wrote: [ -> ]Do you know what specific version you're on though? It'll be in ./inc/class_core.php

As this isn't a newly installed forum, I'm presuming it's worked before? Did it just break without you doing anything?

Yep - has definitely worked before - and while it's been a hot second since I last logged in, I do remember being able to do so in mid January. 

Version 1.8.24
I don't know what's happened to it then to spontaneously break in its own, there must have been changes to the server if nothing has changed on the forum.

Can you PM me admin login details and I'll see if I can log in, otherwise only thing I can really suggest is to try upgrading to 1.8.29. Alternatively you can edit ./inc/class_error.php and remove this line around line 215:

echo "<div class=\"php_warning\">MyBB Internal: One or more warnings occurred. Please contact your administrator for assistance.</div>";

That will stop the error messages at the top of the page and might allow the login cookie to be set.
(2022-02-24, 11:23 PM)Matt Wrote: [ -> ]I don't know what's happened to it then to spontaneously break in its own, there must have been changes to the server if nothing has changed on the forum.

Can you PM me admin login details and I'll see if I can log in, otherwise only thing I can really suggest is to try upgrading to 1.8.29. Alternatively you can edit ./inc/class_error.php and remove this line around line 215:

echo "<div class=\"php_warning\">MyBB Internal: One or more warnings occurred. Please contact your administrator for assistance.</div>";

That will stop the error messages at the top of the page and might allow the login cookie to be set.

Sending you over the details in DM, in just a second! 

I'll remove that line for now, and see what happens.

(2022-02-24, 11:44 PM)kylekruchok Wrote: [ -> ]
(2022-02-24, 11:23 PM)Matt Wrote: [ -> ]I don't know what's happened to it then to spontaneously break in its own, there must have been changes to the server if nothing has changed on the forum.

Can you PM me admin login details and I'll see if I can log in, otherwise only thing I can really suggest is to try upgrading to 1.8.29. Alternatively you can edit ./inc/class_error.php and remove this line around line 215:

echo "<div class=\"php_warning\">MyBB Internal: One or more warnings occurred. Please contact your administrator for assistance.</div>";

That will stop the error messages at the top of the page and might allow the login cookie to be set.

Sending you over the details in DM, in just a second! 

I'll remove that line for now, and see what happens.


Actually - just removing that line allowed the cookie to set, and log me in! THANK YOU! 

I reckon if I upgrade to the latest 1.8.29, it'll overwrite the class_error.php, and just put that line back in?
Will reply here for posterity.

Seems like removing that line has worked yes - essentially because those errors were being sent to the browser it stopped the cookie being set (just a limitation of how cookies work).

I've also changed the Board URL to https:// so the styles are no longer broken (it works on http:// and https:// now), but you'll want to set up a redirect to force https:// ideally

If you upgrade it'll overwrite that file, but the code for the error reporting has changed since (is why I was confused at first as the error message that was showing doesn't exist in 1.8.29). So you shouldn't need to make any edits afterwards. Hopefully 1.8.29 fixes whatever was wrong, but if it doesn't we can debug then.
Pages: 1 2