Simple Machines Community Forum

SMF Support => SMF 2.1.x Support => Topic started by: philmc_webgeek on November 12, 2018, 05:02:05 PM

Title: Step 6 new installation failures
Post by: philmc_webgeek on November 12, 2018, 05:02:05 PM
Hi Folks,
Didn't see this particular problem posted anywhere on in the FAQ's.
Tried to do a fresh SMF 2.0.15 install on a server.  Install progressed fine until step 6 - setting up the admin account - and got the following error: "Data too long for column 'session_id' at row 1."
I looked at the DB and see the schema was created fine,  The smf_sessions table is empty.  The structure shows the sessio_id field with type and length of CHAR 25> I was thinking it is some issue with the session mechanism in PHP.  Went through the same steps on another server and got the same error at the same place.  Eyeballed PHP.ini and didn't see anything obvious. Can someone give me an idea of where to look next. Apache 2.4.28 PHP 5.5.38
Thanks
Phil Mc
Title: Re: Step 6 new installation failures
Post by: vbgamer45 on November 12, 2018, 05:03:36 PM
It's a common issue if you have IPV6 enabled in apache. If you do try to disable that. If not you crease the size of the session_id column in the database to 48 characters.
Title: Re: Step 6 new installation failures
Post by: philmc_webgeek on November 12, 2018, 05:28:02 PM
Thanks for the quick reply.  Started over.  Removed tables and put in a fresh settings.php file. After step 5 finished table creation, I bumped the session_id field length to 48.  Step 6 attempt again. No joy.  Tried 100 then 200.  No joy. Maybe something else obvious I am missing?
phil mc
Title: Re: Step 6 new installation failures
Post by: vbgamer45 on November 12, 2018, 05:32:52 PM
Strange. If not disable database sessions on install
If the smf_settings table set databaseSession_enable = 0
Title: Re: Step 6 new installation failures
Post by: philmc_webgeek on November 12, 2018, 05:50:07 PM
Great.  That was some progress.  Install completed.  Did say the user had previously been created, so I guess that table was written to previously, but not the session table.  OK, so I backed out and logged in to test.  Worked fine except an error displayed:

Data too long for column 'session' at row 1
File: /Library/Server/Web/Data/Sites/Default/forum/Sources/Subs.php
Line: 2692

No data written to session table.

phil mc
Title: Re: Step 6 new installation failures
Post by: vbgamer45 on November 12, 2018, 05:57:58 PM
Try in the the smf_settings table set databaseSession_enable = 0
Title: Re: Step 6 new installation failures
Post by: philmc_webgeek on November 12, 2018, 06:18:41 PM
Hi,
I did make that edit earlier - smf_settings table set databaseSession_enable = 0.  That got me through the install process.  Apparently there is a loose end that still throws an error I mentioned above.   Have been working on killing IPv6 on that server to ultimately get sessions back playing in the database.  One interface is very pesky.
phil mc
Title: Re: Step 6 new installation failures
Post by: vbgamer45 on November 12, 2018, 06:49:26 PM
Two more tables to make bigger smf_log_online and smf_log_errors
Title: Re: Step 6 new installation failures
Post by: philmc_webgeek on November 12, 2018, 07:07:00 PM
session field, IP field?  I did just succeed in killing IPv6 on the 5 interfaces on that box.  I just tried -- smf_settings table set databaseSession_enable = 1  but no joy.  Set back to 0 but SMF is squirrelly.  I can't make a post process. Keep seeing that error message :
Data too long for column 'session' at row 1
File: /Library/Server/Web/Data/Sites/Default/forum/Sources/Subs.php
Line: 2692

I am guessing there is a lot of dependency on that session log entry....
Title: Re: Step 6 new installation failures
Post by: vbgamer45 on November 12, 2018, 07:20:28 PM
Maybe reclose the browser and back in again. Yeah the session column in those database tables.
Title: Re: Step 6 new installation failures
Post by: philmc_webgeek on November 12, 2018, 07:46:00 PM
OK, I doubled the session field value in both of those tables from 32 to 64.  Flushed history and caches in the browser and restarted it.
Getting the same error after logging in:
Data too long for column 'session' at row 1
File: /Library/Server/Web/Data/Sites/Default/forum/Sources/Subs.php
Line: 2692

still have smf_settings table set databaseSession_enable = 0

