Simple Machines Community Forum

SMF Support => SMF 2.0.x Support => Topic started by: CurtisS on November 27, 2017, 11:51:35 AM

Title: HELP - 2.0.13 to 2.0.14 upgrade failure
Post by: CurtisS on November 27, 2017, 11:51:35 AM
Hello,
I hate to tag onto an existing thread but my issue is similar to the OP's after updating through Package Manager from 2.0.13 to 2.0.14. I updated to PHP 5.6 but now I see a error 500 server error. I am unable to get past this and I am not a PHP expert but could certainly use any suggestions. I have searched the forums for similar problems but none of that information helped.
Thanks.
CurtisS

[edit]topic split. - Illori
Title: Re: HELP - 2.0.13 to 2.0.14 upgrade failure
Post by: CurtisS on November 27, 2017, 11:59:01 AM
Apologies for tagging onto another thread and thanks for splitting it.
The original error after the update was:
Fatal error: Function name must be a string in /forum/Sources/Load.php on line 142

After updating PHP from 5.3 to 5.6 I now see only a 500 server error.
Thanks.
CurtisS
Title: Re: HELP - 2.0.13 to 2.0.14 upgrade failure
Post by: drewactual on November 27, 2017, 12:14:22 PM
there was another recent thread where a user had some whacked compression/decompression take place... basically, one of the files removed white space where there was white space required. 

there should always be a space after 'php' in the opening line.  anytime a single line comment '//' is made there has to be a line break when code restarts.  in his case, it crammed a part of a commented out line into to next making a term that doesn't exist in PHP- hence, it wasn't parsed...

it may be of interest to peek at load.php and see if something like this occurred with your attempted update as well.

on another note, i may be wrong and i hope someone will set me straight if i am- but 5.6 isn't the issue- jumping yo 7.x is the issue with versions prior to .14 if i'm not mistaken.  they're part of the same php package via apache, but they have differences that matter. 
Title: Re: HELP - 2.0.13 to 2.0.14 upgrade failure
Post by: Shambles on November 27, 2017, 12:22:00 PM
Are you hosted by Godaddy?
Title: Re: HELP - 2.0.13 to 2.0.14 upgrade failure
Post by: CurtisS on November 27, 2017, 12:35:59 PM
The hosting is through GoDaddy. Using a suggestion in another thread I renamed the "Sources/Subs-Db-mysql.php~" by removing the ~ and I also renamed the "Sources/Subs-Db-mysql.php" to "Sources/Subs-Db-mysql-old.php" (just in case). This brought the forum back but now when trying to log into Admin functions I see:
"Session verification failed. Please try logging out and back in again, and then try again."

So I still have some work to do. Any thoughts?

Many thanks!
Title: Re: HELP - 2.0.13 to 2.0.14 upgrade failure
Post by: drewactual on November 27, 2017, 12:38:49 PM
you need to add a sessions check to your index.template for that theme...

find:
<input type="hidden" name="hash_passwrd" value="" />

replace with:
<input type="hidden" name="hash_passwrd" value="" />
<input type="hidden" name="', $context['session_var'], '" value="', $context['session_id'], '" />

Title: Re: HELP - 2.0.13 to 2.0.14 upgrade failure
Post by: CurtisS on November 27, 2017, 01:31:29 PM
Wow. This one is being difficult. I modified the "index.template.php" and the "login.template.php" with the Form fix to no avail. I can log-in using the Home login but when I try to access Admin functions I get a login dialog and this is where I see the Session error. I will see the Session error when I try to log out as well. Perhaps I have a strange mix of 2.0.13 and 2.0.14 files since I had problems trying to update to 2.0.14.
Thanks.
Title: Re: HELP - 2.0.13 to 2.0.14 upgrade failure
Post by: drewactual on November 27, 2017, 01:35:39 PM
may need to send an SOS to Sir Osis, and i've never seen or heard of this.. but... check your admin.template for that form fix too?
Title: Re: HELP - 2.0.13 to 2.0.14 upgrade failure
Post by: CurtisS on November 27, 2017, 01:47:15 PM
The "admin.template.php" file was not updated with 2.0.14. There are quite a few <form> tags in this file. Do I need to add the code to each form? I am not actually sure the the 2.0.14 is being used and I cannot find a way to see the version since I cannot login to Admin functions.
Title: Re: HELP - 2.0.13 to 2.0.14 upgrade failure
Post by: drewactual on November 27, 2017, 01:53:14 PM
just find and replace as mentioned above and see if it remedies the situation... it's a hack, but one that may get you going again.... if it doesn't work, no harm no foul, just replace with the original code... if it does work, then good- but like a fuse, it didn't get wonky on it's own... we'll need to figure out why..

