WARNING :: post_init :: create_safe_admin :: >>> Administrator already exists
All attempts ended with [docker logs CONTAINER_ID] "WARNING :: post_init :: create_safe_admin :: >>> Administrator already exists"/ Phases: git clone https://github.com/dfir-iris/iris-web.git cd iris-web git checkout v2.4.5 cp .env.model .env
POSTGRES_USER=postgres POSTGRES_PASSWORD=postgres POSTGRES_ADMIN_USER=raptor POSTGRES_ADMIN_PASSWORD=raptor IRIS_SECRET_KEY=powerful IRIS_SECURITY_PASSWORD_SALT=powerful INTERFACE_HTTPS_PORT=5269
docker-compose build docker-compose up -d
start it build it from scratch: docker build --no-cache .
or do it on new VM
I have done the same for me also same issue.
If Admin already exists then what password?
I don't know the password , I am also facing the same issue
Throwing some ideas here, in hope it helps:
- maybe there are volumes remaining of a previous version of iris? What's the result of
docker volume ls? Maybe, try pruning them:docker volume prune --alland then do the procedure again (I am assuming you are trying a fresh install here and not an upgrade, otherwise you are going to lose your data!) - are there some other error/warning logs before for any of the dockers started with the docker-compose? (look for error/ERROR, warn/WARN, stack traces... in all the logs)
- the log you are seeing is output by the
create_safe_adminfunction, here. On a first install, when variableIRIS_ADM_PASSWORDis not defined in the.envfile, you should rather see this log. It seems that the administrator already exists, that's why I think, maybe, you are starting with a pre-existing database. - function
create_safe_adminis called from here, so after the WARNING log, you should see some INFO logs, normally "Registering default modules"
Note: the administrator's password can be set through variable IRIS_ADM_PASSWORD in the .env (naturally this will only work for a fresh install when there are no databases from previous instances)
I encountered the same issue and found a workaround that resolved it for me. Here's a more detailed breakdown of the steps I followed:
- Stop All Running Containers: This ensures that there are no active containers that might be using the resources we need to modify or delete.
docker-compose stop
- List All Containers: Including the stopped ones helps to identify all containers, ensuring none are missed during cleanup.
docker ps -a
- Remove Related Containers Manually: This step involves deleting the containers in order to enable volume remove. Replace <container_id> with the actual ID of the container you wish to remove. You can find the ID in the list generated by the previous command.
docker container rm <container_id>
- List All Docker Volumes: This helps identify all volumes, including those related to Dfir-Iris, that might need to be removed.
docker volume ls
- Remove Dfir-Iris Related Volumes: Be cautious with this step to avoid deleting volumes unintentionally. Replace iris-web_db_data with the actual name of the volume you intend to remove.
docker volume rm iris-web_db_data
-
Update the .env File: Modify the .env file to set a manual password or make other necessary configuration changes. This step is crucial for ensuring that the rebuilt containers have the correct settings.
-
Rebuild Containers Without Cache: This ensures that your containers are built from scratch, using the latest versions of images and incorporating any changes made to the Dockerfile or related configurations. I believe that rebuilding with cache could also be a viable solution.
docker-compose build --no-cache
By following these steps, I was able to work around the issue. Please remember to back up relevant data before removing any containers or volumes to prevent data loss. I hope this helps others facing the same problem!