Skip to content

  • Projects
  • Groups
  • Snippets
  • Help
    • Loading...
    • Help
    • Submit feedback
    • Contribute to GitLab
  • Sign in / Register
Kea
Kea
  • Project
    • Project
    • Details
    • Activity
    • Releases
    • Cycle Analytics
  • Repository
    • Repository
    • Files
    • Commits
    • Branches
    • Tags
    • Contributors
    • Graph
    • Compare
    • Charts
  • Issues 235
    • Issues 235
    • List
    • Board
    • Labels
    • Milestones
  • Registry
    • Registry
  • Wiki
    • Wiki
  • Snippets
    • Snippets
  • Members
    • Members
  • Collapse sidebar
  • Activity
  • Graph
  • Charts
  • Create a new issue
  • Commits
  • Issue Boards
  • ISC Open Source Projects
  • KeaKea
  • Issues
  • #269

Closed
Open
Opened Nov 13, 2018 by Vadim Fedorenko@junjunk
  • Report abuse
  • New issue
Report abuse New issue

client_encoding in PostgreSQL connection

name: client_encoding in PostgreSQL connection
about: Make connection's client_encoding configurable

Related problem Sometimes it is impossible to execute lease{4,6}_{update,insert} SQLs in configuration with PostgreSQL database created with default UTF8 encoding and default server's encoding set to UTF8. This is because some DHCP clients are not fully compatible with RFC1035 and are using 8-bit ASCII codes in hostname options. This, in case, results in errors like '2018-11-12 23:36:44.762 ERROR [kea-dhcp4.alloc-engine/30224] ALLOC_ENGINE_V4_ALLOC_ERROR [hwtype=1 a0:f3:c1:9d:33:d5], cid=[01:a0:f3:c1:9d:33:d5], tid=0x55527316: error during attempt to allocate an IPv4 address: Statement exec failed: for: update_lease4, status: 7sqlstate:[ 22021], reason: ERROR: invalid byte sequence for encoding "UTF8": 0xc0 0x90'

Solution One possible solution is to change "client_encoding" connection parameter to "latin1" value. This eliminates problem of PostgreSQL's parsing such problematic string as UTF8 string and makes it possible to store hostname value "as is". To make this connection parameter configurable, I've added configuration parameter "client-encoding" visible in LEASE_DATABASE, HOSTS_DATABASE and CONFIG_DATABASE scopes. I've attached the patch against today's master branch of repo.

I can also make a pull request, if you need it Also, I can backport this patch to 1.4.0 and 1.5.0 version, because it fixes some possible problems client_encoding_master.patch

Assignee
Assign to
Kea1.7
Milestone
Kea1.7
Assign milestone
Time tracking
None
Due date
No due date
4
Labels
bug enhancement patch pgsql
Assign labels
  • View project labels
Reference: isc-projects/kea#269