Skip to content

Hash key not unique in road_usage #253

@opatut

Description

@opatut
sqlalchemy.exc.PendingRollbackError: This Session's transaction has been rolled back due to a previous exception during flush. To begin a new transaction with this Session, first issue Session.rollback(). Original exception was: (sqlalchemy.dialects.postgresql.asyncpg.IntegrityError) <class 'asyncpg.exceptions.UniqueViolationError'>: duplicate key value violates unique constraint "ix_road_usage_hex_hash"
DETAIL:  Key (hex_hash)=(1e7f60c9a9c92b27d4dcbcb414af2b1f647abfc30799e6d893b9ee46c974cbed) already exists.
[SQL: INSERT INTO road_usage (track_id, hex_hash, way_id, time, direction_reversed) VALUES (%s, %s, %s, %s, %s) RETURNING road_usage.id]
[parameters: (328, '1e7f60c9a9c92b27d4dcbcb414af2b1f647abfc30799e6d893b9ee46c974cbed', 824230969, datetime.datetime(2021, 3, 26, 18, 48, 52), False)]
(Background on this error at: https://sqlalche.me/e/14/gkpj) (Background on this error at: https://sqlalche.me/e/14/7s2a)

hope it's not a hash collision.

Originally posted by @SirTificate in #247 (comment)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions