Page MenuHomePhabricator

Error adding URL to a JIRA issue the first time to Differential comment
Closed, ResolvedPublic

Description

Steps To Reproduce

  1. Create a new issue in JIRA (does not actually have to be a new JIRA issue just one that has never been introduced to the Phabricator instance via a comment or possibly by other means).
  2. Put the URL to the newly created JIRA issue into a comment on a Differential revision (the issue only occurs the first time you put the JIRA issue into a comment, subsequent attempts will succeed as expected).

Expected: URL is transformed into JIRA issue title with no errors.
Actual: URL is transformed into JIRA issue title but there is pop up error (see screenshot below and server side error logs below that).

screenshot-1.png (523×1 px, 73 KB)

[Wed Sep 07 14:44:37 2016] [error] [client 10.55.117.103] [2016-09-07 14:44:37] EXCEPTION: (AphrontDuplicateKeyQueryException) #1062: Duplicate entry '04vXJqkdnL4j' for key 'key_object' at [<phutil>/src/aphront/storage/connection/mysql/AphrontBaseMySQLDatabaseConnection.php:314]
[Wed Sep 07 14:44:37 2016] [error] [client 10.55.117.103] arcanist(), libtwitter(), phabricator(), phutil()
[Wed Sep 07 14:44:37 2016] [error] [client 10.55.117.103]   #0 <#2> AphrontBaseMySQLDatabaseConnection::throwCommonException(integer, string) called at [<phutil>/src/aphront/storage/connection/mysql/AphrontBaseMySQLDatabaseConnection.php:348]
[Wed Sep 07 14:44:37 2016] [error] [client 10.55.117.103]   #1 <#2> AphrontBaseMySQLDatabaseConnection::throwQueryCodeException(integer, string) called at [<phutil>/src/aphront/storage/connection/mysql/AphrontBaseMySQLDatabaseConnection.php:289]
[Wed Sep 07 14:44:37 2016] [error] [client 10.55.117.103]   #2 <#2> AphrontBaseMySQLDatabaseConnection::throwQueryException(mysqli) called at [<phutil>/src/aphront/storage/connection/mysql/AphrontBaseMySQLDatabaseConnection.php:185]
[Wed Sep 07 14:44:37 2016] [error] [client 10.55.117.103]   #3 <#2> AphrontBaseMySQLDatabaseConnection::executeRawQuery(string) called at [<phutil>/src/xsprintf/queryfx.php:8]
[Wed Sep 07 14:44:37 2016] [error] [client 10.55.117.103]   #4 <#2> queryfx(AphrontMySQLiDatabaseConnection, string, string, string, array, string)
[Wed Sep 07 14:44:37 2016] [error] [client 10.55.117.103]   #5 <#2> call_user_func_array(string, array) called at [<phutil>/src/aphront/storage/connection/AphrontDatabaseConnection.php:42]
[Wed Sep 07 14:44:37 2016] [error] [client 10.55.117.103]   #6 <#2> AphrontDatabaseConnection::query(string, string, string, array, string) called at [<phabricator>/src/infrastructure/storage/lisk/LiskDAO.php:1261]
[Wed Sep 07 14:44:37 2016] [error] [client 10.55.117.103]   #7 <#2> LiskDAO::insertRecordIntoDatabase(string) called at [<phabricator>/src/infrastructure/storage/lisk/LiskDAO.php:1106]
[Wed Sep 07 14:44:37 2016] [error] [client 10.55.117.103]   #8 <#2> LiskDAO::insert() called at [<phabricator>/src/infrastructure/storage/lisk/LiskDAO.php:1075]
[Wed Sep 07 14:44:37 2016] [error] [client 10.55.117.103]   #9 <#2> LiskDAO::save() called at [<phabricator>/src/applications/doorkeeper/storage/DoorkeeperExternalObject.php:83]
[Wed Sep 07 14:44:37 2016] [error] [client 10.55.117.103]   #10 <#2> DoorkeeperExternalObject::save() called at [<phabricator>/src/applications/doorkeeper/bridge/DoorkeeperBridgeJIRA.php:109]
[Wed Sep 07 14:44:37 2016] [error] [client 10.55.117.103]   #11 <#2> DoorkeeperBridgeJIRA::pullRefs(array) called at [<phabricator>/src/applications/doorkeeper/engine/DoorkeeperImportEngine.php:117]
[Wed Sep 07 14:44:37 2016] [error] [client 10.55.117.103]   #12 <#2> DoorkeeperImportEngine::execute() called at [<phabricator>/src/applications/doorkeeper/controller/DoorkeeperTagsController.php:33]
[Wed Sep 07 14:44:37 2016] [error] [client 10.55.117.103]   #13 <#2> DoorkeeperTagsController::handleRequest(AphrontRequest) called at [<phabricator>/src/aphront/configuration/AphrontApplicationConfiguration.php:237]
[Wed Sep 07 14:44:37 2016] [error] [client 10.55.117.103]   #14 phlog(AphrontDuplicateKeyQueryException) called at [<phabricator>/src/aphront/handler/PhabricatorDefaultRequestExceptionHandler.php:41]
[Wed Sep 07 14:44:37 2016] [error] [client 10.55.117.103]   #15 PhabricatorDefaultRequestExceptionHandler::handleRequestException(AphrontRequest, AphrontDuplicateKeyQueryException) called at [<phabricator>/src/aphront/configuration/AphrontApplicationConfiguration.php:644]
[Wed Sep 07 14:44:37 2016] [error] [client 10.55.117.103]   #16 AphrontApplicationConfiguration::handleException(AphrontDuplicateKeyQueryException) called at [<phabricator>/src/aphront/configuration/AphrontApplicationConfiguration.php:242]
[Wed Sep 07 14:44:37 2016] [error] [client 10.55.117.103]   #17 AphrontApplicationConfiguration::processRequest(AphrontRequest, PhutilDeferredLog, AphrontPHPHTTPSink, MultimeterControl) called at [<phabricator>/src/aphront/configuration/AphrontApplicationConfiguration.php:149]
[Wed Sep 07 14:44:37 2016] [error] [client 10.55.117.103]   #18 AphrontApplicationConfiguration::runHTTPRequest(AphrontPHPHTTPSink) called at [<phabricator>/webroot/index.php:17]

Version
phabricator 359397e1039f8fac23153dfa6015e83b600ee340 (Thu, Sep 1)
arcanist c5600434c60d25cd412b432cc79efd05cc01b0b4 (Mon, Aug 29)
phutil 4166ae9b53cf5419ec8b5f9c29b06b14c34eb63c (Mon, Aug 29)
libtwitter 812ace64d335406353e75103f5dd2a081c74494c (Mon, Aug 29)

Event Timeline

There is a small possibility that this was "fixed" by D16494 on Sep 5.

(I'd be a little surprised if it was and it still merits a real fix even if it doesn't happen in practice anymore.)

Happy to bring those changes in and test it out. Also happy to test any patches if testing JIRA related stuff is a pain.

Let me take a shot at it locally first, I don't immediately see a real way that D16494 could have fixed this given your repro steps.

I believe this is now fixed in HEAD of master. Let us know if you're still seeing issues.

(It was only vaguely similar to the issue in D16494, not really related.)

Awesome, thanks for the quick fix!

Confirmed by updating to the latest, thanks again!