Installation Checks shows error "Database Ensure Index Failed"

I’ve searched without success the community forum and elsewhere online for information about and remedies for this error: “Database Ensure Index Failed”. It’s the only error that’s showing up when I run Installation Checks in the FileCloud UI. Can someone help me figure out what this is and how to fix it?

@Unimatrix

Apologies for the late reply.

Can you please share us with the below details

  • Screenshot of the error page
  • MongoDB Log
    Windows: \xampp\mongodb\bin\log
    Linux: (Ubuntu): /var/log/mongodb/mongd.log
  • FileCloud Server Log
    Windows : \xampp\htdocs\scratch\logs\log_YYYY-MM-DD.txt
    Linux : /var/www/html/scratch/logs/log_YYYY-MM-DD.txt

You can upload it to the below URL

https://zerg.codelathe.com/url/bqkxcgcdphv7tdpb

Thank you. I have uploaded a zip archive with the logs requested.

@Unimatrix

Thank you for the logs. We will check this and get back to you.

Is it okay to use FileCloud in production with this error unresolved? Any unforeseen risks in doing so?

@Unimatrix

This error is because of the duplicate key entry. We need to fix this before moving into production.

2020-11-17 22:55:17.305794 ERROR: CLFC-06203 EnsureDatabaseIndex : upgrademanager MongoDB\Driver\Exception\CommandException: E11000 duplicate key error collection: tonidosettings.sites index: host_unique_index dup key: { : “*” } in /var/www/html/thirdparty/mongo-php-library/MongoDB/Operation/CreateIndexes.php:153

We will provide you the steps to delete the duplicate keys.

@Unimatrix

Please find the steps here,

Take a backup of the current mongodb
mongodump --out mongobackup

to connect to DB we use the tool Robo mongo

Once we execute robo mongo, create new test connection, which will fail so we need to create a tunnel.

Creating a tunnel

Open the putty tab >> Settings >> SSH >> Tunnels >> Source port : 27017
Destination 127.0.0.1:27017

Click on Add >> Apply

Open Robo mongo and click on Test ( this should work)

Click on Manage Connections >> New Connection >> Double click on it

In your case the duplicate key is in tonidosettings >> sites
duplicate key is for *

Please can you take a screenshot of this and send it to. ( Go to tonidosettings >> Collections >> Sites >> Switch the view to a detailed and take a screenshot)

I’ve run “mongodump --out mongobackup” (from the /tmp directory). I’ve never used Robo mongo. Is it free? Is it a CLI tool or a GUI app? Are you saying that I should install it on the same server where FileCloud is running (which currently has no X Window system) or can I install it on a remote server?

Also curious about the step of creating a tunnel. Are you saying that I should install and use PuTTY or would any SSH/Telnet client do the job?

I installed Studio 3T on my Mac but at first it wasn’t able to tunnel in to my server. I got that to work after I followed advice here: Getting error while creating a New Connection using Studio 3T for Mongo DB
(I hope it’s useful to provide this reference in case others have this problem in the future.)

I’ve attached a screenshot of what I think is the view you want.

Apology for the delay in getting back to you.

Please follow the below steps to fix this issue.

  1. Take a fresh DB backup by running the below command.
    #mongodump --out /backuploation
  2. Then remove the second entry in the screenshot you provided (the one with no settings elements).
  3. After that please run the installation checks again and let us know if notice any issues.

Thank you! That solved my “Database Ensure Index Failed” system check.

Hi @Unimatrix

You are most welcome.

We are happy to hear that the issue has been resolved.