Simple Machines Community Forum

SMF Support => SMF 2.1.x Support => Topic started by: Gilrod on May 23, 2019, 07:05:21 AM

Title: Large board upgrade error - "Data truncated for column 'poster_ip_old'"
Post by: Gilrod on May 23, 2019, 07:05:21 AM
So, uploaded RC2 last night to do the upgrade, got this error...

"Data truncated for column 'poster_ip_old' at row"

Ummm... now the upgrade won't continue, what can I do?

Cheers

Stew
Title: Re: Large board upgrade error - "Data truncated for column 'poster_ip_old'"
Post by: Gilrod on May 23, 2019, 08:12:04 AM
Forgot to say, it was during this stage...

Executing database changes
Please be patient - this may take some time on large forums. The time elapsed increments from the server to show progress is being made!
Executing: "Update messages poster_ip with ipv6 support (May take a while)" (47 of 65)
Title: Re: Large board upgrade error - "Data truncated for column 'poster_ip_old'"
Post by: Gilrod on May 23, 2019, 09:08:10 AM
I did a full restore, ran database cleanup and re-did it, dies in the same place again...

Title: Re: Large board upgrade error - "Data truncated for column 'poster_ip_old'"
Post by: albertlast on May 23, 2019, 12:25:23 PM
From which version you came?
Which mysql version you use?
Which datatype got the colum poster_ip of you messages table?
Title: Re: Large board upgrade error - "Data truncated for column 'poster_ip_old'"
Post by: Gilrod on May 23, 2019, 12:48:15 PM
coming from 2.0.15

Database:
Server: Localhost via UNIX socket
Server type: MariaDB
Server connection: SSL is not being used Documentation
Server version: 10.2.23-MariaDB-log-cll-lve - MariaDB Server
Protocol version: 10
User: cpses_tnfqpdi3zj@localhost
Server charset: UTF-8 Unicode (utf8)

Datatype, what do you mean?


Title: Re: Large board upgrade error - "Data truncated for column 'poster_ip_old'"
Post by: albertlast on May 23, 2019, 12:52:27 PM
In the database table smf_message you find poster_ip column,
which datatype it got (use phpmyadmin).
Title: Re: Large board upgrade error - "Data truncated for column 'poster_ip_old'"
Post by: Gilrod on May 23, 2019, 12:54:27 PM
Does this help?

Title: Re: Large board upgrade error - "Data truncated for column 'poster_ip_old'"
Post by: albertlast on May 23, 2019, 01:10:02 PM
Change your upgrade_2-1_mysql.sql in this way:
replace

upgrade_query("ALTER TABLE {$db_prefix}messages CHANGE poster_ip poster_ip_old varchar(200);");


with

upgrade_query("ALTER TABLE {$db_prefix}messages CHANGE poster_ip poster_ip_old varchar(255);");


related pr https://github.com/SimpleMachines/SMF2.1/pull/5678/files
Title: Re: Large board upgrade error - "Data truncated for column 'poster_ip_old'"
Post by: Sesquipedalian on May 23, 2019, 10:53:40 PM
PR has been merged.
Title: Re: Large board upgrade error - "Data truncated for column 'poster_ip_old'"
Post by: Gilrod on May 24, 2019, 06:59:32 AM
Hi,
I've done the change this morning, but it's STILL doing the same issue... I have confirmed that I did indeed upload the modified sql file.

Stewart
Title: Re: Large board upgrade error - "Data truncated for column 'poster_ip_old'"
Post by: albertlast on May 24, 2019, 09:11:50 AM
well it make no sense that the error keep the same,
when you apply the correction correctly.
Title: Re: Large board upgrade error - "Data truncated for column 'poster_ip_old'"
Post by: m4z on May 24, 2019, 09:31:10 AM
Be sure to actually (re)load the modified file in your browser, not from history/cache etc.
Title: Re: Large board upgrade error - "Data truncated for column 'poster_ip_old'"
Post by: Gilrod on May 24, 2019, 09:34:21 AM
Quote from: m4z on May 24, 2019, 09:31:10 AM
Be sure to actually (re)load the modified file in your browser, not from history/cache etc.

well I'm doing a full restore of the site, then re-uploading ALL the upgrade files for 2.1 RC2, then just running the upgrade script, so not sure how it wouldn't be there...

