Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

pdnsutil segfaults when using test-schema with an existing domain name #3791

Closed
lpmhouben opened this issue Apr 28, 2016 · 2 comments
Closed

Comments

@lpmhouben
Copy link
Contributor

lpmhouben commented Apr 28, 2016

As per the title.

Output with log-level=9 set in the config:


shadur@axiom: ~/ > pdnsutil --config-dir .pdnssec/ -v --config-name teslatest test-schema key_store
Apr 28 16:11:46 Reading random entropy from '/dev/urandom'
Apr 28 16:11:46 gpgsql Connection successful. Connected to database 'teslatest' on 'teslatest.internal'.
Note: test-schema will try to create the zone, but it will not remove it.
Please clean up after this.

Constructing UeberBackend
Apr 28 16:11:46 gpgsql Connection successful. Connected to database 'teslatest' on 'teslatest.internal'.
Picking first backend - if this is not what you want, edit launch line!
Creating slave domain key_store.
Segmentation fault

To reproduce:

  1. connect to the database; INSERT INTO domains (name,type) VALUES ('foo','NATIVE');
  2. pdnsutil test-schema foo
@pieterlexis
Copy link
Contributor

What version of pdns is this, on what OS and where did you get the package from? There was a crashing bug in the gpgsql backend that was fixed a few weeks ago in #3612. Currently, your reproduction steps don't crash on Arch Linux with the current master (a8792a2) and postgres 9.5.2:

lieter $ sudo -u postgres createdb -O lieter pdns

lieter $ cat modules/gpgsqlbackend/schema.pgsql.sql| psql pdns
CREATE TABLE
CREATE INDEX
CREATE TABLE
CREATE INDEX
CREATE INDEX
CREATE INDEX
CREATE INDEX
CREATE TABLE
CREATE TABLE
CREATE INDEX
CREATE INDEX
CREATE INDEX
CREATE TABLE
CREATE INDEX
CREATE TABLE
CREATE INDEX
CREATE TABLE
CREATE INDEX

lieter $ ./pdns/pdnsutil --config-dir=../pdns-conf/pgsql list-all-zones
All zonecount: 0

lieter $ psql pdns
psql (9.5.2)
Type "help" for help.

pdns=> INSERT INTO domains (name,type) VALUES ('foo','NATIVE');
INSERT 0 1
pdns=> \q

lieter $ ./pdns/pdnsutil --config-dir=../pdns-conf/pgsql list-all-zones                                                                                   
foo.
All zonecount: 1

lieter $ ./pdns/pdnsutil --config-dir=../pdns-conf/pgsql test-schema foo 
Note: test-schema will try to create the zone, but it will not remove it.
Please clean up after this.

Constructing UeberBackend
Picking first backend - if this is not what you want, edit launch line!
Creating slave domain foo.
Error: Database error trying to insert new domain 'foo.': Fatal error during query: insert into domains (type,name,master,account,last_check, notified_serial) values($1,$2,$3,$4,null,null): ERROR:  duplicate key value violates unique constraint "name_index"
DETAIL:  Key (name)=(foo) already exists.

@pieterlexis
Copy link
Contributor

closing for lack of response

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants