Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Data too long for column 'AllIPAddresses' #2005

Closed
JasonBarnabe opened this issue Jul 21, 2014 · 9 comments
Closed

Data too long for column 'AllIPAddresses' #2005

JasonBarnabe opened this issue Jul 21, 2014 · 9 comments
Milestone

Comments

@JasonBarnabe
Copy link
Contributor

A user has reported to me that when they try to sign in to my forum, they get

Fatal Error in Gdn_Database.Query();
Data too long for column 'AllIPAddresses' at row 1
update GDN_User `User` set DateLastActive = :DateLastActive, LastIPAddress = :LastIPAddress, CountVisits = :CountVisits, AllIPAddresses = :AllIPAddresses where UserID = :UserID
The error occurred on or near: /home/www/forum/library/database/class.database.php

I'm unsure what this field represents (all IP addresses used ever by this user?), but it seems like this should be truncated at the field size.

@linc
Copy link
Contributor

linc commented Jul 21, 2014

Hi Jason, what version are you using?

@JasonBarnabe
Copy link
Contributor Author

2.1.

@linc linc added this to the 2.1.1 milestone Jul 21, 2014
@linc linc added the Bug label Jul 21, 2014
@linc
Copy link
Contributor

linc commented Jul 21, 2014

Thanks!

@JasonBarnabe
Copy link
Contributor Author

After setting the column to null again for the problematic user, the problem went away for a bit then happened again for him. It has also occurred for another user.

@JasonBarnabe
Copy link
Contributor Author

As a workaround, I've changed the schema:

ALTER TABLE GDN_User MODIFY COLUMN AllIPAddresses VARCHAR(500);

@austins
Copy link
Contributor

austins commented Aug 29, 2014

The error Data too long for column 'AllIPAddresses' still happens in Vanilla 2.1.1 for some users.

In this case, the AllIPAddresses column is set to the default varchar(100) NULL type. The users who receive this error while signing in have a long string of IP addresses in that column (some of which are truncated), whereas users who aren't affected have a short string of IP addresses.

This only occurs if MySQL is set to strict mode (sql-mode setting contains STRICT_TRANS_TABLES), so a workaround would be to disable STRICT_TRANS_TABLES mode for MySQL or change the column character limit like @JasonBarnabe posted above.

@JasonBarnabe
Copy link
Contributor Author

Use of ipFlood can cause this...

@mike-pt
Copy link

mike-pt commented Oct 25, 2014

This still happens in v 2.1.3, ideally the code should clean the last ip while adding the new ones (if X ips are already there ofc)

@JasonBarnabe
Copy link
Contributor Author

See PR #2493.

@linc linc modified the milestones: 2.next, 2.1.x Feb 17, 2015
@linc linc closed this as completed Jun 3, 2015
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants