digitalocean/droplet_kit

500: {"id": "internal_server_error", "message": "Server was unable to give you a response." } (DropletKit::Error)

msuzoagu opened this issue · 4 comments

Hi, I am attempting to add domains:

  def add_domain(arg)
    display_add_domain_message(arg)
    begin
      client.domains.create(
        DropletKit::Domain.new(name: arg)
      )  
    rescue DropletKit::Error => e 
      display_add_domain_error(e)
    end
  end

and domain records:

  def add_record(record_hash)
    DropletKit::DomainRecord.new(
      type: record_hash[:record_type],
      name: record_hash[:record_name],
      data: record_hash[:record_data]        
    )
  end

but keep running into the error:

retriving account tied to /home/msuzo/configuration/account.key
adding www.dev.uzoagu.com to your cloud provider
422: {"id":"unprocessable_entity","message":"domain 'www.dev.uzoagu.com': name already exists"}
~ $ cli order_certs production
retriving account tied to /home/msuzo/configuration/account.key
adding www.dev.uzoagu.com to your cloud provider
www.dev.uzoagu.com was successfully added to your cloud provider
a resource record was successfully created for www.dev.uzoagu.com
Traceback (most recent call last):
16: from /usr/local/bin/cli:5:in <main>' 15: from /usr/local/bundle/gems/thor-0.20.3/lib/thor/base.rb:466:in start'
14: from /usr/local/bundle/gems/thor-0.20.3/lib/thor.rb:387:in dispatch' 13: from /usr/local/bundle/gems/thor-0.20.3/lib/thor/invocation.rb:126:in invoke_command'
12: from /usr/local/bundle/gems/thor-0.20.3/lib/thor/command.rb:27:in run' 11: from /srv/app/lib/acme.rb:13:in order_certs'
10: from /srv/app/lib/dockers/wrapper.rb:26:in order_certs' 9: from /srv/app/lib/dockers/wrapper.rb:71:in respond_to_challenge'
8: from /srv/app/lib/dockers/cloud_provider.rb:18:in add_txt_challenge' 7: from /srv/app/lib/dockers/cloud_provider.rb:18:in each_with_object'
6: from /srv/app/lib/dockers/cloud_provider.rb:18:in each_pair' 5: from /srv/app/lib/dockers/cloud_provider.rb:29:in block in add_txt_challenge'
4: from /usr/local/bundle/gems/resource_kit-0.1.7/lib/resource_kit/method_factory.rb:16:in block in method_for_action' 3: from /usr/local/bundle/gems/resource_kit-0.1.7/lib/resource_kit/action_invoker.rb:14:in call'
2: from /usr/local/bundle/gems/resource_kit-0.1.7/lib/resource_kit/action_invoker.rb:19:in handle_response' 1: from /usr/local/bundle/gems/resource_kit-0.1.7/lib/resource_kit/action_invoker.rb:19:in instance_exec'
/usr/local/bundle/gems/droplet_kit-2.2.2/lib/droplet_kit/error_handling_resourcable.rb:14:in `block (2 levels) in included': 500: {"id": "internal_server_error", "message": "Server was unable to give you a response." } (DropletKit::Error)

This tool reveals that for each TXT entry attempt:

Domainname   
uzoagu.com

TXT Entry       

Status      
Refused - The name server refuses to perform the specified operation for policy reasons

∑ Queries    
1

∑ Timeout
0

Domainname   
_acme-challenge.uzoagu.com

TXT Entry

Status
Refused - The name server refuses to perform the specified operation for policy reasons

∑ Queries  
1

∑ Timeout
0

Domainname
_acme-challenge.uzoagu.com.uzoagu.com


TXT Entry

Status
Refused - The name server refuses to perform the specified operation for policy reasons

∑ Queries 
1

∑ Timeout
0

How do I resolve this?

I'm getting the same thing when trying to create new droplets, with version 3.0.0. Destroying a droplet and retrieving account info seems to work.

Checked with another install and confirmed that v2.8.0 of the gem is working with the same code to create droplets.

@msuzoagu Were you able to resolve this issue? I'm still getting this error when creating new droplets, but I can open a new issue if your original problem has been resolved.

@nkanderson yes, I did. My issue had to do with incorrect subdomain setup. The internal_srver_error message is a bit cryptic but I suggest taking a look at the setup of your domain records. Hope that helps.

Got it, thanks @msuzoagu. My issue turned out to be a bit different, but I ended up creating an issue and it was resolved upstream.