Title: Re: Large board upgrade error - "Data truncated for column 'poster_ip_old'"
Post by: albertlast on May 24, 2019, 09:51:46 AM
Could it be that another table is mention?
Please post the error message again please.
Title: Re: Large board upgrade error - "Data truncated for column 'poster_ip_old'"
Post by: Gilrod on May 24, 2019, 09:58:13 AM
Rename old ip column on messages...done
Error!
Data truncated for column 'poster_ip_old' at row 169964
Title: Re: Large board upgrade error - "Data truncated for column 'poster_ip_old'"
Post by: Arantor on May 24, 2019, 11:22:22 AM
So what's in that row, from the database before upgrade?
Title: Re: Large board upgrade error - "Data truncated for column 'poster_ip_old'"
Post by: Gilrod on May 24, 2019, 07:00:34 PM
Sorry for the delay, work etc...

Looking at that row it looks fine... even the rows around it look fine?!?

169964
5369
9
1077129984
126
0
Re: UPDATED: Rush 2004 "PARTIAL" Date Li
The_Letter_R
k********@m*******.com
62.8.125.182
0
0
[quote]It's obviously EuCon '04 you daft ninny's
xx
1
Title: Re: Large board upgrade error - "Data truncated for column 'poster_ip_old'"
Post by: albertlast on May 25, 2019, 02:47:08 AM
give us the response of this sql code
select max(length(poster_ip)) from smf_messages
Title: Re: Large board upgrade error - "Data truncated for column 'poster_ip_old'"
Post by: Gilrod on May 25, 2019, 03:24:16 AM
Providing I've done it correctly...

217
Title: Re: Large board upgrade error - "Data truncated for column 'poster_ip_old'"
Post by: Arantor on May 25, 2019, 03:40:06 AM
Then: SELECT * FROM smf_messages WHERE LENGTH(poster_ip) = 217
Title: Re: Large board upgrade error - "Data truncated for column 'poster_ip_old'"
Post by: Gilrod on May 25, 2019, 03:45:35 AM
Not the same ID...

176217   5525   9   1105461436   4   0   Newcastle Meet - 15 &amp; 16 April   Ashley_Davidson   sales@mar******ts.com   81.134.33.103 81.138.57.64 81.136.244.226 81.133.2...   0   1113178706   Ashley_Davidson   Update - Update<br><br>Friday night 15th.<br><br>W...   xx   1
Title: Re: Large board upgrade error - "Data truncated for column 'poster_ip_old'"
Post by: Arantor on May 25, 2019, 03:59:27 AM
OK so that at least answers the question of what the column contains - it contains multiple IP addresses. Quite *why* it contains multiple IP addresses is another story and you should probably just trim the ones that are over-long by hand rather than trying modify the installer.

To find all the ones that are weird like this:

SELECT * FROM smf_messages WHERE poster_ip LIKE '% %';

This will find all the ones with spaces in so you can prune off the IP addresses after the first one.
Title: Re: Large board upgrade error - "Data truncated for column 'poster_ip_old'"
Post by: Gilrod on May 25, 2019, 04:19:44 AM
wow, there's 5317 of them

as you can tell SQL isn't my thing... Is there a script/whatever I can run that will delete the extra ones for me?
Title: Re: Large board upgrade error - "Data truncated for column 'poster_ip_old'"
Post by: albertlast on May 26, 2019, 03:51:33 AM
since the value is unvalid i would recommand to mark this entries (the ip values) as unkown:

update smf_messages set poster_ip = 'unknown' where poster_ip LIKE '% %'


Result would be that the ip address of this post get lost,
but in my eyes is the information already lost,
so nothing wrong here.
Title: Re: Large board upgrade error - "Data truncated for column 'poster_ip_old'"
Post by: Gilrod on May 26, 2019, 04:03:19 PM
That did it! all upgraded to 2.1 now.

re: your question about HOW I had more than 1 IP address... I originally moved to SMF years ago, but from a YaBB2 forum, I seem to remember YaBB stored ALL your IP addresses you logged in from, NOT just the one from a specific post. I wonder if when going from YaBB to SMF it took at IP addresses used?!

Anyway, thanks for the help all!