question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

OpenCTI fails to start with clean Redis instance

See original GitHub issue

Description

If starting OpenCTI that has already been initialized and the redis instance has been replaced, thus missing stream.opencti, then opencti will fail to start with the following logs:

{"category":"APP","version":"4.4.0","level":"info","message":"[OPENCTI] Servers ready on port 8080","timestamp":"2021-04-16T15:19:58.526Z"}
node:internal/process/promises:245
          triggerUncaughtException(err, true /* fromPromise */);
          ^
ReplyError: ERR no such key
    at ue (/opt/opencti/build/index.js:1:85637)
    at i (/opt/opencti/build/index.js:1:86101)
    at /opt/opencti/build/index.js:1:86401
    at Object.start (/opt/opencti/build/index.js:1:86444)
    at processTicksAndRejections (node:internal/process/task_queues:94:5)
    at async xt (/opt/opencti/build/index.js:1:227086) {
  command: { name: 'XINFO', args: [ 'STREAM', 'stream.opencti' ] }
}

Environment

  1. OS (where OpenCTI server runs): Kubernetes 1.18.16-gke.502
  2. OpenCTI version: OpenCTI 4.4.0
  3. OpenCTI client: frontend
  4. Other environment details:

Reproducible Steps

Steps to create the smallest reproducible scenario:

  1. Run a clean opencti environment (this works from the docker-compose environment too)
  2. Ensure the environment is initialized, has a user, etc
  3. Delete redis and its persistent storage
  4. Create a new instance of redis
  5. Restart opencti

Expected Output

I expected that anything in the current work queue of OpenCTI would be lost, but that it would re-initialize redis with a clean work queue

Actual Output

OpenCTI fails to read information about the stream stream.opencti and crashes.

Additional information

I understand this isn’t a desirable state to be in and it shouldn’t happen, but sometimes Redis crashes and there’s not a smooth process to recover from this.

Issue Analytics

  • State:closed
  • Created 2 years ago
  • Reactions:1
  • Comments:5 (4 by maintainers)

github_iconTop GitHub Comments

1reaction
richard-juliencommented, Apr 23, 2021

If you had this problem after upgrade you have a problem in your install configuration. Data from redis must not be loss after a container upgrade/restart.

0reactions
mwatermolencommented, May 10, 2021

Seems to be affecting docker version 4.50, when I spin up everything in Kubernetes … For visibility https://github.com/OpenCTI-Platform/docker/issues/26

Read more comments on GitHub >

github_iconTop Results From Across the Web

OpenCTI Installation HowTo - LinkedIn
I am finding most people seem to struggle understanding and configuring the connectors portion of the installation. Without the connectors ...
Read more >
Try send data to OpenCTI - Stack Overflow
I am trying to send data to my server (Opencti). This data is a migration from one internal database to Opencti. Apparently, the...
Read more >
Quickstart: Use Azure Cache for Redis with Go - Microsoft Learn
The main function starts off by reading the host name and password (Access Key) for the Azure Cache for Redis instance.
Read more >
OpenCTI & STIX - OASIS Open
OpenCTI & STIX ... Develop Open Source software when a clear gap is identified in available ... Server-Sent-Event using Redis Stream.
Read more >
OpenCTI data sharing - Filigran
This stream is a low level stream directly written in our Redis database. Every time something is written in OpenCTI, the platform stores ......
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found