Logo
2022.1.6

Contents:

  • Getting Started
    • Preparing Your Machine to Install SQream
    • Installing SQream
    • Executing Statements in SQream
    • Performing Basic SQream Operations
      • Running the SQream SQL Client
      • Creating Your First Table
      • Listing Tables
      • Inserting Rows
      • Running Queries
      • Deleting Rows
      • Saving Query Results to a CSV or PSV File
    • Hardware Guide
  • Installation Guides
    • Installing and Launching SQream
      • Recommended Pre-Installation Configuration
      • Installing SQream Using Binary Packages
      • Installing and Running SQream in a Docker Container
      • Installing SQream with Kubernetes
      • Installing Monit
      • Launching SQream with Monit
    • Installing SQream Studio
      • Installing Prometheus Exporter
      • Installing Prometheus Using Binary Packages
      • Installing the Dashboard Data Collector
      • Installing Studio on a Stand-Alone Server
      • Installing an NGINX Proxy Over a Secure Connection
  • Data Ingestion Sources
    • Inserting Data Overview
    • Inserting Data from Avro
    • Inserting Data from a CSV File
    • Inserting Data from a Parquet File
    • Inserting Data from an ORC File
  • Connecting to SQream
    • Client Platforms
      • Connect to SQream Using Informatica Cloud Services
      • MicroStrategy
      • Connecting to SQream Using Pentaho Data Integration
      • Connect to SQream Using PHP
      • Connect to SQream Using Power BI Desktop
      • Connect to SQream Using R
      • Connecting to SQream Using SAP BusinessObjects
      • SAS Viya
      • Connect to SQream Using SQL Workbench
      • Connecting to SQream Using Tableau
      • Connecting to SQream Using Talend
      • Connecting to SQream Using TIBCO Spotfire
    • Client Drivers
      • JDBC
      • Connecting to SQream Using Python (pysqream)
      • Node.JS
      • ODBC
        • Install and Configure ODBC on Windows
        • Install and configure ODBC on Linux
      • .NET
  • External Storage Platforms
    • Inserting Data Using Amazon S3
    • Using SQream in an HDFS Environment
  • Loading and Unloading Data
  • Feature Guides
    • Automatic Foreign Table DDL Resolution
    • Query Healer
    • Data Encryption
      • Overview
      • Encryption Methods
      • Data Types
      • Syntax
      • Permissions
    • Compression
    • Python UDF (User-Defined Functions)
    • Workload Manager
    • Concurrency and Locks
    • Concurrency and Scaling in SQream DB
  • Operational Guides
    • Access Control
      • Password Policy
      • Overview
      • Managing Roles
      • Permissions
      • Departmental Example
    • Creating or Cloning Storage Clusters
    • Working with External Data
      • Inserting Data Using Amazon S3
      • Using SQream in an HDFS Environment
    • Foreign Tables
    • Deleting Data
    • Exporting Data
    • Logging
    • Monitoring Query Performance
    • Security
    • Saved Queries
    • Seeing System Objects as DDL
    • Optimization and Best Practices
  • SQream Acceleration Studio 5.4.7
    • Getting Started with SQream Acceleration Studio 5.4.7
    • Monitoring Workers and Services from the Dashboard
    • Executing Statements and Running Queries from the Editor
    • Viewing Logs
    • Creating, Assigning, and Managing Roles and Permissions
    • Configuring Your Instance of SQreams
  • System Architecture
    • Internals and architecture
    • Filesystem and usage
  • Configuration Guides
    • Configuring the Spooling Feature
    • Configuring SQream
      • Configuration Levels
      • Flag Types
      • Configuration Roles
      • Modification Methods
      • Configuring Your Parameter Values
      • Command Examples
      • Showing All Flags in the Catalog Table
      • All Configurations
    • Configuration Flags
      • Administration Flags
        • Regular Administration Flags
        • Cluster Administration Flags
        • Worker Administration Flags
      • Generic Flags
        • Regular Generic Flags
        • Worker Generic Flags
    • Configuring SQream Using the Previous Configuration Method
  • Reference Guides
    • SQL Statements and Syntax
      • SQL Syntax Features
      • SQL Statements
      • SQL Functions
        • Built-In Scalar Functions
        • User-Defined Functions
        • Aggregate Functions
        • Window Functions
    • Catalog Reference Guide
      • Overview
      • What Information Does the Schema Contain?
      • Catalog Tables
      • Additional Tables
      • Examples
    • Command line programs
      • metadata_server
      • sqreamd
      • sqream-console
      • sqream-installer
      • server_picker
      • SqreamStorage
      • sqream sql
      • upgrade_storage
    • SQL Feature Checklist
  • Data Type Guides
    • Converting and Casting Types
    • Supported Data Types
    • Supported Casts
      • Numeric
      • Boolean
      • Integer
      • Floating Point
      • String
      • Date
  • Release Notes
    • Release Notes 2022.1
      • Release Notes 2022.1.6
      • Release Notes 2022.1.5
      • Release Notes 2022.1.4
      • Release Notes 2022.1.3
      • Release Notes 2022.1.2
      • Release Notes 2022.1.1
      • Release Notes 2022.1
    • Release Notes 2021.2
      • Release Notes 2021.2.1.24
      • Release Notes 2021.2.1
      • Release Notes 2021.2
    • Release Notes 2021.1
      • Release Notes 2021.1.2
      • Release Notes 2021.1
    • Release Notes 2020.3
      • Release Notes 2020.3.2.1
      • What’s new in 2020.3.2
      • Release Notes 2020.3.1
      • Release Notes 2020.3
    • Release Notes 2020.2
    • Release Notes 2020.1
  • Troubleshooting
    • Remedying Slow Queries
    • Resolving Common Issues
    • Examining Logs
    • Identifying Configuration Issues
    • Lock Related Issues
    • Log Related Issues
    • Core Dumping Related Issues
    • Gathering Information for SQream Support
  • Glossary
