Skip to content
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

bug: Rengine 2.03 Fresh Install BUG (reinstall) - uninstall.sh BUG (outdated) - #972 has reappeared on the scene #1187

Open
1 task done
carboncrystal opened this issue Feb 6, 2024 · 3 comments

Comments

@carboncrystal
Copy link

Is there an existing issue for this?

  • I have searched the existing issues

Current Behavior

uninstall.sh bug (outdated) - see line 14

docker stop rengine_web_1 rengine_db_1 rengine_celery_1 rengine_celery-beat_1 rengine_redis_1 rengine_tor_1 rengine_proxy_1

  • All Rengine containers was renamed a little while ago. Example: rengine_web_1 is now rengine-web-1, so: _ is now -
  • Due to these outdated lines, uninstalling Reingine will not work!

Renaming line 14
image

Docker system prune - to be sure for a Rengine fresh reinstall

sudo make prune

make[1]: Entering directory '/home/myusername/bin/rengine'
COMPOSE_DOCKER_CLI_BUILD=1 docker-compose -f docker-compose.yml stop db web proxy redis celery celery-beat
make[1]: Leaving directory '/home/myusername/bin/rengine'
make[1]: Entering directory '/home/myusername/bin/rengine'
COMPOSE_DOCKER_CLI_BUILD=1 docker-compose -f docker-compose.yml rm -f db web proxy redis celery celery-beat
No stopped containers
make[1]: Leaving directory '/home/myusername/bin/rengine'
Deleted Volumes:
dcd8d8ad49d89bf11d58335cbaffa58a0f2987caf7f39a14fa4536c408f524f5
ee60970e92641c85a6f03e41afbadacfef5449e85b48f94c1b8e58f55b2440a1

Total reclaimed space: 6.105kB

docker system prune

image

Remove Rengine - for a fresh reinstall

Check Docker volumes
docker volume ls

Delete all existent volumes
docker volume prune

Check Docker containers
docker ps

Delete all containers
docker rm -f $(docker ps -a -q)

Remove old Rengine folder
cd .. && sudo rm -rf rengine

Reinstall Rengine - Fresh install
git clone https://github.com/yogeshojha/rengine && cd rengine

Edit .env
nano .env

  • Changed POSTGRES_USER & POSTGRES_PASSWORD values

Generate certificates
sudo make certs

Install Rengine

  • Looks like fresh install Reingine installs 2.0.2 instead of 2.0.3

sudo ./install
image

Rengine Installed - but errors

image

Full errors output from istall - via terminal

WARNINGS:
startScan.EndPoint.techs: (fields.W340) null has no effect on ManyToManyField.
Traceback (most recent call last):
  File "/usr/local/lib/python3.10/dist-packages/django/db/backends/base/base.py", line 219, in ensure_connection
    self.connect()
  File "/usr/local/lib/python3.10/dist-packages/django/utils/asyncio.py", line 26, in inner
    return func(*args, **kwargs)
  File "/usr/local/lib/python3.10/dist-packages/django/db/backends/base/base.py", line 200, in connect
    self.connection = self.get_new_connection(conn_params)
  File "/usr/local/lib/python3.10/dist-packages/django/utils/asyncio.py", line 26, in inner
    return func(*args, **kwargs)
  File "/usr/local/lib/python3.10/dist-packages/django/db/backends/postgresql/base.py", line 187, in get_new_connection
    connection = Database.connect(**conn_params)
  File "/usr/local/lib/python3.10/dist-packages/psycopg2/__init__.py", line 122, in connect
    conn = _connect(dsn, connection_factory=connection_factory, **kwasync)
psycopg2.OperationalError: connection to server at "db" (172.25.0.3), port 5432 failed: FATAL:  password authentication failed for user "myusername"


The above exception was the direct cause of the following exception:

Traceback (most recent call last):
  File "/usr/src/app/manage.py", line 26, in <module>
    main()
  File "/usr/src/app/manage.py", line 22, in main
    execute_from_command_line(sys.argv)
  File "/usr/local/lib/python3.10/dist-packages/django/core/management/__init__.py", line 419, in execute_from_command_line
    utility.execute()
  File "/usr/local/lib/python3.10/dist-packages/django/core/management/__init__.py", line 413, in execute
    self.fetch_command(subcommand).run_from_argv(self.argv)
  File "/usr/local/lib/python3.10/dist-packages/django/core/management/base.py", line 354, in run_from_argv
    self.execute(*args, **cmd_options)
  File "/usr/local/lib/python3.10/dist-packages/django/contrib/auth/management/commands/createsuperuser.py", line 79, in execute
    return super().execute(*args, **options)
  File "/usr/local/lib/python3.10/dist-packages/django/core/management/base.py", line 397, in execute
    self.check_migrations()
  File "/usr/local/lib/python3.10/dist-packages/django/core/management/base.py", line 486, in check_migrations
    executor = MigrationExecutor(connections[DEFAULT_DB_ALIAS])
  File "/usr/local/lib/python3.10/dist-packages/django/db/migrations/executor.py", line 18, in __init__
    self.loader = MigrationLoader(self.connection)
  File "/usr/local/lib/python3.10/dist-packages/django/db/migrations/loader.py", line 53, in __init__
    self.build_graph()
  File "/usr/local/lib/python3.10/dist-packages/django/db/migrations/loader.py", line 220, in build_graph
    self.applied_migrations = recorder.applied_migrations()
  File "/usr/local/lib/python3.10/dist-packages/django/db/migrations/recorder.py", line 77, in applied_migrations
    if self.has_table():
  File "/usr/local/lib/python3.10/dist-packages/django/db/migrations/recorder.py", line 55, in has_table
    with self.connection.cursor() as cursor:
  File "/usr/local/lib/python3.10/dist-packages/django/utils/asyncio.py", line 26, in inner
    return func(*args, **kwargs)
  File "/usr/local/lib/python3.10/dist-packages/django/db/backends/base/base.py", line 259, in cursor
    return self._cursor()
  File "/usr/local/lib/python3.10/dist-packages/django/db/backends/base/base.py", line 235, in _cursor
    self.ensure_connection()
  File "/usr/local/lib/python3.10/dist-packages/django/utils/asyncio.py", line 26, in inner
    return func(*args, **kwargs)
  File "/usr/local/lib/python3.10/dist-packages/django/db/backends/base/base.py", line 218, in ensure_connection
    with self.wrap_database_errors:
  File "/usr/local/lib/python3.10/dist-packages/django/db/utils.py", line 90, in __exit__
    raise dj_exc_value.with_traceback(traceback) from exc_value
  File "/usr/local/lib/python3.10/dist-packages/django/db/backends/base/base.py", line 219, in ensure_connection
    self.connect()
  File "/usr/local/lib/python3.10/dist-packages/django/utils/asyncio.py", line 26, in inner
    return func(*args, **kwargs)
  File "/usr/local/lib/python3.10/dist-packages/django/db/backends/base/base.py", line 200, in connect
    self.connection = self.get_new_connection(conn_params)
  File "/usr/local/lib/python3.10/dist-packages/django/utils/asyncio.py", line 26, in inner
    return func(*args, **kwargs)
  File "/usr/local/lib/python3.10/dist-packages/django/db/backends/postgresql/base.py", line 187, in get_new_connection
    connection = Database.connect(**conn_params)
  File "/usr/local/lib/python3.10/dist-packages/psycopg2/__init__.py", line 122, in connect
    conn = _connect(dsn, connection_factory=connection_factory, **kwasync)
django.db.utils.OperationalError: connection to server at "db" (172.25.0.3), port 5432 failed: FATAL:  password authentication failed for user "myusername"

make: *** [Makefile:28: username] Error 1

Thank you for installing reNgine, happy recon!!

It seems that the error #972 has reappeared on the scene

Restart containers
make restart
image

List docker containers
docker ps
image

Browser access Rengine
https://127.0.0.1
image

Of course, I checked and have all the Rengine requirements installed. Plus it's reinstall, so it was installed on the same OS with no problems!

I have tried fresh install several times, each time the same problem! I even tried without changing username and password in .env, same error every time!

I can't seem to reinstall Rengine!

Expected Behavior

Install Rengine

Steps To Reproduce

Explained above.

Environment

- reNgine: Trying to reinstall Rengine
- OS: Ubuntu 22.04.3 LTS
- Python: Python 3.10.12
- Docker Engine: Docker version 25.0.2, build 29cf629
- Docker Compose: Docker Compose version v2.5.0
- Browser: Firefox / Chrome - N/A

Anything else?

No response

@carboncrystal carboncrystal added the bug Something isn't working label Feb 6, 2024
Copy link

github-actions bot commented Feb 6, 2024

👋 Hi @carboncrystal,
Issues is only for reporting a bug/feature request. Please read documentation before raising an issue https://rengine.wiki
For very limited support, questions, and discussions, please join reNgine Discord channel: https://discord.gg/azv6fzhNCE
Please include all the requested and relevant information when opening a bug report. Improper reports will be closed without any response.

@carboncrystal
Copy link
Author

@solved - But please do not close until uninstall.sh is updated. There are a lot of BUGs here!

unistall.sh - has bugs, so uninstalling will not work correctly, either containers, volumes, networks or old images will be retained.

Solution:

  1. docker commands to list what's left from Rengine, commands like docker ps, docker volume ls, docker images, docker network ls.
  2. manually stop what's left from Rengine: docker stop [container_name]
  3. delete what is left of Rengine (container, volume, networks, images): docker rm [container_name], docker volume rm [volume_name], docker network rm [rengine_network_name], docker rmi [RENGINE IMAGE_ID1] [RENGINE IMAGE_ID2] etc.
  4. but don't forget to somehow delete the containers created by Docker (read below why)!

Don't delete containers created by Docker before install / reinstall Rengine
The new Docker uppdate creates 2 volumes by default, if you delete them before installing / reinstall Rengine, this is because you want to do "Docker clean", because Rengine doesn't install correctly and you get errors, Docker will automatically create them again when you install / reinstall Rengine and so Rengine won't install correctly, it will omit to ask you in the terminal username, email and password (even if they are set to .env). And these volumes created by Docker will interfere with "null"!.
You'll get errors like:

  • [Makefile:28: username] Error 1)
  • WARNINGS: startScan.EndPoint.techs: (fields.W340) null has no effect on ManyToManyField.

So before install / reinstall Rengine: check default Docker volumes are present:
docker volume ls
Screenshot from 2024-02-09 10-05-58

docker volume inspect [volume-name]
Screenshot from 2024-02-09 08-28-44

  • From here come the errors with "null", [Makefile:28: username] Error 1), WARNINGS: startScan.EndPoint.techs: (fields.W340), login - user connection to DB and probably other errors.
  • Because the default Docker volumes are created during Rengine installation! They must be present before installation, and if you reinstall Rengine, old containers, network, volumes and Rengine images must be manually deleted! Rengine's unistall.sh omits some of them (BUG).

@psyray
Copy link
Collaborator

psyray commented Feb 9, 2024

@carboncrystal Could you provide a PR with the modifications ?

@psyray psyray added Work in Progress Working needs more info and removed bug Something isn't working labels Feb 21, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants