salt icon indicating copy to clipboard operation
salt copied to clipboard

boto_route53 state erroring on highstate repeat

Open Lomexian opened this issue 10 years ago • 4 comments

Description of Issue/Question

Initial highstating works fine and Route53 DNS records are created. Subsequent highstate runs result in an error stating they already exist. As a state this should exit gracefully as it is already compliant with state. Additionally it would be nice if the state file could update records when an IP changes.

Setup

master.sls

python-pip:
  pkg.installed

boto:
  pip.installed:
    - name: boto3
    - require:
      - pkg: python-pip

DNSrecord:
  boto_route53.present:
    - name: dns.name.com
    - value: {{pubip}}
    - zone: name.com.
    - ttl: 60
    - record_type: A
    - region: us-east-1
    - profile: route53
    - require:
      - boto

Error

          ID: DNSrecord
    Function: boto_route53.present
        Name: dns.name.com
      Result: False
     Comment: An exception occurred in this state: Traceback (most recent call last):
                File "/usr/lib/python2.7/site-packages/salt/state.py", line 1723, in call
                  **cdata['kwargs'])
                File "/usr/lib/python2.7/site-packages/salt/loader.py", line 1650, in wrapper
                  return f(*args, **kwargs)
                File "/usr/lib/python2.7/site-packages/salt/states/boto_route53.py", line 172, in present
                  split_dns, private_zone)
                File "/usr/lib/python2.7/site-packages/salt/modules/boto_route53.py", line 357, in add_record
                  raise e
              DNSServerError: DNSServerError: 400 Bad Request
              <?xml version="1.0"?>
              <ErrorResponse xmlns="https://route53.amazonaws.com/doc/2013-04-01/"><Error><Type>Sender</Type><Code>InvalidChangeBatch</Code><Message>Tried to create resource record set [name='dns.name.com.', type='A'] but it already exists</Message></Error><RequestId>3f5ad078-533f-11e6-bbeb-d7f94d173854</RequestId></ErrorResponse>
     Started: 15:42:58.632922
    Duration: 704.429 ms
     Changes:

Versions Report

Salt Version:
           Salt: 2016.3.1

Dependency Versions:
           cffi: Not Installed
       cherrypy: Not Installed
       dateutil: 2.5.3
          gitdb: Not Installed
      gitpython: Not Installed
          ioflo: Not Installed
         Jinja2: 2.7.2
        libgit2: Not Installed
        libnacl: Not Installed
       M2Crypto: 0.21.1
           Mako: Not Installed
   msgpack-pure: Not Installed
 msgpack-python: 0.4.7
   mysql-python: Not Installed
      pycparser: Not Installed
       pycrypto: 2.6.1
         pygit2: Not Installed
         Python: 2.7.5 (default, Nov 20 2015, 02:00:19)
   python-gnupg: Not Installed
         PyYAML: 3.11
          PyZMQ: 14.7.0
           RAET: Not Installed
          smmap: Not Installed
        timelib: Not Installed
        Tornado: 4.2.1
            ZMQ: 4.0.5

System Versions:
           dist: centos 7.2.1511 Core
        machine: x86_64
        release: 3.10.0-327.el7.x86_64
         system: Linux
        version: CentOS Linux 7.2.1511 Core

minions/master are at the same level. Boto 2.42 is installed

Lomexian avatar Jul 26 '16 14:07 Lomexian

@Lomexian looks like you might be running into the same issue here #23358 . Does this look similiar to your issue?

Ch3LL avatar Jul 27 '16 17:07 Ch3LL

Doesn't look like it. The refered issue was more due to rate - they had 150 entries, I have only 3. Their error bares out a rate issue <ErrorResponse xmlns="https://route53.amazonaws.com/doc/2013-04-01/"><Error><Type>Sender</Type><Code>Throttling</Code><Message>Rate exceeded</Message></Error><RequestId>1723b95b-f2bf-11e4-b864-33bc3e543038</RequestId></ErrorResponse>

Whereas my issue is related to these records already existing <ErrorResponse xmlns="https://route53.amazonaws.com/doc/2013-04-01/"><Error><Type>Sender</Type><Code>InvalidChangeBatch</Code><Message>Tried to create resource record set [name='dns.name.com.', type='A'] but it already exists</Message></Error><RequestId>3f5ad078-533f-11e6-bbeb-d7f94d173854</RequestId></ErrorResponse>

Lomexian avatar Jul 28 '16 07:07 Lomexian

FYI the issue is also exhibiting in boto_elb state when attempting to use the cname function.

Lomexian avatar Sep 05 '16 08:09 Lomexian

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

If this issue is closed prematurely, please leave a comment and we will gladly reopen the issue.

stale[bot] avatar Jun 27 '18 08:06 stale[bot]