Modify

Opened 6 years ago

Closed 6 years ago

Last modified 3 years ago

#13500 closed defect (cantfix)

DataError: (1406, "Data too long for column 'ipnr' at row 1")

Reported by: anonymous Owned by: Ryan J Ollos
Priority: normal Component: AccountManagerPlugin
Severity: normal Keywords:
Cc: Trac Release:

Description

When a user is using an IPv6 address, they can't log in and we are getting the following error:

File "/usr/local/lib/python2.7/dist-packages/trac/web/main.py", line 647, in _dispatch_request
  dispatcher.dispatch(req)
File "/usr/local/lib/python2.7/dist-packages/trac/web/main.py", line 248, in dispatch
  resp = chosen_handler.process_request(req)
File "/usr/local/lib/python2.7/dist-packages/acct_mgr/web_ui.py", line 542, in process_request
  return auth.LoginModule.process_request(self, req)
File "/usr/local/lib/python2.7/dist-packages/trac/web/auth.py", line 133, in process_request
  self._do_login(req)
File "/usr/local/lib/python2.7/dist-packages/acct_mgr/web_ui.py", line 633, in _do_login
  res = auth.LoginModule._do_login(self, req)
File "/usr/local/lib/python2.7/dist-packages/trac/web/auth.py", line 188, in _do_login
  int(time_now())))
File "/usr/local/lib/python2.7/dist-packages/trac/db/util.py", line 128, in execute
  cursor.execute(query, params if params is not None else [])
File "/usr/local/lib/python2.7/dist-packages/trac/db/util.py", line 72, in execute
  return self.cursor.execute(sql_escape_percent(sql), args)
File "/usr/local/lib/python2.7/dist-packages/MySQLdb/cursors.py", line 250, in execute
  self.errorhandler(self, exc, value)
File "/usr/local/lib/python2.7/dist-packages/MySQLdb/connections.py", line 50, in defaulterrorhandler
  raise errorvalue

Using

Trac        1.2.3
dnspython   1.15.0
Docutils    0.14
Genshi      0.7.1 (with speedups)
GIT         2.11.0
mod_wsgi    4.5.11 (WSGIProcessGroup site-1 WSGIApplicationGroup %{GLOBAL})
MySQL       server: "10.2.18-MariaDB", client: "10.2.18", thread-safe: 1
MySQLdb     1.3.13
Pygments    2.2.0
Python      2.7.13 (default, Sep 26 2018, 18:42:22) [GCC 6.3.0 20170516]
RPC         1.1.7
setuptools  40.6.2
Textile     3.0.3

----

trac-github         2.3         /usr/local/lib/python2.7/dist-packages
TracAccountManager  0.5.0       /usr/local/lib/python2.7/dist-packages
TracHTTPAuth        1.2         /usr/local/lib/python2.7/dist-packages
TracSpamFilter      1.2.6       /usr/local/lib/python2.7/dist-packages
TracXMLRPC          1.1.7       /usr/local/lib/python2.7/dist-packages

Attachments (0)

Change History (8)

comment:1 Changed 6 years ago by Jun Omae

Resolution: cantfix
Status: newclosed

Weird.

Maximum length of IPv6 address is 39. I think that ipnr column of your auth_cookie table is incorrect and an installation issue. Please check definition of auth_cookie table with DESC auth_cookie; and SHOW CREATE TABLE auth_cookie\G.

Anyway, this issue is not an AccountManagerPlugin issue neither a Trac issue.

comment:2 Changed 6 years ago by anonymous

Thanks for the reply, I'm just trying to fix the issue and I wasn't sure where to ask.

What should the tables be?

comment:3 Changed 6 years ago by anonymous

This is what I see:

Field name  Type        Allow nulls?    Key    Default value
cookie      varchar(64)     No          Primary     NULL
name        varchar(64)     No          Primary     NULL
ipnr        varchar(32)     No          Primary     NULL
time        int(11)         Yes         None        NULL

comment:4 Changed 6 years ago by anonymous

All right, I finally fixed, it was so stupid :)

I just changed the width to 64. Not sure if it needs to be something else.

comment:5 in reply to:  2 Changed 6 years ago by Jun Omae

Replying to anonymous:

What should the tables be?

CREATE TABLE auth_cookie (
    `cookie` mediumtext,
    `name` mediumtext,
    `ipnr` mediumtext,
    `time` int,
    PRIMARY KEY (`cookie`(191),`ipnr`(191),`name`(191))
)

comment:6 Changed 6 years ago by anonymous

That's for creating a new table, right?

Is it possible to convert the current table without any data loss?

comment:8 Changed 6 years ago by anonymous

Thanks for all the help, all sorted out

CREATE TABLE `auth_cookie2` (
  `cookie` mediumtext COLLATE utf8_bin NOT NULL,
  `name` mediumtext COLLATE utf8_bin NOT NULL,
  `ipnr` mediumtext COLLATE utf8_bin NOT NULL,
  `time` int(11) DEFAULT NULL,
  PRIMARY KEY (`cookie`(111),`ipnr`(111),`name`(111))
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_bin;
INSERT INTO `auth_cookie2` SELECT * from `auth_cookie`;
DROP TABLE `auth_cookie`;
RENAME TABLE `auth_cookie2` TO `auth_cookie`;

Modify Ticket

Change Properties
Set your email in Preferences
Action
as closed The owner will remain Ryan J Ollos.
The resolution will be deleted. Next status will be 'reopened'.

Add Comment


E-mail address and name can be saved in the Preferences.

 
Note: See TracTickets for help on using tickets.