Simple Machines Community Forum

SMF Support => SMF 2.0.x Support => Topic started by: budiulik on March 05, 2019, 10:13:31 AM

Title: Forum index completely blank!
Post by: budiulik on March 05, 2019, 10:13:31 AM
Hello everyone,
I tried searching the forum for a similar issue but I didn't find any working solution.

I changed a few settings in the admin panel (Optimus SEO settings and changed a few paths to https).

After that, the index page (and I think any front-end page of my forum) is completely blank! If I try to inspect the page source code, it's completely empty.

The admin panel is working fine, though, except for a strange behaviour: when I change a random setting and I click on the SAVE button, the page reloads and the setting is shown with the previous value. I am not sure whether it has not been saved, or a cached version of the admin page is shown instead of the actual one. The error log does not report any error when this issue occurs.

I tried the following with no luck:

1) tried repair_settings
2) tried to clear the cache folder
3) tried to restore a backup from the Package/backups folder of a few days ago
4) tried to restore the robots.txt file
5) tried to restore the default theme
6) tried to uninstall Optimus mod

The forum is still working through Tapatalk!

I think there are corrupted data in the database ... I don't know what else it might be!

Any suggestion or hint is very much welcome!

I am not allowed to post the forum URL yet...

Thanks in advance
Title: Re: Forum index completely blank!
Post by: Looking on March 05, 2019, 10:50:13 AM
What does your error log say?

By the way, Tapatalk is iffy and can be a security hole.
Title: Re: Forum index completely blank!
Post by: Kindred on March 05, 2019, 02:26:28 PM
what you describe is NOT "corrupt data in the database"

What you describe is a critical failure in php at the server/file level.

"tried repair_settings"  -- ok... WHAT did you try? WHAT happened? WHAT did you set/change?

"changed a few paths to https"  did you CHANGE *ALL* paths to https?
Did you do a forced redirect in htaccess to force people to bounce to the https version?

Title: Re: Forum index completely blank!
Post by: budiulik on March 06, 2019, 01:06:26 AM
@Looking the error log says nothing! If I clear the error log and then load the home page, nothing Is added to the log.

@Kindred I tried to restore all the settings. Including switching all the paths to https as it was recommended. Nothing changed though.
No I didn't do a forced redirect to the https version.
Any idea? The back end is being displayed, in all of its parts.

Title: Re: Forum index completely blank!
Post by: Kindred on March 06, 2019, 07:38:38 AM
What backend?
Title: Re: Forum index completely blank!
Post by: budiulik on March 06, 2019, 07:40:09 AM
I mean the SMF administration panel
Title: Re: Forum index completely blank!
Post by: drewactual on March 06, 2019, 07:42:29 AM
you likely have a php error in your template.index or this optimus thing, whatever it interjects.  can you turn the optimus thing off in your admin section?
Title: Re: Forum index completely blank!
Post by: budiulik on March 06, 2019, 07:47:02 AM
Yes, I uninstalled Optimus mod but I still get the same situation.
I also switched to the default theme but nothing changed.
Title: Re: Forum index completely blank!
Post by: drewactual on March 06, 2019, 07:55:19 AM
i wager it didn't 'all' uninstall. 

post up your index.template?
Title: Re: Forum index completely blank!
Post by: budiulik on March 06, 2019, 08:18:18 AM
Quote from: drewactual on March 06, 2019, 07:55:19 AM
i wager it didn't 'all' uninstall. 

post up your index.template?

I guess you're right: the issue has something to do with Optimus....

I made a bunch of tests in the last couple hours, so I restored a backup where Optimus is still installed. I tried to uninstall it and - boom! Even the admin panel is now blank. This has never happened before...

Anyway, I restored the backup WITH Optimus and in attachment you can find the DEFAULT index.template.php

I also found out that it I'm logged out, I get an error 503 when trying to display the forum index. If I'm logged in (I open the url of the admin panel and log in), the index simply looks blank.
If you want to give it a try, the forum url is https://forum.livornosoftair.it/index.php ... you'll see a blank page (or error 503) but if you open the url https://forum.livornosoftair.it/index.php?action=admin you shoul see the admin login screen.
Title: Re: Forum index completely blank!
Post by: drewactual on March 06, 2019, 10:11:57 AM
how about your board.index now?

.... there isn't anything wrong with the index.template you posted.  because you can get into forum when board.index isn't called, it makes me wonder......
Title: Re: Forum index completely blank!
Post by: budiulik on March 06, 2019, 10:39:36 AM
In attachment the default board index template...  :(
Title: Re: Forum index completely blank!
Post by: drewactual on March 06, 2019, 10:54:00 AM
there is nothing out of place there, either. 

open your SSI.php, and see if this is present:

$hooks = array(
'integrate_pre_include' => '$sourcedir/Optimus/Class-Optimus.php',
'integrate_pre_load'    => 'Optimus::hooks'
);


if it is, comment it out and see what happens. 

i'm not certain Optimus is your issue. 
Title: Re: Forum index completely blank!
Post by: budiulik on March 06, 2019, 10:59:56 AM
I can't even find the $hooks array definition in SSI.php! Wtf? Is this OK?

Anyway there's one more test I could perform: trying to use the Remove all hooks function in repair_settings.php and see what happens.
Title: Re: Forum index completely blank!
Post by: drewactual on March 06, 2019, 11:05:05 AM
well, there you have it.

look for this:

'integrate_pre_include' => '$sourcedir/Optimus/Class-Optimus.php',
'integrate_pre_load'    => 'Optimus::hooks'


are they present?
Title: Re: Forum index completely blank!
Post by: Arantor on March 06, 2019, 11:11:47 AM
You know that hook definitions aren't in actual SMF files, right? They are loaded from plugin installs into the database...
Title: Re: Forum index completely blank!
Post by: budiulik on March 06, 2019, 11:14:18 AM
Quote from: drewactual on March 06, 2019, 11:05:05 AM
well, there you have it.

look for this:

'integrate_pre_include' => '$sourcedir/Optimus/Class-Optimus.php',
'integrate_pre_load'    => 'Optimus::hooks'


are they present?
no they aren't! I guess the hooks are messed up...

by the way the remove all hooks function did the charm!!! What now? I can see that the mods are still "installed", but are they working? What should I do now?

Quote from: Arantor on March 06, 2019, 11:11:47 AM
You know that hook definitions aren't in actual SMF files, right? They are loaded from plugin installs into the database...

No I didn't know that. I am not into SMF programming, I am just good to mess things up :-)

Is there a way to remove a single hook directly from the database (e.g. the Optimus hook) without using the "remove all hooks function" in repair_settings.php?
Title: Re: Forum index completely blank!
Post by: Arantor on March 06, 2019, 11:16:48 AM
Now some of your mods won't be working but you have no way of knowing what's broken. Guess it's time to uninstall and reinstall all your mods.

Also the comment about hooks was directed at the suggestion to go look in SMF core code for hook definitions, they won't be there, that's the point of hooks.
Title: Re: Forum index completely blank!
Post by: budiulik on March 06, 2019, 11:19:52 AM
Quote from: Arantor on March 06, 2019, 11:16:48 AM
Now some of your mods won't be working but you have no way of knowing what's broken. Guess it's time to uninstall and reinstall all your mods.

Also the comment about hooks was directed at the suggestion to go look in SMF core code for hook definitions, they won't be there, that's the point of hooks.

OK, thank you very much... I suspected that was some database issue from the beginning but I didn't know where to start looking from.

One last thing: if there's a way to selectively remove a hook, that would be the best solution! If not, I'm going to uninstall and install all of my mods again.
Title: Re: Forum index completely blank!
Post by: drewactual on March 06, 2019, 11:22:36 AM
i didn't know optimus used hooks until i looked at the package itself.   i was asking about templates before i knew that seeking to see if there was codes added to the templates by the mod.  the other question was about the SSI interjection, which if it's there and asking for files that no longer exist...........
Title: Re: Forum index completely blank!
Post by: Kindred on March 06, 2019, 11:32:35 AM
Optimus Brave does not add anything to SSI.php --   and no mod would ever add that hooks code into a file.  That hooks code is performed DURING THE INSTALLATION to add the hook...

and budiulik -- to be clear, this was not "a database problem" nor was it "corrupted data". This was a problem with a specific, badly uninstalled mod.
You are correct that it did involve an entry in the database... but there's a difference. :)
Title: Re: Forum index completely blank!
Post by: Arantor on March 06, 2019, 11:33:07 AM
@budiulik there isn't a way to selectively manage hooks until 2.1 but having hit the "remove all", SMF has no way to know what hooks should be there. They're not "on or off", they're "present or absent" if that makes sense.

@drewactual sure, I get that, but you were talking about looking in the SSI file for them, they wouldn't be there, they're entries that get added into the smf_settings table, which get looked up at the appropriate time to see what things are hanging off them.
Title: Re: Forum index completely blank!
Post by: budiulik on March 06, 2019, 11:36:58 AM
Quote from: Kindred on March 06, 2019, 11:32:35 AM
Optimus Brave does not add anything to SSI.php --   and no mod would ever add that hooks code into a file.  That hooks code is performed DURING THE INSTALLATION to add the hook...

and budiulik -- to be clear, this was not "a database problem" nor was it "corrupted data". This was a problem with a specific, badly uninstalled mod.
You are correct that it did involve an entry in the database... but there's a difference. :)

Maybe I was not able to make myself clear, but this situation is what I meant when I said "database problem". I didn't mean a connection problem or something specific to MySQL...

Anyway thanks everybody. I appreciated your support very much!
Title: Re: Forum index completely blank!
Post by: drewactual on March 06, 2019, 11:37:30 AM
.... and I just schooled myself on hooks... all this time i thought they were 'hooked' through SSI. 

a script can be written to remove the optimus hooks, if that is in fact the culprit, correct?  as far as others present i've no clue.  i just zeroed onto optimus because it was mentioned happening after the install/removal.
Title: Re: Forum index completely blank!
Post by: budiulik on March 06, 2019, 11:39:04 AM
Yes I suppose it is the culprit but I'm not sure, and if there's not a way of just removing the Optimus hooks I guess I'll never know
Title: Re: Forum index completely blank!
Post by: Arantor on March 06, 2019, 11:41:31 AM
If you haven't already used repair_settings to nuke everything (in which case, too late, they're all gone), it is possible to manually edit the values in the database to remove the offender, but if the remove all button has been pressed, there's no way around uninstalling and reinstalling all mods.
Title: Re: Forum index completely blank!
Post by: budiulik on March 06, 2019, 11:43:36 AM
I have a backup so I can still restore the situation before I pressed the nuke button :)

