Skip to content
GitLab
Projects Groups Snippets
  • /
  • Help
    • Help
    • Support
    • Community forum
    • Submit feedback
    • Contribute to GitLab
  • Sign in / Register
  • Kea Kea
  • Project information
    • Project information
    • Activity
    • Labels
    • Members
  • Repository
    • Repository
    • Files
    • Commits
    • Branches
    • Tags
    • Contributors
    • Graph
    • Compare
  • Issues 560
    • Issues 560
    • List
    • Boards
    • Service Desk
    • Milestones
  • Merge requests 58
    • Merge requests 58
  • Deployments
    • Deployments
    • Releases
  • Packages and registries
    • Packages and registries
    • Container Registry
  • Monitor
    • Monitor
    • Incidents
  • Analytics
    • Analytics
    • Value stream
    • Repository
  • Wiki
    • Wiki
  • Snippets
    • Snippets
  • Activity
  • Graph
  • Create a new issue
  • Commits
  • Issue Boards
Collapse sidebar
  • ISC Open Source ProjectsISC Open Source Projects
  • KeaKea
  • Issues
  • #2293
Closed
Open
Issue created Jan 27, 2022 by Andrei Pavel@andreiMaintainer

kea-admin lease-upload fails if CSV file contains duplicate leases

$ kea-admin lease-upload mysql -4 -i /tmp/kea-dhcp4.csv
ERROR 1062 (23000) at line 1: Duplicate entry '167772160' for key 'PRIMARY'

$ kea-admin lease-upload pgsql -4 -i /tmp/kea-dhcp4.csv
ERROR:  duplicate key value violates unique constraint "lease4_pkey"
DETAIL:  Key (address)=(167772160) already exists.

Same for v6.

Duplicate leases are common when running Kea with memfile backend.

Workaround 1: start a dummy Kea server with a low lfc-timer e.g. 1 so that it calls kea-lfc and then use the curated csv.2 file.

Workaround 2: call LFC yourself and then use csv.2 file: kea-lfc -4 -x /tmp/kea-dhcp4.csv.2 -i /tmp/kea-dhcp4.csv.1 -o /tmp/kea-dhcp4.csv.output -f /tmp/kea-dhcp4.csv.completed -p /tmp/kea-dhcp4.csv.pid -cignored-path

To upload designs, you'll need to enable LFS and have an admin enable hashed storage. More information
Assignee
Assign to
Time tracking