#55 ✓resolved
renchap

Error while importing existing pdns database

Reported by renchap | January 26th, 2009 @ 01:03 AM

I got this error while trying to import my existing pdns installation. Seems that Record.domain is null, I will look at this if i have time.


$ RAILS_ENV=production rake --trace migrate:powerdns
(in /home/powerdnsonrails/powerdns-on-rails)
You don't have the cucumber gem installed.
Unless you're developing patches for powerdns-on-rails, you can ignore this message.
To learn more about cucumber, please visit the URL below
http://github.com/aslakhellesoy/cucumber/wikis

** Invoke migrate:powerdns (first_time)
** Invoke environment (first_time)
** Execute environment
** Execute migrate:powerdns
WARNING: This will import all the domains and records from a PowerDNS
database into the PowerDNS on Rails database. Existing records will be
overwritten in the process without warning.
Are you sure you want to continue? [y/N] y

PowerDNS database adapter (mysql only at the moment) [mysql]: postgresql
PowerDNS database host [localhost]:
PowerDNS database port [5432]:
PowerDNS database name []: pdns
PowerDNS database username []: renchap
PowerDNS database password []: 
PowerDNS database encoding [UTF-8]:

A complete log file containing verbose data will be available at the path below after the migration
/home/powerdnsonrails/powerdns-on-rails/log/powerdns-import-20090125235819.log

rake aborted!
undefined method `update_serial' for nil:NilClass
/home/powerdnsonrails/powerdns-on-rails/app/models/record.rb:83:in `update_soa_serial'
/home/powerdnsonrails/powerdns-on-rails/vendor/rails/activesupport/lib/active_support/callbacks.rb:178:in `send'
/home/powerdnsonrails/powerdns-on-rails/vendor/rails/activesupport/lib/active_support/callbacks.rb:178:in `evaluate_method'
/home/powerdnsonrails/powerdns-on-rails/vendor/rails/activesupport/lib/active_support/callbacks.rb:166:in `call'
/home/powerdnsonrails/powerdns-on-rails/vendor/rails/activesupport/lib/active_support/callbacks.rb:93:in `run'
/home/powerdnsonrails/powerdns-on-rails/vendor/rails/activesupport/lib/active_support/callbacks.rb:92:in `each'
/home/powerdnsonrails/powerdns-on-rails/vendor/rails/activesupport/lib/active_support/callbacks.rb:92:in `send'
/home/powerdnsonrails/powerdns-on-rails/vendor/rails/activesupport/lib/active_support/callbacks.rb:92:in `run'
/home/powerdnsonrails/powerdns-on-rails/vendor/rails/activesupport/lib/active_support/callbacks.rb:277:in `run_callbacks'
/home/powerdnsonrails/powerdns-on-rails/vendor/rails/activerecord/lib/active_record/callbacks.rb:315:in `callback'
/home/powerdnsonrails/powerdns-on-rails/vendor/rails/activerecord/lib/active_record/callbacks.rb:223:in `create_or_update'
/home/powerdnsonrails/powerdns-on-rails/vendor/rails/activerecord/lib/active_record/base.rb:2383:in `save_without_validation'
/home/powerdnsonrails/powerdns-on-rails/vendor/rails/activerecord/lib/active_record/validations.rb:1009:in `save_without_dirty'
/home/powerdnsonrails/powerdns-on-rails/vendor/rails/activerecord/lib/active_record/dirty.rb:79:in `save_without_transactions'
/home/powerdnsonrails/powerdns-on-rails/vendor/rails/activerecord/lib/active_record/transactions.rb:179:in `send'
/home/powerdnsonrails/powerdns-on-rails/vendor/rails/activerecord/lib/active_record/transactions.rb:179:in `with_transaction_returning_status'
/home/powerdnsonrails/powerdns-on-rails/vendor/rails/activerecord/lib/active_record/connection_adapters/postgresql_adapter.rb:550:in `transaction'
/home/powerdnsonrails/powerdns-on-rails/vendor/rails/activerecord/lib/active_record/transactions.rb:129:in `transaction'
/home/powerdnsonrails/powerdns-on-rails/vendor/rails/activerecord/lib/active_record/transactions.rb:138:in `transaction'
/home/powerdnsonrails/powerdns-on-rails/vendor/rails/activerecord/lib/active_record/transactions.rb:178:in `with_transaction_returning_status'
/home/powerdnsonrails/powerdns-on-rails/vendor/rails/activerecord/lib/active_record/transactions.rb:146:in `save'
/home/powerdnsonrails/powerdns-on-rails/vendor/rails/activerecord/lib/active_record/transactions.rb:158:in `rollback_active_record_state!'
/home/powerdnsonrails/powerdns-on-rails/vendor/rails/activerecord/lib/active_record/transactions.rb:146:in `save'
/home/powerdnsonrails/powerdns-on-rails/lib/tasks/migrate_from_powerdns.rake:166:in `migrate!'
/home/powerdnsonrails/powerdns-on-rails/lib/tasks/migrate_from_powerdns.rake:141:in `each'
/home/powerdnsonrails/powerdns-on-rails/lib/tasks/migrate_from_powerdns.rake:141:in `migrate!'
/home/powerdnsonrails/powerdns-on-rails/app/models/record.rb:40:in `batch'
/home/powerdnsonrails/powerdns-on-rails/lib/tasks/migrate_from_powerdns.rake:139:in `migrate!'
/home/powerdnsonrails/powerdns-on-rails/lib/tasks/migrate_from_powerdns.rake:60:in `each'
/home/powerdnsonrails/powerdns-on-rails/lib/tasks/migrate_from_powerdns.rake:60:in `each'
/home/powerdnsonrails/powerdns-on-rails/lib/tasks/migrate_from_powerdns.rake:86:in `migrate!'
/home/powerdnsonrails/powerdns-on-rails/lib/tasks/migrate_from_powerdns.rake:261
/usr/lib64/ruby/gems/1.8/gems/rake-0.8.3/lib/rake.rb:617:in `call'
/usr/lib64/ruby/gems/1.8/gems/rake-0.8.3/lib/rake.rb:617:in `execute'
/usr/lib64/ruby/gems/1.8/gems/rake-0.8.3/lib/rake.rb:612:in `each'
/usr/lib64/ruby/gems/1.8/gems/rake-0.8.3/lib/rake.rb:612:in `execute'
/usr/lib64/ruby/gems/1.8/gems/rake-0.8.3/lib/rake.rb:578:in `invoke_with_call_chain'
/usr/lib64/ruby/1.8/monitor.rb:242:in `synchronize'
/usr/lib64/ruby/gems/1.8/gems/rake-0.8.3/lib/rake.rb:571:in `invoke_with_call_chain'
/usr/lib64/ruby/gems/1.8/gems/rake-0.8.3/lib/rake.rb:564:in `invoke'
/usr/lib64/ruby/gems/1.8/gems/rake-0.8.3/lib/rake.rb:2019:in `invoke_task'
/usr/lib64/ruby/gems/1.8/gems/rake-0.8.3/lib/rake.rb:1997:in `top_level'
/usr/lib64/ruby/gems/1.8/gems/rake-0.8.3/lib/rake.rb:1997:in `each'
/usr/lib64/ruby/gems/1.8/gems/rake-0.8.3/lib/rake.rb:1997:in `top_level'
/usr/lib64/ruby/gems/1.8/gems/rake-0.8.3/lib/rake.rb:2036:in `standard_exception_handling'
/usr/lib64/ruby/gems/1.8/gems/rake-0.8.3/lib/rake.rb:1991:in `top_level'
/usr/lib64/ruby/gems/1.8/gems/rake-0.8.3/lib/rake.rb:1970:in `run'
/usr/lib64/ruby/gems/1.8/gems/rake-0.8.3/lib/rake.rb:2036:in `standard_exception_handling'
/usr/lib64/ruby/gems/1.8/gems/rake-0.8.3/lib/rake.rb:1967:in `run'
/usr/lib64/ruby/gems/1.8/gems/rake-0.8.3/bin/rake:31
/usr/bin/rake:19:in `load' 
/usr/bin/rake:19
Importing jybox.renchap.com