Title: Re: HELP - 2.0.13 to 2.0.14 upgrade failure
Post by: CurtisS on November 27, 2017, 03:48:56 PM
None of these suggestions have helped. I have been searching through the forums for enlightenment but am pretty running into the ideas. Is there a way to switch themes outside of the Admin functions?
Title: Re: HELP - 2.0.13 to 2.0.14 upgrade failure
Post by: Illori on November 27, 2017, 03:54:17 PM
Quote from: CurtisS on November 27, 2017, 12:35:59 PM
The hosting is through GoDaddy. Using a suggestion in another thread I renamed the "Sources/Subs-Db-mysql.php~" by removing the ~ and I also renamed the "Sources/Subs-Db-mysql.php" to "Sources/Subs-Db-mysql-old.php" (just in case). This brought the forum back but now when trying to log into Admin functions I see:
"Session verification failed. Please try logging out and back in again, and then try again."

So I still have some work to do. Any thoughts?

Many thanks!
by doing this you are now mixing file versions and you have lost the support for mysqli that was added to SMF 2.0.14. you need to put the files back as they were. you should be checking the server error log to get the cause of the error and looking to fix that.
Title: Re: HELP - 2.0.13 to 2.0.14 upgrade failure
Post by: CurtisS on November 27, 2017, 04:08:46 PM
I would check the server error log but I cannot log into the Admin functions. Switching back to the original "Sub-Db-mysql.php" file results in a server error 500 but I will take a closer look at it.
Thanks for responding.
CurtisS
Title: Re: HELP - 2.0.13 to 2.0.14 upgrade failure
Post by: Illori on November 27, 2017, 04:11:30 PM
the server error log is on the server not within SMF.
Title: Re: HELP - 2.0.13 to 2.0.14 upgrade failure
Post by: CurtisS on November 27, 2017, 04:30:22 PM
Quote from: Illori on November 27, 2017, 04:11:30 PM
the server error log is on the server not within SMF.
Right. Looks like I will need to wait a day to see the logs from today. This all started with a failed update this morning.
Thanks.
Title: Re: HELP - 2.0.13 to 2.0.14 upgrade failure
Post by: Sir Osis of Liver on November 27, 2017, 09:55:30 PM
GoDaddy does bad things to some Source files, but shouldn't have affected your forum if you patched 2.0.13 -> 2.0.14 using package manager.  Upgrade failed initially because 2.0.14 will not run in php 5.3.  If you renamed .php~ files to .php, you've reverted those files to 2.0.13, so, as Illori pointed out, you have a mix of .13 and .14 files.

Look in /Packages/backups, you should find a package manager backup from before 2.0.14 install.  Download, unzip, upload to forum root.  It should restort your forum to 2.0.13.  Once you have it up and running, you should be able to patch to .14 successfully. 
Title: Re: HELP - 2.0.13 to 2.0.14 upgrade failure
Post by: CurtisS on November 28, 2017, 10:11:42 AM
Thanks for the response Sir Osis.
I did go to the backup created when the 2.0.13 to 2.0.14 update was run and uploaded those files to forum. The login/logout (Session verification failed. Please try logging out and back in again, and then try again) issues remain. I must have missed something as you think overwriting all of the files would have done the trick.
Title: Re: HELP - 2.0.13 to 2.0.14 upgrade failure
Post by: Sir Osis of Liver on November 28, 2017, 02:55:44 PM
Are you having the login problem in Curve or a custom theme?  If it's a custom theme, you need to do this -

Quote from: drewactual on November 27, 2017, 12:38:49 PM
you need to add a sessions check to your index.template for that theme...

