Add security fields to Elasticsearch indices

I was just trying to use a postgres DB as I’d been using the H2 for a couple of weeks. I don’t need any data from the H2. So I set up Postgres 10 and ran it, but using Postgres it fails. The first time I ran it the logs just died half way through migration. The next time i started the service it came back with

org.sonar.server.platform.db.migration.step.MigrationStepExecutionException: Execution of migration step #2703 ‘Add security fields to Elasticsearch indices’ failed
Caused by: org.elasticsearch.cluster.block.ClusterBlockException: blocked by: [FORBIDDEN/12/index read-only / allow delete (api)];

If I try to start the service again from the command line I get that SonarQube is under maintenance.

I don’t have a backup for Postgres as it’s a fresh install, but I ran VACCUM FULL anyway on the sonar DB. I then “upgraded” and I got

Upgrade Failed
Database connection cannot be established. Please check database status and JDBC settings.

I know these connections are right as the database has been connected to and made its way through half the migration.

So I’m not really sure what’s going on here


Read-only elasticsearch indexes is likely to be caused by hitting a watermark of remaining free disk space :

Hi Pierre

Inside C:\sonarqube\elasticsearch\config\elasticsearch.yml I set the following properties

cluster.routing.allocation.disk.watermark.low: 30gb
cluster.routing.allocation.disk.watermark.high: 5gb

These values because my diskspace has 34gb available at the moment. But I still see the same error.

Any possible help on this? I already have other ES starting and working ok. I am able to start elastic search when using the H2 database but not using Postgres 10.10 or 9.6

Any solution for this?

Found The solution:

please clean both of this folder:

1 Like