dfir-iris / iris-web

Collaborative Incident Response platform
GNU Lesser General Public License v3.0
1.05k stars 169 forks source link

Ngnix and IRISwebapp is unavailable - sleeping #489

Closed usmanaa10 closed 1 week ago

usmanaa10 commented 3 months ago

Hi , I am trying to install DFIR Iris, but everytime I get this error, don't know why

iriswebapp_worker | IRISwebapp is unavailable - sleeping iriswebapp_worker | IRISwebapp is unavailable - sleeping iriswebapp_nginx | 2024/06/07 07:34:03 [error] 10#10: 5 connect() failed (111: Connection refused) while connecting to upstream, client: 127.0.0.1, server: 192.168.254.24, request: "GET / HTTP/1.1", upstream: "http://172.21.0.2:8000/", host: "127.0.0.1" iriswebapp_nginx | 2024/06/07 07:34:03 [info] 10#10: 5 client 127.0.0.1 closed keepalive connection iriswebapp_nginx | 127.0.0.1 - - [07/Jun/2024:07:34:03 +0000] "GET / HTTP/1.1" 502 497 "-" "curl/7.64.0" "-" iriswebapp_worker | IRISwebapp is unavailable - sleeping iriswebapp_worker | IRISwebapp is unavailable - sleeping iriswebapp_worker | IRISwebapp is unavailable - sleeping

Ant the browser showed me the following message,

"An error occurred. Sorry, the page you are looking for is currently unavailable. Please try again later.

If you are the system administrator of this resource then you should check the error log for details."

Faithfully yours, nginx."

can anyone help me out

whikernel commented 3 months ago

Hi!

It's most probably because the WebApp container didn't succeed to boot. Please check its logs with "docker compose logs app". It should give you more details on what's wrong.

usmanaa10 commented 3 months ago

Hi @whikernel, "docker compose logs app" give me following output iriswebappapp | File "/opt/venv/lib/python3.9/site-packages/sqlalchemy/util/compat.py", line 207, in raise iriswebapp_app | raise exception iriswebapp_app | File "/opt/venv/lib/python3.9/site-packages/sqlalchemy/engine/base.py", line 3250, in _wrap_pool_connect iriswebapp_app | return fn() iriswebapp_app | File "/opt/venv/lib/python3.9/site-packages/sqlalchemy/pool/base.py", line 310, in connect iriswebapp_app | return _ConnectionFairy._checkout(self) iriswebapp_app | File "/opt/venv/lib/python3.9/site-packages/sqlalchemy/pool/base.py", line 868, in _checkout iriswebapp_app | fairy = _ConnectionRecord.checkout(pool) iriswebapp_app | File "/opt/venv/lib/python3.9/site-packages/sqlalchemy/pool/base.py", line 476, in checkout iriswebapp_app | rec = pool._do_get() iriswebapp_app | File "/opt/venv/lib/python3.9/site-packages/sqlalchemy/pool/impl.py", line 146, in _do_get iriswebapp_app | self._dec_overflow() iriswebapp_app | File "/opt/venv/lib/python3.9/site-packages/sqlalchemy/util/langhelpers.py", line 70, in exit iriswebappapp | compat.raise( iriswebappapp | File "/opt/venv/lib/python3.9/site-packages/sqlalchemy/util/compat.py", line 207, in raise iriswebapp_app | raise exception iriswebapp_app | File "/opt/venv/lib/python3.9/site-packages/sqlalchemy/pool/impl.py", line 143, in _do_get iriswebapp_app | return self._create_connection() iriswebapp_app | File "/opt/venv/lib/python3.9/site-packages/sqlalchemy/pool/base.py", line 256, in _create_connection iriswebapp_app | return _ConnectionRecord(self) iriswebapp_app | File "/opt/venv/lib/python3.9/site-packages/sqlalchemy/pool/base.py", line 371, in init iriswebapp_app | self.connect() iriswebapp_app | File "/opt/venv/lib/python3.9/site-packages/sqlalchemy/pool/base.py", line 666, in connect iriswebapp_app | pool.logger.debug("Error on connect(): %s", e) iriswebapp_app | File "/opt/venv/lib/python3.9/site-packages/sqlalchemy/util/langhelpers.py", line 70, in exit iriswebappapp | compat.raise( iriswebappapp | File "/opt/venv/lib/python3.9/site-packages/sqlalchemy/util/compat.py", line 207, in raise iriswebapp_app | raise exception iriswebapp_app | File "/opt/venv/lib/python3.9/site-packages/sqlalchemy/pool/base.py", line 661, in connect iriswebapp_app | self.dbapi_connection = connection = pool._invoke_creator(self) iriswebapp_app | File "/opt/venv/lib/python3.9/site-packages/sqlalchemy/engine/create.py", line 590, in connect iriswebapp_app | return dialect.connect(*cargs, *cparams) iriswebapp_app | File "/opt/venv/lib/python3.9/site-packages/sqlalchemy/engine/default.py", line 597, in connect iriswebapp_app | return self.dbapi.connect(cargs, **cparams) iriswebapp_app | File "/opt/venv/lib/python3.9/site-packages/psycopg2/init__.py", line 122, in connect iriswebapp_app | conn = _connect(dsn, connection_factory=connection_factory, **kwasync) iriswebapp_app | File "/opt/venv/lib/python3.9/site-packages/eventlet/support/psycopg2_patcher.py", line 46, in eventlet_wait_callback iriswebapp_app | state = conn.poll() iriswebapp_app | sqlalchemy.exc.OperationalError: (psycopg2.OperationalError) FATAL: password authentication failed for user "postgres" iriswebapp_app | iriswebapp_app | iriswebapp_app | (Background on this error at: https://sqlalche.me/e/14/e3q8) iriswebapp_app | [2024-06-10 06:17:40 +0000] [9] [INFO] Worker exiting (pid: 9) iriswebapp_app | [2024-06-10 06:17:41 +0000] [7] [INFO] Shutting down: Master iriswebapp_app | [2024-06-10 06:17:41 +0000] [7] [INFO] Reason: Worker failed to boot.

Note : I have change the password in .env file

Skrimmv01 commented 3 months ago

I have the same error. I changed the password and now it says that the Postgres password is not suitable. I rebuilt because I saw in the documentation that the password appears for the first time, I thought that everything related to passwords happens only during the first build, but then it’s strange...

usmanaa10 commented 3 months ago

Hi @Skrimmv01 @whikernel I need some guidance on resolving this issue. I've reinstalled the entire setup from the beginning a couple of times, but the problem persists. Could you please share some solutions to help me get rid of this problem?

Thank you!

Daniel-CS-Team commented 3 months ago

Same issue here. Seems to be a Problem in initial Table creation.

Skrimmv01 commented 3 months ago

Hi @Skrimmv01 @whikernel I need some guidance on resolving this issue. I've reinstalled the entire setup from the beginning a couple of times, but the problem persists. Could you please share some solutions to help me get rid of this problem?

Thank you!

You need to remove everything related to docker compose containers, the following commands are useful: 1) docker stop $(docker ps -aq) 2) docker rm -vf $(docker ps -aq) 3) docker rmi -f $(docker images -aq) 4) docker volume rm $(docker volume ls -qf dangling=true) After that you need to edit the ".env" file and customize the settings related to accounts and the application as a whole as you need, then run the "docker compose build" and "docker compose up" commands. Worked for me, hope it helps you too.

