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 b2bmigrate tinydns to gmysql fails: domain_ids are set to -1 #6239

Closed
finferflu opened this Issue Jan 31, 2018 · 8 comments

Comments

Projects
None yet
5 participants
@finferflu

finferflu commented Jan 31, 2018

  • Program: pdnsutil
  • Issue type: Bug report

Short description

After importing records from a tindydns backend, the domain_id for each entry in the records table is set to -1.

Environment

  • Operating system: CentOS 7
  • Software version: 4.1.0
  • Software source: PowerDNS repository

Steps to reproduce

  1. Set up PDNS database as indicated here.
  2. Follow the instructions here up to step 4.
  3. pdnsutil check-all-zones yields [error] No SOA record present, or active, in zone 'example.com' for each zone.
  4. Verify that domain_id for each record in the records table is set to -1.

Expected behaviour

records.domain_id to be set to the ID of the zone in the domains table.

Actual behaviour

records.domain_id is set to -1 for each record.

Other information

I have also subsequently created constraints as indicated here, and running pdnsutil -v b2b-migrate tinydns gmysql yields (quite predictably):

Processing 'example.com'
Error: GSQLBackend unable to feed record: Could not execute mysql statement: insert into records (content,ttl,prio,type,domain_id,disabled,name,ordername,auth,change_date) values (?,?,?,?,?,?,?,?,?,NULL): Cannot add or update a child row: a foreign key constraint fails (`pdns`.`records`, CONSTRAINT `records_domain_id_ibfk` FOREIGN KEY (`domain_id`) REFERENCES `domains` (`id`) ON DELETE CASCADE ON UPDATE CASCADE)

I'd also just like to add that there's nothing fancy in my pdns.conf file, just credentials and backends:

# cat /etc/pdns/pdns.conf
launch=tinydns,gmysql
tinydns-dbfile=/root/data.cdb

gmysql-dbname=pdns
gmysql-host=127.0.0.1
gmysql-port=3306
gmysql-user=pdns
gmysql-password=password

version-string=powerdns

Please let me know if you'd like any more details, and I'll be happy to provide them.

Thank you!

@pieterlexis pieterlexis added this to the auth-4.2.0 milestone Jan 31, 2018

@cmouse cmouse referenced this issue May 1, 2018

Merged

pdnsutil: Use new domain in b2bmigrate #6559

2 of 7 tasks complete
@Habbie

This comment has been minimized.

Member

Habbie commented May 1, 2018

Hello! Can you test #6559? We can build packages if you like.

@finferflu

This comment has been minimized.

finferflu commented May 1, 2018

Thanks, it'd be useful if you could package it for CentOS 7. Thank you.

@Habbie

This comment has been minimized.

Member

Habbie commented May 1, 2018

Build started at https://builder.powerdns.com/#/builders/8/builds/2264

In about an hour, you should be able to click through to the centos-7 build and get a tarball full of packages from there.

@finferflu

This comment has been minimized.

finferflu commented May 4, 2018

@Habbie I'm sorry for the delayed response. I have tried to fetch the tarball here https://builder.powerdns.com/files/auth/0.0.dinew.2264g604e9ac/pdns-0.0.dinew.2264g604e9ac-centos-7-x86_64.tar.bz2, however, the file is not found. Does it get auto-deleted after a while? In that case, could you please start another build for me?

Thank you, and sorry for the trouble.

@mnordhoff

This comment has been minimized.

Contributor

mnordhoff commented May 4, 2018

@finferflu

This comment has been minimized.

finferflu commented May 4, 2018

@mnordhoff Thanks for the blazing fast reply! I'm currently testing these and will report back. Thanks again.

@finferflu

This comment has been minimized.

finferflu commented May 4, 2018

I can confirm that the issue is now fixed. Thank you very much for providing a fix.

@finferflu finferflu closed this May 4, 2018

@MANDANGA

This comment has been minimized.

MANDANGA commented May 22, 2018

Hello,

Is possible to apply this fix to the 4.1.2?

regards,

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