If it's any help, you can look at the test forum here: http://redwood.powersrvcs.net/forum/

All the network interfaces on that server have IPv6 disabled....


Title: Re: Step 6 new installation failures
Post by: vbgamer45 on November 12, 2018, 08:17:33 PM
Hmm i would sources/subs.php
Find
Code: [Select]
$smcFunc['db_insert']($do_delete ? 'ignore' : 'replace',
'{db_prefix}log_online',
array('session' => 'string', 'id_member' => 'int', 'id_spider' => 'int', 'log_time' => 'int', 'ip' => 'raw', 'url' => 'string'),
array($session_id, $user_info['id'], empty($_SESSION['id_robot']) ? 0 : $_SESSION['id_robot'], time(), 'IFNULL(INET_ATON(\'' . $user_info['ip'] . '\'), 0)', $serialized),
array('session')
);

Add before
Code: [Select]
echo $session_id;

I just want to see how big it is.
Title: Re: Step 6 new installation failures
Post by: philmc_webgeek on November 12, 2018, 10:21:06 PM
I found that code section at line 2687 in sources/subs.php, but didn't find a [select] statement.  Your code tweak is not clear to me.  I'm not a PHP coder. If you can do an "as found" and "as left" example, I can give it a try.

I'm troubled that a fresh SMF install has failed on two different servers. One of the servers has been running other PHP apps for a while.
Title: Re: Step 6 new installation failures
Post by: philmc_webgeek on November 12, 2018, 10:35:45 PM
OK, I made a try at it.  Don't see that data displayed??

if ($do_delete || !empty($user_info['id']))
         $smcFunc['db_query']('', '
            DELETE FROM {db_prefix}log_online
            WHERE ' . ($do_delete ? 'log_time < {int:log_time}' : '') . ($do_delete && !empty($user_info['id']) ? ' OR ' : '') . (empty($user_info['id']) ? '' : 'id_member = {int:current_member}'),
            array(
               'current_member' => $user_info['id'],
               'log_time' => time() - $modSettings['lastActive'] * 60,
            )
         );
      echo $session_id;
      
      $smcFunc['db_insert']($do_delete ? 'ignore' : 'replace',
         '{db_prefix}log_online',
         array('session' => 'string', 'id_member' => 'int', 'id_spider' => 'int', 'log_time' => 'int', 'ip' => 'raw', 'url' => 'string'),
         array($session_id, $user_info['id'], empty($_SESSION['id_robot']) ? 0 : $_SESSION['id_robot'], time(), 'IFNULL(INET_ATON(\'' . $user_info['ip'] . '\'), 0)', $serialized),
         array('session')
Title: Re: Step 6 new installation failures
Post by: vbgamer45 on November 12, 2018, 10:37:55 PM
Yeah that is strange. I know SMF has trouble with IPV6 SMF 2.0.x in SMF 2.1 that will be fixed.
Title: Re: Step 6 new installation failures
Post by: philmc_webgeek on November 13, 2018, 07:24:50 AM
Well, in total I have made three separate efforts to get 2.0.15 working two separate newer servers.  Migrated a running forum, then two fresh installs. Epic fail.  I'm open to other suggestions.
In the meantime, I'll try an install of the beta version.
Title: Re: Step 6 new installation failures
Post by: philmc_webgeek on November 14, 2018, 06:04:10 PM
So I installed 2.1 beta 3.  Installation looked OK and progressed to the end.  Used the link at the bottom of the completion page to see the forum - then tried to logout.  Got this error

Session verification failed. Please try logging out and back in again, and then try again.
so a good catch-22 :)

so it looks like there are still issues with session variables.  I checked the session table and see the session_id value is now VARCHAR with length of 128.  There is a record in the session table - this is the session string:
141cjnvjif11olhrhpcgnemq1eanhfvhsnrls1aundcog0ss861gdpbf0ke5ickj6e4mrb3su8c5qafloil3kk1g24vp6atgr3sdc90

looks like a length of 103

looks like the same type and length for session_id in the other two log tables mentioned previously. 
I suppose I should post this over in the beta forum and see if anyone will chime in?