SQream DB
  • Troubleshooting
  • Log Related Issues

Log Related Issues

The Log Related Issues page describes how to resolve the following common issues:

Loading Logs with Foreign Tables

Assuming logs are stored at /home/rhendricks/sqream_storage/logs/, a database administrator can access the logs using the external_tables concept through SQream DB.

CREATE FOREIGN TABLE logs
(
  start_marker      TEXT(4),
  row_id            BIGINT,
  timestamp         DATETIME,
  message_level     TEXT,
  thread_id         TEXT,
  worker_hostname   TEXT,
  worker_port       INT,
  connection_id     INT,
  database_name     TEXT,
  user_name         TEXT,
  statement_id      INT,
  service_name      TEXT,
  message_type_id   INT,
  message           TEXT,
  end_message       TEXT(5)
)
WRAPPER csv_fdw
OPTIONS
  (
     LOCATION = '/home/rhendricks/sqream_storage/logs/**/sqream*.log',
     DELIMITER = '|',
     CONTINUE_ON_ERROR = true
  )
;

For more information, see Loading Logs with Foreign Tables.

Counting Message Types

t=> SELECT message_type_id, COUNT(*) FROM logs GROUP BY 1;
message_type_id | count
----------------+----------
              0 |         9
              1 |      5578
              4 |      2319
             10 |      2788
             20 |       549
             30 |       411
             31 |      1720
             32 |      1720
            100 |      2592
            101 |      2598
            110 |      2571
            200 |        11
            500 |       136
           1000 |        19
           1003 |        19
           1004 |        19
           1010 |         5

Finding Fatal Errors

t=> SELECT message FROM logs WHERE message_type_id=1010;
Internal Runtime Error,open cluster metadata database:IO error: lock /home/rhendricks/sqream_storage/rocksdb/LOCK: Resource temporarily unavailable
Internal Runtime Error,open cluster metadata database:IO error: lock /home/rhendricks/sqream_storage/rocksdb/LOCK: Resource temporarily unavailable
Mismatch in storage version, upgrade is needed,Storage version: 25, Server version is: 26
Mismatch in storage version, upgrade is needed,Storage version: 25, Server version is: 26
Internal Runtime Error,open cluster metadata database:IO error: lock /home/rhendricks/sqream_storage/LOCK: Resource temporarily unavailable

Countng Error Events Within a Certain Timeframe

t=> SELECT message_type_id,
.          COUNT(*)
.   FROM logs
.   WHERE message_type_id IN (1010,500)
.   AND timestamp BETWEEN '2019-12-20' AND '2020-01-01'
.   GROUP BY 1;
message_type_id | count
----------------+------
            500 |    18
           1010 |     3

Tracing Errors to Find Offending Statements

If we know an error occured, but don’t know which statement caused it, we can find it using the connection ID and statement ID.

t=> SELECT connection_id, statement_id, message
.     FROM logs
.     WHERE message_level = 'ERROR'
.     AND timestamp BETWEEN '2020-01-01' AND '2020-01-06';
connection_id | statement_id | message
--------------+--------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------
           79 |           67 | Column type mismatch, expected UByte, got INT64 on column Number, file name: /home/sqream/nba.parquet

Use the connection_id and statement_id to narrow down the results.

t=>   SELECT database_name, message FROM logs
.       WHERE connection_id=79 AND statement_id=67 AND message_type_id=1;
database_name | message
--------------+--------------------------
master        | Query before parsing
master        | SELECT * FROM nba_parquet
Previous Next

© Copyright 2022 SQream. Revision a91fce75.