PuzzleServer / mainpuzzleserver

The main repo for the Puzzle Hunt and Puzzleday servers.
MIT License
9 stars 31 forks source link

Primary key violations on annotations #384

Closed morganbr closed 5 years ago

morganbr commented 5 years ago

We're seeing lots of SqlExceptions due to primary key violations on annotations

_MS.ProcessedByMetricExtractors: (Name:'Dependencies', Ver:'1.0') Account Id: Application version: 1.0.0.0 AspNetCoreEnvironment: Production Auth user Id: Base name: tcp:puzzlehunt.database.windows.net,1433 | puzzleserver Browser version: City: Whittier Client IP address: 0.0.0.0 Cloud role instance: RD0003FFE54529 Cloud role name: puzzlehunt Country or region: United States Dependency duration: 3 ms Dependency Id: 4dafbbb47eef4426aea1ddf49f2b6e5b Dependency name: SQL: tcp:puzzlehunt.database.windows.net,1433 | puzzleserver Dependency type: SQL Device model: Device type: PC Event time: 4/7/2019, 4:56:54 PM Exception: System.Data.SqlClient.SqlException (0x80131904): Violation of PRIMARY KEY constraint 'PK_Annotations'. Cannot insert duplicate key in object 'dbo.Annotations'. The duplicate key value is (93, 1120, 249). The statement has been terminated. at System.Data.SqlClient.SqlConnection.OnError(SqlExc... Operating system: Operation Id: ca30a12e-4e18897735a39413 Operation name: POST Sync/Post [eventId/puzzleId] Parent Id: ca30a12e-4e18897735a39413 Result code: 2627 Sample Rate: 25 SDK version: rdddsc:2.6.4-28401 Session Id: v0lsN Source of synthetic traffic: State or province: California Successful call: false Telemetry type: dependency User Id: ebTuT

View this instance in the Azure portal<\a>

morganbr commented 5 years ago

@jaylorch FYI

jaylorch commented 5 years ago

Would this be reported even though I catch the exception? If it's the exception I catch, it's perfectly benign.

jaylorch commented 5 years ago

Yeah, that's probably what's going on. I see the documentation says:

Does my app definitely have a problem? No, a notification doesn't mean that your app definitely has a problem. Although an excessive number of exceptions usually indicates an application issue, these exceptions might be benign and handled correctly by your application.