-
Notifications
You must be signed in to change notification settings - Fork 1.3k
Description
Description
The Worker.py file points to a localhost port (in the config file it links to) that I think has been deprecated, when i leave it as the default port 8080 it provides an error of the API being offline. However if I point it to port 4000 it appears to be functioning correctly as it is now waiting for a connector.
Additonally, RabbitMQ requires the management plugin as the worker needs to be able to interact with the rabbitMQ port 15672, the following command is required before worker.py is executed.
Environment
- OS (where OpenCTI server runs): Ubuntu 18.04
- OpenCTI version: 2.0.2
- OpenCTI client: frontend
Actual Output
Below were some of the error messages I've received;
-
When running the worker by default
Traceback (most recent call last): File "worker.py", line 173, in <module> worker = Worker() File "worker.py", line 119, in __init__ self.api = OpenCTIApiClient(self.opencti_url, self.opencti_token) File "/home/opencti/.local/lib/python3.6/site-packages/pycti/api/opencti_api_client.py", line 52, in __init__ raise ValueError('OpenCTI API seems down') ValueError: OpenCTI API seems down -
When running on port 4000, but then struggles with RabbitMQ as a management plugin is missing, error log is from the running OpenCTI Server;
error: [OPENCTI] Technical error > connect ECONNREFUSED 127.0.0.1:15672 {"locations":[{"line":8,"column":3}],"path":["rabbitMQMetrics"],"extensions":{"code":"INTERNAL_SERVER_ERROR","exception":{"config":{"url":"http://localhost:15672/api/overview","method":"get","headers":{"Accept":"application/json, text/plain, */*","User-Agent":"axios/0.19.0"},"auth":{"username":"guest","password":"guest"},"baseURL":"http://localhost:15672","transformRequest":[null],"transformResponse":[null],"timeout":0,"withCredentials":true,"xsrfCookieName":"XSRF-TOKEN","xsrfHeaderName":"X-XSRF-TOKEN","maxContentLength":-1},"code":"ECONNREFUSED"}}}
Solution
- Change the config file to
localhost:4000 rabbitmq-plugins enable rabbitmq_managementbefore you run the worker.py script
Outcome
Next steps I think would be just including these in the documentation, I worked it out using the error codes but wanted to share in case others had the problem.