usmanaa10 commented 3 months ago

Hi @Skrimmv01 , I followed all the steps you mentioned, now the error "FATAL: password authentication failed for user "postgres" " changes into "could not translate host name "db" to address: Temporary failure in name resolution" Kindly see the logs below

| return dialect.connect(*cargs, *cparams) iriswebapp_app | File "/opt/venv/lib/python3.9/site-packages/sqlalchemy/engine/default.py", line 597, in connect iriswebapp_app | return self.dbapi.connect(cargs, cparams) iriswebapp_app | File "/opt/venv/lib/python3.9/site-packages/psycopg2/init.py", line 122, in connect iriswebapp_app | conn = _connect(dsn, connection_factory=connection_factory, kwasync) iriswebapp_app | sqlalchemy.exc.OperationalError: (psycopg2.OperationalError) could not translate host name "db" to address: Temporary failure in name resolution iriswebapp_app | iriswebapp_app | iriswebapp_app | (Background on this error at: https://sqlalche.me/e/14/e3q8) iriswebapp_app | [2024-06-20 10:51:55 +0000] [9] [INFO] Worker exiting (pid: 9) iriswebapp_app | [2024-06-20 10:51:55 +0000] [7] [INFO] Shutting down: Master iriswebapp_app | [2024-06-20 10:51:55 +0000] [7] [INFO] Reason: Worker failed to boot.

Please guide me to take me out of this trouble

Daniel-CS-Team commented 3 months ago

Same issue here. Seems to be a Problem in initial Table creation.

Ok, this one was my fault. Resolved the issue by using the proper environment variable POSTGRES_DB to define a non-standard Database Name.

BTW: It would be nice to have this variable documented somewhere. I had to dig it out of the source code.

Noones47 commented 2 months ago

Same issue here. Seems to be a Problem in initial Table creation.

Ok, this one was my fault. Resolved the issue by using the proper environment variable POSTGRES_DB to define a non-standard Database Name.

BTW: It would be nice to have this variable documented somewhere. I had to dig it out of the source code.

What did you to solve that exactly? Becouse after i installed the Cortex Module it gave me that error.