find:
<input type="hidden" name="hash_passwrd" value="" />

replace with:
<input type="hidden" name="hash_passwrd" value="" />
<input type="hidden" name="', $context['session_var'], '" value="', $context['session_id'], '" />



Title: Re: HELP - 2.0.13 to 2.0.14 upgrade failure
Post by: CurtisS on November 28, 2017, 03:13:20 PM
I have tried to revert back to 2.0.13. This code does not exist in my themes index.template file but is was working before.
I did mention earlier that I am able to login on the initial index page so I can view my profile, etc. However, I cannot logout, post, or access Admin functions (it asks for password once again and I get a session error).
Title: Re: HELP - 2.0.13 to 2.0.14 upgrade failure
Post by: Sir Osis of Liver on November 28, 2017, 03:30:29 PM
The session check (second line of code) was added in 2.0.14.  If you uploaded the package backup via FTP to a GoDaddy account, some of the /Sources files may have been deleted.  Try uploading the backup with cpanel file manager.
Title: Re: HELP - 2.0.13 to 2.0.14 upgrade failure
Post by: CurtisS on November 28, 2017, 04:34:20 PM
Quote from: Sir Osis of Liver on November 28, 2017, 03:30:29 PM
The session check (second line of code) was added in 2.0.14.  If you uploaded the package backup via FTP to a GoDaddy account, some of the /Sources files may have been deleted.  Try uploading the backup with cpanel file manager.
I appreciate your patience but unfortunately that didn't work either (and GoDaddy's File Manager is awful). I am ready for a wholesale scrapping of the forum and starting over. Could this be an issue with the SQL database? I am missing something (obviously)!
Title: Re: HELP - 2.0.13 to 2.0.14 upgrade failure
Post by: Sir Osis of Liver on November 28, 2017, 04:36:08 PM
If you can pm cpanel access and link to your forum, I'll have a look.
Title: Re: HELP - 2.0.13 to 2.0.14 upgrade failure
Post by: CurtisS on November 28, 2017, 05:31:50 PM
The best I can do is FTP access. If you care to take a look I can setup a temp account and PM you.
Title: Re: HELP - 2.0.13 to 2.0.14 upgrade failure
Post by: Sir Osis of Liver on November 28, 2017, 05:44:18 PM
Anything that involves uploading /Sources files (restoring package backup, uploading clean set of files) via ftp will likely fail, so there's not much I can safely do without access to cpanel file manager.  GoDaddy has a strange security setup on some of its servers that deletes anywhere up to a dozen source files immediately after they upload, which breaks the forum.  Their file manager is a pia, but it usually does work, and only the /Sources directory needs to be uploaded.  IIRC, it sometimes won't do it in one go, you have to upload the files in smaller batches.

If you can give me admin access (link/username/password), and ftp access (server/user/password), I'll have a look.
Title: Re: HELP - 2.0.13 to 2.0.14 upgrade failure
Post by: CurtisS on November 29, 2017, 10:17:25 AM
Quote from: Sir Osis of Liver on November 28, 2017, 05:44:18 PM
Anything that involves uploading /Sources files (restoring package backup, uploading clean set of files) via ftp will likely fail, so there's not much I can safely do without access to cpanel file manager.  GoDaddy has a strange security setup on some of its servers that deletes anywhere up to a dozen source files immediately after they upload, which breaks the forum.  Their file manager is a pia, but it usually does work, and only the /Sources directory needs to be uploaded.  IIRC, it sometimes won't do it in one go, you have to upload the files in smaller batches.

If you can give me admin access (link/username/password), and ftp access (server/user/password), I'll have a look.

Sent you a PM. I am really glad there are people like you that are willing to help out!
Cheers!
CurtisS
Title: Re: HELP - 2.0.13 to 2.0.14 upgrade failure
Post by: Sir Osis of Liver on November 29, 2017, 11:51:46 AM
Will get to it soon as I can, probably not til tonight.
Title: Re: HELP - 2.0.13 to 2.0.14 upgrade failure
Post by: Sir Osis of Liver on November 29, 2017, 11:36:05 PM
Ok, spent some time kicking around your forum, it's broken, but looks like it may be a host problem. 