Title: Re: Forum index completely blank!
Post by: Illori on March 06, 2019, 11:46:04 AM
you have a database backup? that is what would need to be restored.
Title: Re: Forum index completely blank!
Post by: budiulik on March 06, 2019, 11:47:45 AM
Yes I have a full backup (files+dB) made from cpanel
Title: Re: Forum index completely blank!
Post by: budiulik on March 07, 2019, 04:07:26 AM
Quote from: Arantor on March 06, 2019, 11:41:31 AM
If you haven't already used repair_settings to nuke everything (in which case, too late, they're all gone), it is possible to manually edit the values in the database to remove the offender, but if the remove all button has been pressed, there's no way around uninstalling and reinstalling all mods.
I have a full backup, can you please tell me which table do I need to edit and how? Thanks in advance! :)
Title: Re: Forum index completely blank!
Post by: Arantor on March 07, 2019, 04:51:21 AM
First, restore the backup.

Then look through smf_settings for any entries that have the word "integration" in the name (the variable column). Post those entries here and I'll tell you which need changing and how.
Title: Re: Forum index completely blank!
Post by: budiulik on March 07, 2019, 09:22:44 AM
OK, I found the following entries with the word "integration" in the variable column:

sp_enableIntegration = 1
sp_adminIntegrationHide = 1

If I look for "integr*" I also get the following entries:

integrate_pre_include = "$sourcedir/Subs-Tapatalk.php,$sourcedir/Mentions.php,$sourcedir/Subs-Optimus.php,$sourcedir/PostHistory.php,$sourcedir/FooterMenu.php,$sourcedir/Subs-Add_Favicon.php,$sourcedir/Optimus/Class-Optimus.php"
integrate_admin_areas = "Tapatalk_add_admin_areas,optimus_admin_areas,footer_menu_admin_areas"
integrate_profile_areas = "mentions_profile_areas,reputation_profile"
integrate_load_permissions = "mentions_permissions,reputation_permissions,PH_load_permissions"
integrate_bbc_codes = "mentions_bbc"
integrate_menu_buttons = "mentions_menu,optimus_operations"
integrate_register = "mentions_register"
integrate_actions = "reputation_action,PH_actions"
integrate_admin_include = "$sourcedir/Admin-Optimus.php"
integrate_load_theme = "optimus_home,footer_menu_load_theme,Add_Favicon_META"
integrate_buffer = "optimus_buffer"
integrate_create_topic = "optimus_sitemap"
integrate_core_features = "PH_core_features"
integrate_pre_load = "Optimus::hooks"

I guess I'll have to remove the strings in red, and then uninstall/delete Optimus, right?




EDIT: I tried to do that and it worked! I suppose this solution is better than the "nuke" solution (The "remove all hooks" option from repair_settings.php)
Title: Re: Forum index completely blank!
Post by: Arantor on March 07, 2019, 09:41:25 AM
Yup, that's exactly what you needed to do :)
Title: Re: Forum index completely blank!
Post by: budiulik on March 08, 2019, 03:51:24 AM
Once again thank everyone very much for your support!

Problem solved  8)