Title: Re: Step 6 new installation failures
Post by: vbgamer45 on November 14, 2018, 06:11:31 PM
For 2.1 I would suggest grabbing the latest version from github at this point https://github.com/SimpleMachines/SMF2.1
Title: Session verification failed after fresh install of Beta 3
Post by: philmc_webgeek on November 14, 2018, 06:28:17 PM
Doing a fresh install of SMF 2.1 beta 3 since I was having problems with 2.0.15 fresh installs on two different servers.  It looked like session related problems with 2.0.15.  Think I am seeing the same thing with beta 3.

Installation of 2.1 beta 3 progressed through the end fine.  Used the link at the bottom of the completion page to view the new forum.  Went to logout and got this error:

Session verification failed. Please try logging out and back in again, and then try again.

a good catch-22 :)

I see 2.1 beta 3 has the session_id field as VARCHAR with a length of 128.  I checked the value of the single record is the sessions table.  The session_id string counted at 103 characters long.

Anyone have a clue what the problem is?

Title: Re: Step 6 new installation failures
Post by: philmc_webgeek on November 14, 2018, 06:36:14 PM
Thank you.  Took a look.  Not sure of how to get all the current pieces vs just what I have for Beta 3.  I did post my problem description on the 2.1 support board.
Title: Re: Session verification failed after fresh install of Beta 3
Post by: Illori on November 14, 2018, 07:05:22 PM
take a look at https://www.simplemachines.org/community/index.php?topic=530252.msg3816577#msg3816577 and install from github and report if it works or not.
Title: Re: Step 6 new installation failures
Post by: philmc_webgeek on November 18, 2018, 12:06:15 PM
Thanks for the link to beta 4.  Followed the instructions in the post.  Install proceeded without errors.  Database structure looks like it was all created fine. members table shows my admin user was created. The test forum is at http://scratch.serara.org/forum/index.php.

I was unable to login to the admin account that was created with the install.  Error was:
Session verification failed. Please try logging out and back in again, and then try again.

This is the same error as previous installs.  Quit browser and connected again to try a fresh session. Same error. I looked as the sessions table.  Do see one entry.  Session_id field contained this value:
il78sf1q2b315ucdlvu899qjvt3dqeg43ogeebsi6diftet0l0tq4qtgeo37a9nuntq7d5fomkgtn7l68i4jstd33p28t4smol0aae1

Open for suggestions...
Title: Re: Step 6 new installation failures
Post by: vbgamer45 on November 18, 2018, 12:09:22 PM
I would try disabling database driven sessions and see if that helps mentioned on previous page a database setting to try.
Title: Re: Step 6 new installation failures
Post by: shawnb61 on November 18, 2018, 02:41:46 PM
I'd also try clearing the cookies for that site.
Title: Re: Step 6 new installation failures
Post by: philmc_webgeek on November 19, 2018, 10:25:27 AM
Thanks for the replies.
Cleared cookies and history, no joy.
Made the edit to the smf_settings table:set databaseSession_enable = 0
Was able to login.  Test Post worked.  Logged and and in again, worked.  So it would appear there has been a fix since beta3.  I presume more work is needed to fix this database table session issue...
I will do some testing of the upgrade process on a copy of an existing forum to beta 4 shortly.
Title: Re: Step 6 new installation failures
Post by: albertlast on November 19, 2018, 10:55:27 AM
Since ther is no one how report the issue and analyze it,
the issue will be never solved.
Title: Re: Step 6 new installation failures
Post by: shawnb61 on November 19, 2018, 12:29:20 PM
Beta 3 is quite old, unfortunately,  with lots of fixes since.

I would focus all testing on the current gh version.
Title: Re: Step 6 new installation failures
Post by: philmc_webgeek on November 21, 2018, 12:56:12 PM
I should point out that my last round of testing was beta 4.  If there is a way to get more current builds from github, I would need a pointer to that process. I'll report on the beta4 upgrade process shortly. Thanks.
Title: Re: Step 6 new installation failures
Post by: Kindred on November 21, 2018, 01:01:45 PM
the code from github is currently marked "beta 4" even though there will never be an actual beta4 release...
Title: Re: Step 6 new installation failures
Post by: lurkalot on November 21, 2018, 01:15:14 PM
I should point out that my last round of testing was beta 4.  If there is a way to get more current builds from github, I would need a pointer to that process. I'll report on the beta4 upgrade process shortly. Thanks.

This might help, https://www.simplemachines.org/community/index.php?topic=558451.0