openstack recordset create does not throw any error when Zero TTL Values are specified

Bug #1674565 reported by Rahul Yadav
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
python-designateclient
Confirmed
Medium
Unassigned

Bug Description

1.Setup Designate Client git clone https://git.openstack.org/openstack-dev/devstack.git -b stable/ocata
2. Setup the credentials.

Issue:
Creating domains with TTL values set to "Zero" does not throw any error and the domain gets created.(status also change first pending than active)

Note: When "0" ttl value is mentioned, no error is thrown and the domain gets created with default value as below.

STEP:1
rahul-vm1@ubunt-VM1:~/devstack$ openstack recordset set example.com. www.example.com. --ttl 10000 --records 192.0.2.20
+-------------+--------------------------------------+
| Field | Value |
+-------------+--------------------------------------+
| action | UPDATE |
| created_at | 2017-03-20T08:26:06.000000 |
| description | None |
| id | f5814a0e-847d-4267-beb2-b08a61d565d7 |
| name | www.example.com. |
| project_id | b8b30cfdc3a0425c86528cb10ad7d1df |
| records | 192.0.2.20 |
| status | PENDING |
| ttl | 10000 |
| type | A |
| updated_at | 2017-03-20T08:37:10.000000 |
| version | 11 |
| zone_id | 64ecf64e-9513-4f5a-bb55-c261deea33be |
| zone_name | example.com. |
+-------------+--------------------------------------+
rahul-vm1@ubunt-VM1:~/devstack$ openstack recordset show example.com. www.example.com.
+-------------+--------------------------------------+
| Field | Value |
+-------------+--------------------------------------+
| action | UPDATE |
| created_at | 2017-03-20T08:26:06.000000 |
| description | None |
| id | f5814a0e-847d-4267-beb2-b08a61d565d7 |
| name | www.example.com. |
| project_id | b8b30cfdc3a0425c86528cb10ad7d1df |
| records | 192.0.2.20 |
| status | PENDING |
| ttl | 10000 |
| type | A |
| updated_at | 2017-03-20T08:37:10.000000 |
| version | 11 |
| zone_id | 64ecf64e-9513-4f5a-bb55-c261deea33be |
| zone_name | example.com. |
+-------------+--------------------------------------+
rahul-vm1@ubunt-VM1:~/devstack$ openstack recordset show example.com. www.example.com.
+-------------+--------------------------------------+
| Field | Value |
+-------------+--------------------------------------+
| action | NONE |
| created_at | 2017-03-20T08:26:06.000000 |
| description | None |
| id | f5814a0e-847d-4267-beb2-b08a61d565d7 |
| name | www.example.com. |
| project_id | b8b30cfdc3a0425c86528cb10ad7d1df |
| records | 192.0.2.20 |
| status | ACTIVE |
| ttl | 10000 |
| type | A |
| updated_at | 2017-03-20T08:37:10.000000 |
| version | 11 |
| zone_id | 64ecf64e-9513-4f5a-bb55-c261deea33be |
| zone_name | example.com. |
+-------------+--------------------------------------+

STEP 2
Now set ttl as -1

rahul-vm1@ubunt-VM1:~/devstack$ openstack recordset set example.com. www.example.com. --ttl -1 --records 192.0.2.20
-1 is less than the minimum of 1

STEP 3
Now set ttl as 0,CLI is executed with status PENDING

rahul-vm1@ubunt-VM1:~/devstack$ openstack recordset set example.com. www.example.com. --ttl 0 --records 192.0.2.20
+-------------+--------------------------------------+
| Field | Value |
+-------------+--------------------------------------+
| action | UPDATE |
| created_at | 2017-03-20T08:26:06.000000 |
| description | None |
| id | f5814a0e-847d-4267-beb2-b08a61d565d7 |
| name | www.example.com. |
| project_id | b8b30cfdc3a0425c86528cb10ad7d1df |
| records | 192.0.2.20 |
| status | PENDING |
| ttl | 10000 |
| type | A |
| updated_at | 2017-03-20T08:38:17.000000 |
| version | 12 |
| zone_id | 64ecf64e-9513-4f5a-bb55-c261deea33be |
| zone_name | example.com. |
+-------------+--------------------------------------|

STEP 4
CLI is executed with status ACTIVE

