OpenCTI fails to start with clean Redis instance
See original GitHub issueDescription
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
- OS (where OpenCTI server runs): Kubernetes 1.18.16-gke.502
- OpenCTI version: OpenCTI 4.4.0
- OpenCTI client: frontend
- Other environment details:
Reproducible Steps
Steps to create the smallest reproducible scenario:
- Run a clean opencti environment (this works from the docker-compose environment too)
- Ensure the environment is initialized, has a user, etc
- Delete redis and its persistent storage
- Create a new instance of redis
- 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:
- Created 2 years ago
- Reactions:1
- Comments:5 (4 by maintainers)
Top 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 >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found

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.
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