Additional Options
Additional optional use cases
Force Deletion of Connectors
If you must delete a connector and related information before the process of waiting for the background jobs to run, you can run a deletion
script using the instructions that follow.
How to find a connector ID?
- Navigate to the connectors page.
- Click on the connector you want the ID of .
- On the connector’s page, the URL’s final number will be the ID of the connector. For example, in this example, the connector’s ID is 2. Here is also a more zoomed in photo of the URL bar.
m
Deleting Locally
-
Gather the ID of the connector you wish to delete.
-
Navigate to the base folder of your Danswer repository.
-
Run
python3 backend/scripts/force_delete_connector_by_id.py <CONNECTOR_ID>
Deleting in Docker Compose
Follow these steps to manually and immediately delete a connector and its contents within a container:
-
Ensure your Docker containers are running- you can refer to the quickstart guide:
docker compose -f docker-compose.dev.yml -p danswer-stack up -d --build --force-recreate
-
Identify the
<CONTAINER_ID>
of your API server container. It should contain the stringdanswer-api
. You can list all running containers with:docker ps -a
-
Gather the ID
<CONNECTOR_ID>
of the connector you wish to delete. -
Run the deletion script inside the Docker container:
docker exec -it <CONTAINER_ID> python scripts/force_delete_connector_by_id.py <CONNECTOR_ID>
Replace
<CONTAINER_ID>
with your actual API container ID, and<CONNECTOR_ID>
with the ID of the connector you want to delete.For example:
docker exec -it 92492089ada1 python scripts/force_delete_connector_by_id.py 10
-
The script will execute inside the container, accessing the necessary resources and performing the deletion.
Troubleshooting
-
If you encounter permission issues, you may need to run the docker-compose command with sudo:
sudo docker-compose exec <CONTAINER_ID> python /app/scripts/force_delete_connector_by_id.py `CONNECTOR_ID`
-
Ensure that your user has the necessary permissions to execute docker-compose commands.
-
If the script is not found, verify the path to the script within your Docker container.