dmarchelya / BespokeDynamicDnsUpdater

Dynamic DNS Updater Client for a number of DDNS Services
http://bespokeindustries.com/products/bespoke-dynamic-dns-updater
7 stars 4 forks source link

Route 53 Update fails ("already exists") #1

Open rjoffe opened 10 years ago

rjoffe commented 10 years ago

I am able to create a new entry, but unable to update it after creation.

Error I get is:

2013-11-14 20:00:59.5431 ERROR Bespoke.DynamicDnsUpdater.Client.Route53.Route53Client.UpdateHostname Amazon.Route53.Model.InvalidChangeBatchExcep tion: Tried to create resource record set [name='xxx.xxx.com', type='A'] but it already exists ---> System.Net.WebException: The remote server returned an error: (400) Bad Request. at System.Net.HttpWebRequest.GetResponse() at Amazon.Runtime.AmazonWebServiceClient.getResponseCallback(IAsyncResult result) --- End of inner exception stack trace --- at Amazon.Runtime.AmazonWebServiceClient.handleHttpWebErrorResponse(AsyncResult asyncResult, WebException we) at Amazon.Runtime.AmazonWebServiceClient.getResponseCallback(IAsyncResult result) at Amazon.Runtime.AmazonWebServiceClient.endOperation[T](IAsyncResult result) at Bespoke.DynamicDnsUpdater.Client.Route53.Route53Client.UpdateHostname(String hostname, String ipAddress) in c:\TeamCity\buildAgent\work\2a3 d4f1fc922d732\Source\Bespoke.DynamicDnsUpdater.Client\Route53\Route53Client.cs:line 85

dmarchelya commented 10 years ago

In order to update Route 53 records, the Updater must first delete the existing DNS record for that hostname with Route 53. And in order to delete the existing record, Amazon requires that a hostname and matching IP Address for the existing record be submitted to successfully delete the existing record.

The Updater has caching layers that it depends on to perform an update, primarily in the public DNS infrastructure, as well as internally in the program.

Possible scenarios that could result in this error:

1) You have not configured your domain registrar to point at the Amazon nameservers for your domain, and are instead pointed at your domain registrar defaults, or other nameservers. When you try to do a lookup for xxx.xxx.com, it is returning a different IP address than what you have set at Route 53 (such as default IP addresses for placeholder pages with your domain registrar), resulting in this condition.

2) You are executing a change to the xxx.xxx.com IP address using other DNS management tools, possibly outside of the Bespoke DDNS Updater, and trying to update the value with the Updater before DNS caching expires/updates, resulting in a bad delete request.

Can you successfully run the console application for this hostname (especially using the -force option, to rule out application caching)? Is the issue only with a TeamCity Build?

I have been able to successfully reproduce the error, and then to eliminate it by accounting for both of the two scenarios above.

rjoffe commented 10 years ago

This domain is not yet out in the wild, and therefore scenario #1 in your reply is failing.

I will retest once we have moved it into production.

Thanks for the reply.