Skip to main content

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.
This is not default behavior. Use sparingly

How to find a connector ID?

  1. Navigate to the connectors page.
  1. Click on the connector you want the ID of .
  1. 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

  1. Gather the ID of the connector you wish to delete.
  2. Navigate to the base folder of your Danswer repository.
  3. 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:
  1. Ensure your Docker containers are running- you can refer to the quickstart guide:
  2. Identify the <CONTAINER_ID> of your API server container. It should contain the string danswer-api. You can list all running containers with:
  3. Gather the ID <CONNECTOR_ID> of the connector you wish to delete.
  4. Run the deletion script inside the Docker container:
    Replace <CONTAINER_ID> with your actual API container ID, and <CONNECTOR_ID> with the ID of the connector you want to delete. For example:
  5. 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:
  • 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.