Several odd items:

- You're not running php 5.6, you're in 5.4.16.  SMF 2.0.14 should be ok with that.
- Settings_bak.php was incorrectly named Settings-bak.php.
- The 2.0.14 file /Sources/Class-CurlFetchWeb.php was in /Packages/Sources/Class-CurlFetchWeb.php (there is no such directory).
- repair_settings.php is being blocked, 500 error.

I restored the forum to 2.0.13 and 2.0.12 using package backups, no help.  Tried uploading clean 2.0.13 and 2.0.14 files, no go.  Cannot login in Reseller theme in any version.  If I fudge the theme directories and get Curve running, I can login as admin, but second admin login fails, as does logout, both with session timeout errors.

Can't see what's installed above forum, are you running any security or an .htaccess script?  Do you know if GoDaddy has mod_security enabled?  I've restored forum to where it was when I started (2.0.13) from backup.

Title: Re: HELP - 2.0.13 to 2.0.14 upgrade failure
Post by: CurtisS on November 30, 2017, 09:31:08 AM
Hi Sir Osis,
I really appreciate you taking the time to take a look.
I have tried using PHP 5.6 and that had no effect. I had put it back to 5.4 in the process of troubleshooting.
This is a Windows server so I wonder if there is something weird at that level. This is all very odd since the forum was working fine up until the attempted update.
My next step may be to create a new forum using the GoDaddy interface that installs Simple Machine 2.0.6 (I believe) then try to migrate the database backup into the new forum (not sure if that is possible).
I do have an older backup that I may use. Will it hurt to just plain delete the Forum files and upload from the older backup?
Again, thanks so much for your help!
Title: Re: HELP - 2.0.13 to 2.0.14 upgrade failure
Post by: Sir Osis of Liver on November 30, 2017, 04:20:16 PM
php 5.6 is the earliest version that's still supported, 5.4 went eol over two years ago.  SMF runs fine in 5.6, that's not your problem.  If your first upgrade attempt caused the problem, restoring the package backup should fix it, it doesn't.  All of the /Sources files are uploading correctly.  GoDaddy can move you to a linux server, but that's a risky proposition, they often screw up server moves, and it would just complicate things.  Deleting the forum and re-installing with GoDaddy's installer is not a good idea, host installers are notoriously bad, and it's not going to help here.

I tried doing a clean test install in a subdirectory, but must be able to run repair_settings to get it working, and it's being blocked.  If you can give me access one level higher, I can do a clean install without needing repair_settings, and won't have to touch your production install.
Title: Re: HELP - 2.0.13 to 2.0.14 upgrade failure
Post by: CurtisS on November 30, 2017, 05:45:09 PM
I tried uploading an older backup to a new folder at the same level as the current folder. I modified the paths in the Settings file so they were correct. The result was the same, session errors when trying the second Admin login or logout. Is this approach similar to what you are talking about doing? Management would have to approve giving higher level access.
Seeing as this could be a hosting issue, I am going contact GoDaddy tech support for suggestions.
Thanks.
Title: Re: HELP - 2.0.13 to 2.0.14 upgrade failure
Post by: Sir Osis of Liver on November 30, 2017, 05:56:50 PM
The way I would do it is rename the /forum directory to /forum_sav, upload the 2.0.14 upgrade package to a new /forum directory, copy Settings.php from old to new install.  It's not necessary to run repair_settings (which you can't do), paths look the same to SMF.  If the new install doesn't work, then the problem is either in database (don't think so) or server configuration.  Try that first, GoDaddy support is always the last resort. :P


Just had it working for a minute in Curve by flipping theme directories, which didn't work when I tried it yesterday.  Can't repeat it.  Just for the halibut, go into your database in _settings table change theme_default to 1.  Clear your browser, or use a different one, see what happens.

Will be offline until tomorrow.

Title: Re: HELP - 2.0.13 to 2.0.14 upgrade failure
Post by: Sir Osis of Liver on November 30, 2017, 07:06:14 PM
Just connected a test install on my server to your database, a bit scrambled (didn't run repair_settings because can't set it back on your end), but had enough to try login.  Same problem, so it may be something in the database, or your database server.  While you're in there changing theme_default, empty _sessions table.

