Page MenuHomePhabricator

Some use of PhutilUTF8StringTruncator are not aggressive enough
Closed, ResolvedPublic

Description

Our phabricator daemons continue to emit this error into the daemon long.

[20-Nov-2014 23:57:25] [2014-11-20 23:57:25] EXCEPTION: (PhutilProxyException) Error while executing task ID 11143 from queue. {>} (AphrontQueryException) #1406: Data too long for column 'summary' at row 1 at [<phutil>/src/aphront/storage/connection/mysql/AphrontBaseMySQLDatabaseConnection.php:308]
[20-Nov-2014 23:57:25]   #0 AphrontBaseMySQLDatabaseConnection::throwQueryCodeException(integer, string) called at [<phutil>/src/aphront/storage/connection/mysql/AphrontBaseMySQLDatabaseConnection.php:275]
[20-Nov-2014 23:57:25]   #1 AphrontBaseMySQLDatabaseConnection::throwQueryException(mysqli) called at [<phutil>/src/aphront/storage/connection/mysql/AphrontBaseMySQLDatabaseConnection.php:181]
[20-Nov-2014 23:57:25]   #2 AphrontBaseMySQLDatabaseConnection::executeRawQuery(string) called at [<phutil>/src/xsprintf/queryfx.php:6]
[20-Nov-2014 23:57:25]   #3 queryfx(AphrontMySQLiDatabaseConnection, string, string, string, string, string)
[20-Nov-2014 23:57:25]   #4 call_user_func_array(string, array) called at [<phutil>/src/aphront/storage/connection/AphrontDatabaseConnection.php:26]
[20-Nov-2014 23:57:25]   #5 AphrontDatabaseConnection::query(string, string, string, string, string) called at [<phabricator>/src/infrastructure/storage/lisk/LiskDAO.php:1112]
[20-Nov-2014 23:57:25]   #6 LiskDAO::update() called at [<phabricator>/src/infrastructure/storage/lisk/LiskDAO.php:1041]
[20-Nov-2014 23:57:25]   #7 LiskDAO::save() called at [<phabricator>/src/applications/repository/storage/PhabricatorRepositoryCommit.php:169]
[20-Nov-2014 23:57:25]   #8 PhabricatorRepositoryCommit::save() called at [<phabricator>/src/applications/repository/worker/commitmessageparser/PhabricatorRepositoryCommitMessageParserWorker.php:80]
[20-Nov-2014 23:57:25]   #9 PhabricatorRepositoryCommitMessageParserWorker::updateCommitData(DiffusionCommitRef) called at [<phabricator>/src/applications/repository/worker/commitmessageparser/PhabricatorRepositorySvnCommitMessageParserWorker.php:15]
[20-Nov-2014 23:57:25]   #10 PhabricatorRepositorySvnCommitMessageParserWorker::parseCommit(PhabricatorRepository, PhabricatorRepositoryCommit) called at [<phabricator>/src/applications/repository/worker/PhabricatorRepositoryCommitParserWorker.php:44]
[20-Nov-2014 23:57:25]   #11 PhabricatorRepositoryCommitParserWorker::doWork() called at [<phabricator>/src/infrastructure/daemon/workers/PhabricatorWorker.php:87]
[20-Nov-2014 23:57:25]   #12 PhabricatorWorker::executeTask() called at [<phabricator>/src/infrastructure/daemon/workers/storage/PhabricatorWorkerActiveTask.php:156]
[20-Nov-2014 23:57:25]   #13 PhabricatorWorkerActiveTask::executeTask() called at [<phabricator>/src/infrastructure/daemon/workers/PhabricatorTaskmasterDaemon.php:19]
[20-Nov-2014 23:57:25]   #14 PhabricatorTaskmasterDaemon::run() called at [<phutil>/src/daemon/PhutilDaemon.php:91]
[20-Nov-2014 23:57:25]   #15 PhutilDaemon::execute() called at [<phutil>/scripts/daemon/exec/exec_daemon.php:111]

Any idea why this is? Is it as simple as a summary in commit message being too long? Or is it something more?

Event Timeline

pmepablo assigned this task to chad.
pmepablo raised the priority of this task from to High.
pmepablo updated the task description. (Show Details)
pmepablo added a subscriber: pmepablo.
chad removed chad as the assignee of this task.Nov 21 2014, 5:26 AM
chad raised the priority of this task from High to Needs Triage.

I was able to get the daemons in configuration. Needed to restart the httpd service (I'd restarted everything else but may not have done that one). Now it's just the error about the summary.

I believe summary is a text field, or 65k bytes. Is your summary longer than that?

summary is only 80 bytes long on MySQL older than 5.5, but we truncate it to 80 characters, not 80 bytes.

The call to PhutilUTF8StringTruncator in PhabricatorRepositoryCommitData->summarizeCommitMessage() should use setMaximumBytes(), not setMaximumCodepoints().

We should review other uses of PhutilUTF8StringTruncator in case they have similar issues. Prior to T1191, columns were always measured in characters.

epriestley renamed this task from Phabricator daemons in error to Some use of PhutilUTF8StringTruncator are not aggressive enough.Dec 8 2014, 12:01 PM
epriestley added a project: Support Impact.

Support Impact This breaks things and users have no recourse other than reporting it.

Thanks very much. I'll update this evening.