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

Provide descriptive error when Simple Replay is ran without audit log being available. #583

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 11 additions & 3 deletions src/SimpleReplay/extract.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@
import logging
import os
import re
import sys

import redshift_connector
import threading
import time
Expand Down Expand Up @@ -850,9 +852,15 @@ def get_s3_audit_logs(
else:
curr_index -= 1

logger.debug(
f'First audit log in start_time range: {audit_objects[curr_index]["Key"].split("/")[-1]}'
)
try:
logger.debug(
f'First audit log in start_time range: {audit_objects[curr_index]["Key"].split("/")[-1]}'
)
except IndexError:
logger.fatal(f"There was no user activity log available yet.")
logger.fatal("Make sure audit logging and user activity logging are enabled and await shipment of the logs.")
sys.exit(1)

return (connections, logs, databases, last_connections)


Expand Down