rahul-vm1@ubunt-VM1:~/devstack$ openstack recordset show example.com. www.example.com.
+-------------+--------------------------------------+
| Field | Value |
+-------------+--------------------------------------+
| action | NONE |
| created_at | 2017-03-20T08:26:06.000000 |
| description | None |
| id | f5814a0e-847d-4267-beb2-b08a61d565d7 |
| name | www.example.com. |
| project_id | b8b30cfdc3a0425c86528cb10ad7d1df |
| records | 192.0.2.20 |
| status | ACTIVE |
| ttl | 10000 |
| type | A |
| updated_at | 2017-03-20T08:38:17.000000 |
| version | 12 |
| zone_id | 64ecf64e-9513-4f5a-bb55-c261deea33be |
| zone_name | example.com. |
+-------------+--------------------------------------+
rahul-vm1@ubunt-VM1:~/devstack$

PLEASE PROVIDE CLARIFICATION ON BELOW ALSO

As per my understanding, the max ttl should be 256 (max hop count) but our system shows max ttl value is 2147483647 . if anyone has any clarification of this plz let me know

Revision history for this message
Tim Simmons (timsim) wrote :

Could you re-run that command with verbose logging on the openstackclient and post those logs? -vvv should do it. Thanks!

summary: - designate domain-create does not throw any error when Zero TTL Values
- are specified
+ openstack recordset create does not throw any error when Zero TTL
+ Values are specified
Revision history for this message
Tim Simmons (timsim) wrote :

Also for your clarification. DNS TTLs are different than IP Packet TTLs. They can be and often are very large. https://en.wikipedia.org/wiki/Time_to_live#DNS_records

Revision history for this message
Rahul Yadav (rahul.y) wrote :
Download full text (30.9 KiB)

Hi Tim,

Thanks for the reply, please find blow debug logs with ttl 0 .

rahul-vm1@vm1:~/devstack$
rahul-vm1@vm1:~/devstack$ openstack zone show rahul.com.
+----------------+--------------------------------------+
| Field | Value |
+----------------+--------------------------------------+
| action | NONE |
| attributes | |
| created_at | 2017-03-23T10:27:24.000000 |
| description | hey hws u |
| email | <email address hidden> |
| id | c2a364d5-2127-413e-9971-9d7de9a091bf |
| masters | |
| name | rahul.com. |
| pool_id | 794ccc2c-d751-44fe-b57f-8894c9f5c842 |
| project_id | 5cde049b52484f30b858507f152b3220 |
| serial | 1490265044 |
| status | ACTIVE |
| transferred_at | None |
| ttl | 11111 |
| type | PRIMARY |
| updated_at | 2017-03-23T10:31:04.000000 |
| version | 11 |
+----------------+--------------------------------------+
rahul-vm1@vm1:~/devstack$
rahul-vm1@vm1:~/devstack$
rahul-vm1@vm1:~/devstack$ openstack --debug zone set --ttl 0 rahul.com.
START with options: [u'--debug', u'zone', u'set', u'--ttl', u'0', u'rahul.com.']
options: Namespace(access_key='', access_secret='***', access_token='***', access_token_endpoint='', access_token_type='', auth_type='', auth_url='http://10.0.4.247:5000/v3', cacert=None, cert='', client_id='', client_secret='***', cloud='', code='', consumer_key='', consumer_secret='***', debug=True, default_domain='default', default_domain_id='', default_domain_name='', deferred_help=False, discovery_endpoint='', domain_id='', domain_name='', endpoint='', identity_provider='', identity_provider_url='', insecure=None, interface='', key='', log_file=None, old_profile=None, openid_scope='', os_baremetal_api_version='1.9', os_beta_command=False, os_compute_api_version='', os_dns_api_version='2', os_identity_api_version='3', os_image_api_version='', os_key_manager_api_version='1', os_network_api_version='', os_object_api_version='', os_orchestration_api_version='1', os_project_id=None, os_project_name=None, os_volume_api_version='2', passcode='', password='***', profile=None, project_domain_id='default', project_domain_name='', project_id='', project_name='admin', protocol='', redirect_uri='', region_name='RegionOne', timing=False, token='***', trust_id='', url='', user_domain_id='default', user_domain_name='', user_id='', username='admin', verbose_level=3, verify=None)
Auth plugin password selected
auth_config_hook(): {'auth_type': 'password', 'beta_command': False, u'compute_api_version': u'2', 'key': None, u'database_api_version': u'1.0', 'cacert': None, 'auth_url': 'http://10.0.4.247:5000/v3', u'network_api_version': u'2', u'message': u'', u'image_format': u'qcow2', 'networks': [], u'image_ap...

Revision history for this message
Rahul Yadav (rahul.y) wrote :
Revision history for this message
Graham Hayes (grahamhayes) wrote :

Looks like the client is treating 0 as null, which means it is not sending the data. need to force the data type of the ttl variable in the client

Tim Simmons (timsim)
affects: designate → python-designateclient
Changed in python-designateclient:
status: New → Confirmed
importance: Undecided → Medium
tags: added: low-hanging-fruit
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.