Skip to content

Instantly share code, notes, and snippets.

@abigoroth
Created May 24, 2012 08:46
Show Gist options
  • Save abigoroth/2780266 to your computer and use it in GitHub Desktop.
Save abigoroth/2780266 to your computer and use it in GitHub Desktop.
error bila create subdomain
Started POST "/api/hosts" for 127.0.0.1 at 2012-05-24 16:42:26 +0800
Processing by Api::HostsController#create as JSON
Parameters: {"subdomain"=>"oh", "domain"=>"aik.com", "service"=>"4", "domain_id"=>"aik.com", "host"=>{"domain"=>"aik.com", "subdomain"=>"oh", "service"=>"4"}}
User Load (0.3ms) SELECT `users`.* FROM `users` WHERE `users`.`id` = 3 LIMIT 1
(0.1ms) BEGIN
Host Load (0.2ms) SELECT `hosts`.* FROM `hosts` WHERE `hosts`.`reference1` = 'aik.com' LIMIT 1
CACHE (0.0ms) SELECT `hosts`.* FROM `hosts` WHERE `hosts`.`reference1` = 'aik.com' LIMIT 1
CACHE (0.0ms) SELECT `hosts`.* FROM `hosts` WHERE `hosts`.`reference1` = 'aik.com' LIMIT 1
CACHE (0.0ms) SELECT `hosts`.* FROM `hosts` WHERE `hosts`.`reference1` = 'aik.com' LIMIT 1
oh.aik.com
Host Load (0.2ms) SELECT `hosts`.* FROM `hosts` WHERE `hosts`.`combine` = 'aik.com' LIMIT 1
Zone Load (0.2ms) SELECT `zones`.* FROM `zones` WHERE `zones`.`id` = 26 LIMIT 1
Host Exists (0.4ms) SELECT 1 FROM `hosts` WHERE `hosts`.`combine` = BINARY 'oh.aik.com' LIMIT 1
Host Load (0.3ms) SELECT `hosts`.* FROM `hosts` WHERE (`hosts`.`user_id` = 3 AND `hosts`.`typ` = 1) ORDER BY position DESC LIMIT 1
SQL (44.2ms) INSERT INTO `hosts` (`active`, `combine`, `created_at`, `domain`, `hosts_count`, `mx_count`, `notes`, `position`, `read_only`, `records_count`, `reference1`, `reference2`, `service`, `share`, `share_scope`, `status`, `subdomain`, `typ`, `updated_at`, `user_id`, `zone_id`, `zone_ns`) VALUES (1, 'oh.aik.com', '2012-05-24 08:42:26', 'aik.com', 0, 0, NULL, 1, NULL, 0, 'aik.com', 'oh', 4, 0, NULL, 1, 'oh', 1, '2012-05-24 08:42:26', 3, 26, 0)
Host Load (0.2ms) SELECT `hosts`.* FROM `hosts` WHERE `hosts`.`reference1` = 'aik.com' LIMIT 1
SQL (0.1ms) UPDATE `hosts` SET `hosts_count` = COALESCE(`hosts_count`, 0) + 1 WHERE `hosts`.`id` = 128
Host Load (0.1ms) SELECT `hosts`.* FROM `hosts` WHERE `hosts`.`id` = 129 LIMIT 1
(0.1ms) SELECT COUNT(*) FROM `records` WHERE `records`.`host_id` = 129 AND (record_type NOT IN ('SOA','NS','MX'))
(0.2ms) SELECT COUNT(*) FROM `shorturls` WHERE `shorturls`.`host_id` = 129
CACHE (0.0ms) SELECT `hosts`.* FROM `hosts` WHERE `hosts`.`id` = 129 LIMIT 1
Rripv4 Exists (0.3ms) SELECT 1 FROM `records` WHERE (`records`.`content` = BINARY '202.190.85.237' AND `records`.`user_id` = 3 AND `records`.`host_id` = 129) LIMIT 1
SQL (0.2ms) INSERT INTO `records` (`approval_state`, `content`, `created_at`, `delete_state`, `glue`, `host_id`, `notes`, `read_only`, `record_host`, `record_type`, `ttl`, `updated_at`, `user_id`) VALUES (0, '202.190.85.237', '2012-05-24 08:42:26', 0, 0, 129, NULL, 0, 'oh.aik.com', 'A', '1h', '2012-05-24 08:42:26', 3)
Host Load (0.3ms) SELECT `hosts`.* FROM `hosts` WHERE `hosts`.`id` = 129 LIMIT 1
Zone Load (0.1ms) SELECT `zones`.* FROM `zones` WHERE `zones`.`id` = 26 LIMIT 1
User Load (0.1ms) SELECT `users`.* FROM `users` WHERE `users`.`id` = 3 LIMIT 1
CACHE (0.0ms) SELECT `zones`.* FROM `zones` WHERE `zones`.`id` = 26 LIMIT 1
Record Load (0.2ms) SELECT `records`.* FROM `records` WHERE `records`.`record_host` = 'aik.com' AND `records`.`record_type` = 'SOA' LIMIT 1
(0.4ms) ROLLBACK
Completed 500 Internal Server Error in 136ms
NoMethodError (undefined method `content' for nil:NilClass):
app/models/utils.rb:36:in `increase_soa_record'
app/models/record_utils.rb:28:in `push_update'
app/models/rripv4.rb:17:in `create_record'
app/models/utils.rb:137:in `save_new_service'
app/models/utils.rb:105:in `set_service'
app/models/host.rb:43:in `set_service'
app/controllers/api/hosts_controller.rb:13:in `create'
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment