I just set up a new SMF forum on v.2.0.11. My host doesn't allow default PHP mail generation, so I configured the forums to use SMTP mail and entered my server's standard no-reply@mydomain address. I entered the standard host, port, and password information provided by my host, and hit Save... and then the forums stopped working. Any event that would trigger an e-mail being sent instead causes the page to spin for a while, then gives:
QuoteThis webpage is not available
ERR_CONTENT_DECODING_FAILED
1) Logging in works fine.
2) When making a post...
- Click new topic (works)
- Type post message (works)
- Click Post (page spins for several minutes, then errors out)
- The post DOES still get submitted.
3) When registering a new account...
- Click Register (works)
- Type account details (works)
- Click Register (page spins for several minutes, then errors out)
- The account gets created, but no e-mail confirmation ever arrives, so it goes to Unapproved status.
When sending a PM...
- Click user name (works)
- Click "Send PM" (works)
- Type message (works)
- Click Send (page spins for several minutes, then errors out)
- I *think* the PM goes through.
Etc., etc., etc. When I switch back to PHP e-mail, the forums work again, but no e-mails are sent (since, again, my host blocks those).
The SMTP information I'm entering is correct, as the same information entered into my WordPress install works without any problems. I enabled the mail queue in SMF, but no messages are ever queued when I perform the triggering events listed above-- the site seems to die before it actually gets to that stage.
Any idea what's going on? I did a search of the forums, but couldn't find any previous reports of this problem.
Update: When I check the SMF error log, I see a bunch of these errors from the period where I was testing:
8: Undefined variable: scripturl
File: /home/captain/public_html/forum/Themes/vVide/MessageIndex.template.php (main sub template - eval?)
Line: 350
Try to turn off "Enable compressed output" (Admin --> Server Settings)
About that error, you need to "Disable evaluation of templates" (same location), then the error should become more meaningful
Although scripturl being undefined... :o Did you install any MODs already?
Disabled compressed output and evaluation of templates, errors look the same as before.
The errors make it look like the problem is in my template's MessageIndex.template.php file, so I swapped it out for the same file from the "Core" template. Exact same result as before-- page spins, and the same errors apppear in the log. :/
I have one mod installed: SCEditor4Smf
the error may look the same but it should be different, can you post the error message? it should be without eval in it.
[mydomain]/index.php?action=admin;area=logs;sa=errorlog;desc;filter=error_type;value=user
8: Undefined variable: scripturl
File: /home/captain/public_html/forum/Themes/vVide/index.template.php
Line: 350
Also, I just noticed that the user's error page now looks different:
QuoteConnection Problems
Sorry, SMF was unable to connect to the database. This may be caused by the server being busy. Please try again later.
Connection Problems
Sorry, SMF was unable to connect to the database. This may be caused by the server being busy. Please try again later.
so, you'll note that the error in actual in index.template.php
(also, you should never have switched in the CORE theme file... the core theme is significantly different from the default and most other themes, is pretty badly outdated in terms of coding, and should NEVER be used as a basis for a restore to another theme.)
Let's take small steps or else we'll be doing too many things at once.
First and most important:
QuoteConnection Problems
Sorry, SMF was unable to connect to the database. This may be caused by the server being busy. Please try again later.
This means that SMF cannot connect to the database. Check if the MySQL credentials in Settings.php are valid to access your database. If so, check with your host.
This has nothing to do with SMTP or anything, it's a plain server error related to the database access.
Second, try to use SMF's default theme for a while. Append ?theme=1 to your URL and you should go back to default theme yourself, go to your admin panel and set it for everyone. Check if the errors still occur.
1) The database error only came up the one time, and it went away when I switched back to PHP mail. My entered MYSQL information didn't change.
2) I switched to the file from the Default theme instead of the Core theme. Some behaviours have changed:
-Forum posting: the messages seem to post normally without the long loading period, though no e-mail arrives at the account that subscribed to the thread in question.
-Registration: when I log in as one of my test accounts and request a new verification e-mail, the page spins for a minute as it did before, but does ultimately arrive at the "A new activation e-mail has successfully been sent" page. However, no actual e-mail arrives at the user account's listed e-mail address.
-PMs: Sending a message also causes the screen to spin for a while, eventually ending on the "Connection Problems | Sorry, SMF was unable to connect to the database. This may be caused by the server being busy. Please try again later. " error. The message does arrive at the recipient's inbox, but no e-mail notifications are received.
3) As before, switching back to PHP mail ends all of the user-facing problems (though messages continue not to be sent).
Going to test on the default theme now.
That's *really* odd. Out of curiosity, who is your host?
I really don't know how to debug that. Can you please get us a phpinfo?
What is a phpinfo() file? (http://wiki.simplemachines.org/smf/What_is_a_phpinfo()_file)
On the default theme, "request new verification" behaviour is the same (spin for a while, then confirmation, no e-mail sent). PMs spin for a while and then take you to the outbox-- the error isn't encountered. Forum posts go through normally, but also don't send e-mail.
Host is WebHostingBuzz. I'll update in a sec with a phpinfo.
PHPInfo attached.
Any further thoughts on this? Is there anything else I can provide to illustrate the problem? Screenshots, screen recording, configuration settings, etc?
I'm about 24-48 hours out from opening the forum to its intended users, and I'd really like to have the e-mail issue sorted out before everyone shows up...
I really don't know what is happening there. I guess that the mail script is taking too long so your server somehow kills the connection (just guessing) although it should never bring you to a "cannot connect to the database".
Based on the offers your host has available: https://www.webhostingbuzz.com/web-hosting/
I would suggest that the failed connect attempts are probably related to an overloaded server (although I can't prove that and it's just a gut feeling).
Some more thoughts:
- what are the recommended mail settings that your host gave you?
- did you try to enable mail queue?
- are the errors in the log still popping up? Are you still using the default theme?
1) I don't think it would have to do with an overloaded server, as the problem very specifically starts when SMTP is on, and stops when it's off. My WordPress installation on the same server with the same host, port, user, and password sends SMTP mail with no problems.
2) This is all that my host provides through CPanel:
QuoteSecure SSL/TLS Settings
(Recommended)
Username: no-reply@[my domain]
Password: Use the email account's password.
Incoming Server: [my server's actual address-- eg, server35.[theirdomain].com]
IMAP Port: 993
POP3 Port: 995
Outgoing Server: [the same server as above]
SMTP Port: 465
Authentication is required for IMAP, POP3, and SMTP.
3) Yes. Nothing ever seems to show up in the queue.
4) Still getting the same errors:
Quote[myusername]
142.156.1.223
Today at 03:15:34 PM
974a5854073c966352cb44023ee74e61
Type of error: Undefined
http://[mydomain]/forum/index.php?action=admin;area=featuresettings
8: Undefined variable: scripturl
File: /home/captain/public_html/forum/Themes/vVide/index.template.php
Line: 350
Come to think of it, though... SMTP is currently switched off (since I've been turning it off when I'm not testing), and these errors are still being logged. So it seems that the errors are happening either way, and AREN'T a symptom of the SMTP glitch.
5) I had switched back to my custom theme since the frozen page loads seemed to occur either way. Interestingly, though, I've just switched back to the default theme, and even though the SMTP-enabled page loads still take forever and then error out on the user's end, no errors are recorded in the admin-side error log.
So, I think the logged errors and the user-side errors are actually not connected-- the admin errors seem to be a function only of the theme I set, and the user-side loading problems seem to be a function only of the mail setting. And the theme errors don't seem to actually be causing any tangible problems, outside of the error log.
can you attach that themes index.template.php file? that error message is not related to the issue but should be fixed either way. it sounds like a missing global which is an easy fix.
How did you set up the mail config in SMF?
Index.template.php and mail settings screenshot are both attached.
I really appreciate all the work you guys are doing, btw. Half of my job IRL is tech support, and I know how frustrating it is to run into a brick wall like this! :'(
Ok try:
- set the queue options to 5/2 (0 is a bad number to have :P )
- add ssl:// or tls:// before the server name
are you sure that is the correct index.template.php for your theme?
line 350 is
// Each tree item has a URL and name. Some may have extra_before and extra_after.
that has nothing to do with the error that was reported.
Margarett: Ding ding ding! Adding the protocol before the SMTP server seems to have done it-- with SSL:// at the start, there's no more hanging on page load, and my test account just received its registration e-mail. :D
Thank you SOOOOO much for your perseverence on this one. :)
YAAAAAAAY! :D
Illori: Yep, I was super confused too. I also did a check to see if they were any mal-formed references to the variable anywhere in the document, and they all seem to be written correctly. The only way I can the $scripturl variable being undefined is if it isn't being passed by the previous document when the function gets called, but I don't actually know which document that is, so I wasn't able to debug it any further. :/
UPDATE: Bah, I'm a freaking idiot. The file I sent earlier is the index.template from my local folder. I just downloaded a fresh copy from the server and it does, indeed, have a reference to $scripturl on line 350.
*sigh*
Sorry for the dumbness. New file attached. :/
<li><a href="' , $scripturl , '"><i class="fa fa-home"></i></a></li>';
that would be the trouble spot.
as expected you are missing the $scripturl global
2 choices, 1 is remove that line... since there is not really a name defined for that link it looks like it does not show up anywhere
2. is to add $scripturl to line 341 like this
global $context, $settings, $options, $shown_linktree, $scripturl;
It would appear that you, also, rock. Added it to the global declarations, made a few test posts, no new errors.
<3
I'm super grateful for everybody's help. Thanks for being awesome. :D
:) Glad it finally worked for you.