Comments and changes to this ticket

  • renchap

    renchap January 26th, 2009 @ 01:30 PM

    Found the error. I have SOA records like this in my pdns DB : mara.renchap.com webmaster.renchap.com 2009012101 21600 3600 604800 86400

    The contact email is not valid.

    If i convert them to : mara.renchap.com webmaster@renchap.com 2009012101 21600 3600 604800 86400

    It works. I used this query to convert them : update records set content=regexp_replace(content, E'^(.+ [a-z]+)\.(.+)$', E'\1@\2') where type='SOA';

    Maybe you should handle this case in migration script.

    Using save! or checking save return code here (http://github.com/kennethkalmer/...) can be a good idea, it takes me some times to figure that the SOA record have not be saved due to invalid contact format.

  • Kenneth Kalmer

    Kenneth Kalmer February 4th, 2009 @ 07:51 AM

    • Tag set to bug, import
    • State changed from “new” to “open”

    Good spotting, but it is a tricky assumption to make in the first place. Given my email address is 'kenneth.kalmer (at) gmail.com', in bind style that would make 'kenneth.kalmer.gmail.com', which would in turn be 'kenneth@kalmer.gmail.com'...

    Maybe a prompt for each unique email address found during the import, and then adjusting as we go along?

  • renchap

    renchap February 4th, 2009 @ 09:06 AM

    Does the RFC says anything about this ? Or bind ? If it uses the "all dots format", they should know how to convert it back to standard email format.

    I will have a look at this if I find some time this week.

  • Kenneth Kalmer

    Kenneth Kalmer February 4th, 2009 @ 09:15 AM

    Good point, I'll have a look as well.

  • Kenneth Kalmer

    Kenneth Kalmer February 18th, 2009 @ 03:36 PM

    (from [f79f17c3d314df11cadbee64b1582f17531d8252]) Add support for converting bind-style SOA contacts when encountered [#55] http://github.com/kennethkalmer/...

  • Kenneth Kalmer

    Kenneth Kalmer February 18th, 2009 @ 03:40 PM

    Renchap, I modified the SOA contact address code throughout so it replaces the first period found with an @, but only if no @ is present.

    This seems sound to me, since it will convert old bad-habits as it encounters it instead of throwing a validation error.

    Please re-open the ticket if you encounter another problem with the import process

  • Kenneth Kalmer

    Kenneth Kalmer February 18th, 2009 @ 03:40 PM

    • State changed from “open” to “resolved”

Please Sign in or create a free account to add a new ticket.

With your very own profile, you can contribute to projects, track your activity, watch tickets, receive and update tickets through your email and much more.

New-ticket Create new ticket

Create your profile

Help contribute to this project by taking a few moments to create your personal profile. Create your profile ยป

This issue tracker has been deprecated. Please use the Github issue tracker at https://github.com/kennethkalmer/powerdns-on-rails/issues

Thank you

People watching this ticket

Tags

Referenced by

Pages