cozy / cozy-data-system

Deprecated - Data Layer for Cozy V2 Platform
https://cozy.io
GNU Affero General Public License v3.0
24 stars 21 forks source link

Don't crash when index is not available #227

Open clochix opened 8 years ago

clochix commented 8 years ago

I think we shouldn't prevent the data-system to start when there's a problem with the index, because this makes the whole server unavailable. We should be able to operate without the indexer.

A user had this issue today: after migrating its server, the owner of the directory of the index files changed, and the data-system was unable to access it, so it keeps crashing at startup:

/usr/local/cozy/apps/data-system/node_modules/cozy-data-system/node_modules/cozy-indexer/node_modules/search-index/lib/index.js:42
      SearchIndex.add = searchIndexAdder.add
                                        ^
TypeError: Cannot read property 'add' of null
    at /usr/local/cozy/apps/data-system/node_modules/cozy-data-system/node_modules/cozy-indexer/node_modules/search-index/lib/index.js:42:41

Another common issue is that sometime, a dependency of our indexer fails to install (npm problem?) We should display a warning and start the data-system.

clochix commented 8 years ago

Same error on some ISEN VPS: data-system was unable to start because the index folder didn't exists. Ping @aenario

clochix commented 7 years ago

Another user has the same issue.