Can't really do much more without cpanel access.  Will check in again tomorrow afternoon.

Title: Re: HELP - 2.0.13 to 2.0.14 upgrade failure
Post by: Sir Osis of Liver on December 01, 2017, 12:51:32 PM
I have your forum running on my server, it works fine, and have access to forum error log.  This appears to be the problem -



2: Unknown: open(D:\Temp\php\session\\sess_1adu7pe7c9ask64qmh2fm3fgp4, O_RDWR) failed: No such file or directory (2)

2: Unknown: Failed to write session data (files). Please verify that the current setting of session.save_path is correct (D:\Temp\php\session\)



There are several variations of this error, but all are due to same unknown directory.  That's a server error, no idea why 2.0.14 uograde triggered it.  Forum is running normally on my server in 2.0.13, so your database is ok.  Changed your theme to Curve and disabled admin login, you should be able to login and access ACP on your install.  You'll still get the session error if you try to logout.

Have you asked GoDaddy if they're running mod_security?  If so, ask them to disable it.  It's a cpanel option on some hosts, but don't believe you'll see it in GD cpanel.

Going offline, be back on tonight.

Title: Re: HELP - 2.0.13 to 2.0.14 upgrade failure
Post by: CurtisS on December 04, 2017, 09:58:06 AM
Wow, Sir Osis! I come back from the weekend and find this. Thanks so much for getting this far!
I spent over an hour last Friday on hold for GoDaddy support and finally hung up. I will try them again.
I appreciate all your efforts!
CurtisS
Title: Re: HELP - 2.0.13 to 2.0.14 upgrade failure
Post by: CurtisS on December 04, 2017, 03:53:42 PM
I got tired of trying to get GoDaddy Support (2 hours on hold then got disconnected!!). Found a hack online to modify the Load.php to use a local path for the sessions path and it worked!!! Yeah! I could login, logout, post, look at all of the Admin functions...
Then.... I decided to try and change the theme back to Reseller using the normal Admin access (changing the Themes paths) and now well, I should leave well enough alone. I now see:
Unable to load Themes/default/Errors.template.php!

The errors.template.php file does exist but something else changed when I saved the Theme changes. What changes did you make to get it to Curves that I probably messed up? I know now through some research that I should have used the Theme Manager. My bad...
Sorry for the hassle.
CurtisS
Title: Re: HELP - 2.0.13 to 2.0.14 upgrade failure
Post by: CurtisS on December 04, 2017, 06:23:52 PM
Well, in desperation I restored the database through the GoDaddy CPanel and now the Forum seems to be working. I am still checking everything and will do a BACKUP ASAP!

Many thanks to all who helped me but especially Sir Osis of Liver (love the name by the way) who really went out of his way!

If there is any positive spin it would be that I learned a lot about how a Simple Machines forum works.
Cheers!
CurtisS
Title: Re: HELP - 2.0.13 to 2.0.14 upgrade failure
Post by: Sir Osis of Liver on December 04, 2017, 09:19:32 PM
Can you post the hack you did to Load.php?  Only changes I made were to switch default theme to Curve and disabled admin login.  Working normally now, can login/logout no problem.  Still can't run repair_settings.  Something's not right with your GD setup, you really should consider moving to a better host.

Title: Re: HELP - 2.0.13 to 2.0.14 upgrade failure
Post by: CurtisS on December 05, 2017, 08:58:20 AM
The hack I used was posted here:

http://www.17educations.com/general/failed-write-session-data-files/ (http://www.17educations.com/general/failed-write-session-data-files/)

Of course their first suggestion is to get GoDaddy to fix the path but my patience with them was drained yesterday. I will try them when I have a better chance of getting through. I would love to move our hosting but we also have e-commerce and several domains through them.

Thanks again for your help.
Cheers.
CurtisS
Title: Re: HELP - 2.0.13 to 2.0.14 upgrade failure
Post by: Sir Osis of Liver on December 05, 2017, 04:02:37 PM
Be a good idea to set permissions for temp folder to 755.  GoDaddy is constantly tinkering with their security setup, and some servers block 777 for security reasons, so problem may recur.