pschiffe / docker-pdns

Docker images for PowerDNS
MIT License
274 stars 81 forks source link

Can´t add domain #85

Closed yppdr closed 1 year ago

yppdr commented 2 years ago

Hi ! I just installed the stack on a brand new docker and I find myself unable to add a domain, it returns me a 400. Could you help me to solve the problem ?

Log :

Aug 04 20:41:17 Guardian is launching an instance
Aug 04 20:41:17 Loading '/usr/lib64/pdns/libgmysqlbackend.so'
Aug 04 20:41:17 This is a guarded instance of pdns
Aug 04 20:41:17 Fatal error: Database error trying to retrieve all domains:Could not prepare statement: select domains.id, domains.name, records.content, domains.type, domains.master, domains.notified_serial, domains.last_check, domains.account from domains LEFT JOIN records ON records.domain_id=domains.id AND records.type='SOA' AND records.name=domains.name WHERE records.disabled=0 OR ?: Table 'powerdnsadmin.domains' doesn't exist
Aug 04 20:41:18 Our pdns instance exited with code 1, respawning
Exchizz commented 2 years ago

Hi,

This is a "funny" one. When the container starts, it checks if there is tables in the database. If not, it import the scheme. In my case, I had powerdns-admin running as a separate container. It seems like powerdns-admin had initialized the database before "pdns" has run hence it didn't import the schema because powerdns-admin had already populated the database ....

i did: docker exec -it

had a loot at the docker-entrypoint script and did some echo'ing of the vars to see where it failed.

Steps to fix:

  1. delte the database
  2. make sure pdns-admin does not start
  3. Start pdns
  4. start pdns-admin
pschiffe commented 1 year ago

Hey guys, thanks for the report. Pdns-admin doesn't have the domains table, but pdns does. Make sure that you are not using the same db for both, pdns and pdns-admin. You can share mysql instance, but with different dbs inside, ie powerdns for pdns and powerdnsadmin for pdns-admin, I think these are the default.