Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Time Zone Error with sql_db_export #274

Open
jakeheut opened this issue Mar 26, 2021 · 0 comments
Open

Time Zone Error with sql_db_export #274

jakeheut opened this issue Mar 26, 2021 · 0 comments
Labels

Comments

@jakeheut
Copy link

Expected Behavior

When running:

rubrik.sql_db_export(db_name, date, time, sql_instance, sql_host, target_instance_name, target_hostname, target_database_name, target_data_file_path, target_log_file_path, allow_overwrite=True)

The time variable should be in %H:%M %p or be equal to latest using cluster local time and the export will be executed using the snapshot at that time.

Current Behavior

The time variable finds the correct existing snapshot but then translates the time zone to client local time when running the POST command for the export, causing an export failure.

Failure Information (for bugs)

Using time='latest' or an exact time, the API finds the correct snapshot but then changes the time zone for the POST command, this example is running from client in PST on a cluster in UTC using 02:00 AM as the timestamp (on March 26th):

Traceback (most recent call last): sql_db_export = rubrik.sql_db_export(db_name, File "/Library/Frameworks/Python.framework/Versions/3.9/lib/python3.9/site-packages/rubrik_cdm/data_management.py", line 2561, in sql_db_export return self.post('v1', '/mssql/db/{}/export'.format(mssql_id), config, timeout) File "/Library/Frameworks/Python.framework/Versions/3.9/lib/python3.9/site-packages/rubrik_cdm/api.py", line 249, in post return self._common_api( File "/Library/Frameworks/Python.framework/Versions/3.9/lib/python3.9/site-packages/rubrik_cdm/api.py", line 168, in _common_api raise APICallException(error_message) rubrik_cdm.exceptions.APICallException: Cannot recover database to time Mar 26, 2021 09:00:00 GMT.

This function should be modified to either not translate the time zone or to only translate it if they're on different time zones. Right now it does it regardless, so if you adjust to your local time it will still fail.

Steps to Reproduce

Use sql_db_export on a Rubrik cluster that has a different time zone then the client.

This is remediated if you set an environmental variable before running Python (i.e. TZ="Europe/London" python3 script.py)

Context

Running CDM 5.3.0-p3-18540

@jakeheut jakeheut mentioned this issue Sep 9, 2021
10 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant