antonioribeiro / antonioribeiro/tracker

1062 Duplicate entry @ tracker_agents_name_hash_unique

Open
#477 0 comments 1 reaction 0 assignees View on GitHub
Dominant language
PHP
Stars
2.9k
Forks
594
PR merge metrics
No merged PRs in 30d

Description

**Describe the bug**
`SQLSTATE[23000]: Integrity constraint violation: 1062 Duplicate entry '477c02627521747f77ac6150d7a63f1f4946bd41197ec2143e4eaccd6407271e' for key 'tracker_agents_name_hash_unique' (SQL: insert into `tracker_agents` (`name`, `browser`, `browser_version`, `name_hash`, `updated_at`, `created_at`) values (Mozilla/5.0 (Linux; Android 8.1.0; SM-G610F Build/M1AJQ; wv) AppleWebKit/537.36 (KHTML, like Gecko) Version/4.0 Chrome/70.0.3538.110 Mobile Safari/537.36, Chrome Mobile WebView, 70.0.3538, 477c02627521747f77ac6150d7a63f1f4946bd41197ec2143e4eaccd6407271e, 2019-11-06 19:03:51, 2019-11-06 19:03:51)) {"exception":"[object] (Illuminate\\Database\\QueryException(code: 23000): SQLSTATE[23000]: Integrity constraint violation: 1062 Duplicate entry '477c02627521747f77ac6150d7a63f1f4946bd41197ec2143e4eaccd6407271e' for key 'tracker_agents_name_hash_unique' (SQL: insert into `tracker_agents` (`name`, `browser`, `browser_version`, `name_hash`, `updated_at`, `created_at`) values (Mozilla/5.0 (Linux; Android 8.1.0; SM-G610F Build/M1AJQ; wv) AppleWebKit/537.36 (KHTML, like Gecko) Version/4.0 Chrome/70.0.3538.110 Mobile Safari/537.36, Chrome Mobile WebView, 70.0.3538, 477c02627521747f77ac6150d7a63f1f4946bd41197ec2143e4eaccd6407271e, 2019-11-06 19:03:51, 2019-11-06 19:03:51))`

Contributor guide

No contributing guide indexed for this repository

Research direction

Start by tracing the code path that inserts into the tracker_agents table and inspect the tracker_agents_name_hash_unique constraint. Reproduce the duplicate-entry case and determine the expected behavior when the same name_hash is encountered. Done means the reported SQLSTATE 23000 failure no longer occurs while the uniqueness rule remains respected.

Written by the indexing model from the issue text.

Assessment

Tech stack
laravel, php
Domain
backend, database
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.