<div dir="ltr">Currently we're seeing some 500's on the auth servers in production. These are (virtually) all caused by this type of error :<div><br></div><div>Error: ER_DUP_ENTRY: Duplicate entry '<a href="mailto:user@example.com">user@example.com</a>' for key 'normalizedEmail'<br>
</div><div><br></div><div>Chris suspected and we've reproduced that this is due to a race condition when people jam on the create button and not an immediate concern. </div><div><br></div><div>Here is a full (though truncated by circus) error record as an example.</div>
<div><br></div><div><div>{"name":"fxa-auth-server","hostname":"ip-172-31-28-38","pid":2908,"level":50,"op":"request.summary","code":500,"errno":999,"rid":"1395432599848-2908-45480","path":"/v1/account/create","lang":"en-US","agent":"Mozilla/5.0 (Macintosh; Intel Mac OS X 10_8_5) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/33.0.1750.152 Safari/537.36","remoteAddressChain":["63.245.219.53","172.31.28.78","127.0.0.1"],"t":513,"keys":"true","email":"<a href="mailto:user@example.com">user@example.com</a>","trace":[],"stack":"Error: ER_DUP_ENTRY: Duplicate entry '<a href="mailto:user@example.com">user@example.com</a>' for key 'normalizedEmail'\n at Query.Sequence._packetToError (/data/fxa-auth-server/node_modules/mysql/lib/protocol/sequences/Sequence.js:30:14)\n at Query.ErrorPacket (/data/fxa-auth-server/node_modules/mysql/lib/protocol/sequences/Query.js:82:18)\n at Protocol._parsePacket (/data/fxa-auth-server/node_modules/mysql/lib/protocol/Protocol.js:202:24)\n at Parser.write (/data/fxa-auth-server/node_modules/mysql/lib/protocol/Parser.js:62:12)\n at Protocol.write (/data/fxa-auth-ser</div>
<div>ver/node_modules/mysql/lib/protocol/Protocol.js:37:16)\n at Socket.<anonymous> (/data/fxa-auth-server/node_modules/mysql/lib/Connection.js:72:28)\n at Socket.EventEmitter.emit (events.js:95:17)\n at Socket.<anonymous> (_stream_readable.js:746:14)\n at Socket.EventEmitter.emit (events.js:92:17)\n at emitReadable_ (_stream_readable.js:408:10)\n --------------------\n at Protocol._enqueue (/data/fxa-auth-server/node_modules/mysql/lib/protocol/Protocol.js:110:26)\n at PoolConnection.Connection.query (/data/fxa-auth-server/node_modules/mysql/lib/Connection.js:165:25)\n at query (/data/fxa-auth-server/db/mysql.js:850:16)\n at /data/fxa-auth-server/db/mysql.js:763:18\n at onSettled (/data/fxa-auth-server/node_modules/p-promise/p.js:258:10)\n at onTick (/data/fxa-auth-server/node_modules/p-promise/p.js:40:4)\n at process._tickDomainCallback (node.js:459:13)","msg":"ER_DUP_ENTRY: Duplicate entry '<a href="mailto:user@example.com">user@example.com</a>' for key 'normalizedEmail'","time":"2014-03-21T20:10:00.361Z","</div>
</div><div><br></div><div>-Gene</div></div>