-
Notifications
You must be signed in to change notification settings - Fork 800
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
Error during upgrade from 5.8.7 to 5.9.x #4038
Comments
@SamuelHassine any recommendation on how to upgrade from 5.8.7 to 5.9.6? |
@Archidoit You mean before = 5.8.7 --> 5.9.0 -->5.9.1 --> 5.9.2 etc..? |
Maybe try to run the migrations until the one that fails (triggers-remove-unused-field). Then run the triggers-remove-unused-field migration and the following ones. |
@Archidoit how do we proceed with running individual migration one-by-one? I am not familiar with any documentation or playbook for this operation. I found the mentionned |
The migration scripts
After removing those two migration script, and rebuilding opencti, the instance starts normally.
|
@richard-julien , I believe this ticket is a follow-up issue of #3999 ... It is still unclear to us why those scripts were failing the upgrade since we have NO entities of type Also I would like to confirm that before and while attempting upgrade, when running |
Like i try to explain this is an issue with opensearch.
This is clearly opensearch that fail to get information from a task that is just created. Maybe the task is started on a node that then can not answer the query in the cluster ... i dont know. Can you ask the AWS opensearch support if they are aware of this kind of situation? For info, rebuilding and removing some migrations have a huge potential of causing serious problem on your platform in the future, and so of course highly NOT recommanded :) |
Yep, happy to close the ticket, understand we have to follow-up with AWS support |
Thanks for the update. Please keep us informed about your discussion with AWS. Maybe I miss understand something and we need to do something differently in the product. |
Description
I have fully working OpenCTI on 5.8.7 version and I would love to upgrade it to latest version.
Unfortunately, during upgrade to 5.9.6 version, OpenCTI is not possible to start. Issue with tasks and migration. See errors below.
OpenCTI in version 5.8.7 is working without any issues.
Environment
Reproducible Steps
Steps to create the smallest reproducible scenario:
Expected Output
OpenCTI is able to run
Actual Output
{"category":"APP","level":"info","message":"[OPENCTI] Starting platform","timestamp":"2023-08-10T11:05:16.215Z","version":"5.9.6"} {"category":"APP","level":"info","message":"[OPENCTI] Checking dependencies statuses","timestamp":"2023-08-10T11:05:16.217Z","version":"5.9.6"} {"category":"APP","level":"info","message":"[SEARCH] OpenSearch (2.3.0) client selected / runtime sorting disabled","timestamp":"2023-08-10T11:05:16.306Z","version":"5.9.6"} {"category":"APP","level":"info","message":"[CHECK] Search engine is alive","timestamp":"2023-08-10T11:05:16.307Z","version":"5.9.6"} {"category":"APP","level":"info","message":"[CHECK] Minio is alive","timestamp":"2023-08-10T11:05:16.328Z","version":"5.9.6"} {"category":"APP","level":"info","message":"[CHECK] RabbitMQ is alive","timestamp":"2023-08-10T11:05:16.392Z","version":"5.9.6"} {"category":"APP","level":"info","message":"[REDIS] Redis 'base' client ready","timestamp":"2023-08-10T11:05:16.399Z","version":"5.9.6"} {"category":"APP","level":"info","message":"[REDIS] Clients initialized in Single mode","timestamp":"2023-08-10T11:05:16.399Z","version":"5.9.6"} {"category":"APP","level":"info","message":"[CHECK] Redis is alive","timestamp":"2023-08-10T11:05:16.400Z","version":"5.9.6"} {"category":"APP","level":"warn","message":"[CHECK] SMTP seems down, email notification will may not work","timestamp":"2023-08-10T11:05:16.408Z","version":"5.9.6"} {"category":"APP","level":"info","message":"[CHECK] Python3 is available","timestamp":"2023-08-10T11:05:16.442Z","version":"5.9.6"} {"category":"APP","level":"info","message":"[REDIS] Redis 'subscriber' client ready","timestamp":"2023-08-10T11:05:16.445Z","version":"5.9.6"} {"category":"APP","level":"info","message":"[OPENCTI-MODULE] Cache manager pub sub listener initialized","timestamp":"2023-08-10T11:05:16.446Z","version":"5.9.6"} {"category":"APP","level":"info","message":"[REDIS] Redis 'lock' client ready","timestamp":"2023-08-10T11:05:16.449Z","version":"5.9.6"} {"category":"APP","level":"info","message":"[INIT] Starting platform initialization","timestamp":"2023-08-10T11:05:16.450Z","version":"5.9.6"} {"category":"APP","level":"info","message":"[INIT] Existing platform detected, initialization...","timestamp":"2023-08-10T11:05:16.480Z","version":"5.9.6"} {"category":"APP","level":"info","message":"[INIT] admin user initialized","timestamp":"2023-08-10T11:05:17.549Z","version":"5.9.6"} {"category":"APP","level":"info","message":"[MIGRATION] Read 3 migrations from the database","timestamp":"2023-08-10T11:05:17.692Z","version":"5.9.6"} {"category":"APP","level":"info","message":"[MIGRATION] 6 migrations will be executed","timestamp":"2023-08-10T11:05:17.694Z","version":"5.9.6"} {"category":"APP","level":"info","message":"[MIGRATION] Triggers remove unused fields: recipients, user_ids, group_ids","timestamp":"2023-08-10T11:05:17.694Z","version":"5.9.6"} {"category":"APP","level":"info","message":"[MIGRATION] Triggers remove unused fields: recipients, user_ids, group_ids > started","timestamp":"2023-08-10T11:05:17.695Z","version":"5.9.6"} {"category":"APP","level":"info","message":"[MIGRATION] Triggers remove unused fields: recipients, user_ids, group_ids > elastic running task QOFSwWvIQHS87tX4eRdoOA:11339386","timestamp":"2023-08-10T11:05:17.707Z","version":"5.9.6"} {"category":"APP","error":{"context":{"category":"technical","error":{"meta":{"body":{"error":{"reason":"task [QOFSwWvIQHS87tX4eRdoOA:11339386] isn't running and hasn't stored its results","root_cause":[{"reason":"task [QOFSwWvIQHS87tX4eRdoOA:11339386] isn't running and hasn't stored its results","type":"resource_not_found_exception"}],"type":"resource_not_found_exception"},"status":404},"headers":{"access-control-allow-origin":"*","connection":"keep-alive","content-length":"305","content-type":"application/json; charset=UTF-8","date":"Thu, 10 Aug 2023 11:05:27 GMT"},"meta":{"aborted":false,"attempts":0,"connection":{"_openRequests":0,"deadCount":0,"headers":{},"id":"https://opensearch_endpoint","resurrectTimeout":0,"roles":{"data":true,"ingest":true},"status":"alive","url":"https://opensearch_endpoint/"},"context":null,"name":"opensearch-js","request":{"id":28,"options":{},"params":{"body":null,"headers":{"user-agent":"opensearch-js/2.3.0 (linux 5.4.242-155.348.amzn2.x86_64-x64; Node.js v20.4.0)"},"method":"GET","path":"/_tasks/QOFSwWvIQHS87tX4eRdoOA%3A11339386","querystring":"","timeout":30000}}},"statusCode":404},"name":"ResponseError"},"http_status":500,"reason":"Error updating elastic"},"message":"A database error has occurred","name":"DatabaseError","stack":"DatabaseError: A database error has occurred\n at error (/opt/opencti/build/src/config/errors.js:8:10)\n at DatabaseError (/opt/opencti/build/src/config/errors.js:54:48)\n at /opt/opencti/build/src/migrations/1687529127415-triggers-remove-unused-field.js:47:11\n at processTicksAndRejections (node:internal/process/task_queues:95:5)\n at oqs.up (/opt/opencti/build/src/migrations/1687529127415-triggers-remove-unused-field.js:52:3)"},"level":"error","message":"[MIGRATION] Error during migration","timestamp":"2023-08-10T11:05:27.718Z","version":"5.9.6"} {"category":"APP","level":"info","message":"[INIT] Platform initialization done","timestamp":"2023-08-10T11:05:27.720Z","version":"5.9.6"} {"category":"APP","error":{"context":{"category":"technical","error":{"_error":{},"_showLocations":false,"_showPath":false,"_stack":"DatabaseError: A database error has occurred\n at error (/opt/opencti/build/src/config/errors.js:8:10)\n at DatabaseError (/opt/opencti/build/src/config/errors.js:54:48)\n at /opt/opencti/build/src/migrations/1687529127415-triggers-remove-unused-field.js:47:11\n at processTicksAndRejections (node:internal/process/task_queues:95:5)\n at oqs.up (/opt/opencti/build/src/migrations/1687529127415-triggers-remove-unused-field.js:52:3)","data":{"category":"technical","error":{"meta":{"body":{"error":{"reason":"task [QOFSwWvIQHS87tX4eRdoOA:11339386] isn't running and hasn't stored its results","root_cause":[{"reason":"task [QOFSwWvIQHS87tX4eRdoOA:11339386] isn't running and hasn't stored its results","type":"resource_not_found_exception"}],"type":"resource_not_found_exception"},"status":404},"headers":{"access-control-allow-origin":"*","connection":"keep-alive","content-length":"305","content-type":"application/json; charset=UTF-8","date":"Thu, 10 Aug 2023 11:05:27 GMT"},"meta":{"aborted":false,"attempts":0,"connection":{"_openRequests":0,"deadCount":0,"headers":{},"id":"https://opensearch_endpoint/","resurrectTimeout":0,"roles":{"data":true,"ingest":true},"status":"alive","url":"https://opensearch_endpoint/"},"context":null,"name":"opensearch-js","request":{"id":28,"options":{},"params":{"body":null,"headers":{"user-agent":"opensearch-js/2.3.0 (linux 5.4.242-155.348.amzn2.x86_64-x64; Node.js v20.4.0)"},"method":"GET","path":"/_tasks/QOFSwWvIQHS87tX4eRdoOA%3A11339386","querystring":"","timeout":30000}}},"statusCode":404},"name":"ResponseError"},"http_status":500,"reason":"Error updating elastic"},"internalData":{},"name":"DatabaseError","time_thrown":"2023-08-10T11:05:27.718Z"},"http_status":500,"reason":"[OPENCTI] Platform initialization fail"},"message":"An unknown error has occurred","name":"UnknownError","stack":"UnknownError: An unknown error has occurred\n at error (/opt/opencti/build/src/config/errors.js:8:10)\n at UnknownError (/opt/opencti/build/src/config/errors.js:68:47)\n at platformInit (/opt/opencti/build/src/initialization.js:393:13)\n at processTicksAndRejections (node:internal/process/task_queues:95:5)\n at platformStart (/opt/opencti/build/src/boot.js:183:5)"},"level":"error","message":"[OPENCTI] Platform start fail","timestamp":"2023-08-10T11:05:27.720Z","version":"5.9.6"}
Additional information
Screenshots (optional)
The text was updated successfully, but these errors were encountered: