Skip to content

Exit Codes

nicolemah99 edited this page Jul 25, 2024 · 3 revisions

Exit Codes

This page provides an explanation of the exit codes used in the data pipeline scripts. These codes help to understand the outcome of script execution and diagnose issues when they occur.

Summary of Exit Codes

Category Exit Code Code Description
General Execution Codes STREAMS_SUCCESS 0 Successful completion.
STREAMS_SIGINT 130 Script interrupted by SIGINT (Ctrl+C).
STREAMS_SIGQUIT 131 Script interrupted by SIGQUIT (Ctrl+\ ).
STREAMS_SIGTERM 143 Script terminated by SIGTERM.
STREAMS_UNKNOWN 199 Unknown error.
Argument and Configuration STREAMS_INVALID_ARGS 200 Invalid arguments provided.
STREAMS_INVALID_CONFIG 201 Invalid or missing critical configuration values.
File and Directory Errors STREAMS_FILE_NOT_FOUND 210 Required file not found.
STREAMS_FILE_CREATION_FAIL 211 Failed to create file.
STREAMS_DIR_NOT_FOUND 212 Directory does not exist.
STREAMS_DIR_CREATION_FAIL 213 Failed to create directory.
Command Errors STREAMS_LFTP_FAIL 220 LFTP command failed.
STREAMS_RSYNC_FAIL 221 Rsync command failed.
Specific Operation Errors STREAMS_DOWNLOAD_FAIL 230 File download failure.
STREAMS_ZIP_FAIL 231 Compression/zipping failure.
STREAMS_METADATA_FAIL 232 Metadata/Checksum creation or file generation failure.
STREAMS_LOCK_FAIL 233 Failed to acquire lock.

Detailed Explanation of Exit Codes

General Execution Codes

STREAMS_SUCCESS

  • Code: 0
  • Description: Successful completion.
  • When Encountered: The script completed all its tasks without errors.

STREAMS_SIGINT

  • Code: 130
  • Description: Script interrupted by SIGINT (Ctrl+C).
  • When Encountered: The user manually stopped the script using Ctrl+C.

STREAMS_SIGQUIT

  • Code: 131
  • Description: Script interrupted by SIGQUIT (Ctrl+).
  • When Encountered: The user manually stopped the script using Ctrl+.

STREAMS_SIGTERM

  • Code: 143
  • Description: Script terminated by SIGTERM.
  • When Encountered: The script was terminated by a SIGTERM signal, possibly from a system shutdown or kill command.

STREAMS_UNKNOWN

  • Code: 199
  • Description: Unknown error.
  • When Encountered: An unexpected error occurred that doesn't match any predefined conditions.

Argument and Configuration Errors

STREAMS_INVALID_ARGS

  • Code: 200
  • Description: Invalid arguments provided.
  • When Encountered: The script received incorrect or insufficient command-line arguments.

STREAMS_INVALID_CONFIG

  • Code: 201
  • Description: Invalid or missing critical configuration values.
  • When Encountered: Required configuration settings are missing or incorrect.

File and Directory Errors

STREAMS_FILE_NOT_FOUND

  • Code: 210
  • Description: Required file not found.
  • When Encountered: A necessary file does not exist at the expected location.

STREAMS_FILE_CREATION_FAIL

  • Code: 211
  • Description: Failed to create file.
  • When Encountered: The script was unable to create a file, possibly due to permissions or disk space issues.

STREAMS_DIR_NOT_FOUND

  • Code: 212
  • Description: Directory does not exist.
  • When Encountered: A required directory is missing, check logs.

STREAMS_DIR_CREATION_FAIL

  • Code: 213
  • Description: Failed to create directory.
  • When Encountered: The script was unable to create a directory, possibly due to permissions or disk space issues.

Command Errors

STREAMS_LFTP_FAIL

  • Code: 220
  • Description: LFTP command failed.
  • When Encountered: The LFTP command used for file transfers encountered an error, possibly due to connection or network issues.

STREAMS_RSYNC_FAIL

  • Code: 221
  • Description: Rsync command failed.
  • When Encountered: The rsync command used for synchronizing files encountered an error.

Specific Operation Errors

STREAMS_DOWNLOAD_FAIL

  • Code: 230
  • Description: File download failure.
  • When Encountered: The script was unable to download a file, possibly due to network issues or incorrect URLs.

STREAMS_ZIP_FAIL

  • Code: 231
  • Description: Compression/zipping failure.
  • When Encountered: The script encountered an error while compressing files.

STREAMS_METADATA_FAIL

  • Code: 232
  • Description: Metadata/Checksum creation or file generation failure.
  • When Encountered: There was an error generating metadata or checksums for files.

STREAMS_LOCK_FAIL

  • Code: 233
  • Description: Failed to acquire lock.
  • When Encountered: The script could not acquire a lock, which is necessary to prevent concurrent modifications.