Search indexes not being created in aws

If I run my app locally, via mvn spring-boot:run or running the jar directly it works fine. My db is queried and indexes are created and saved to /tmp/lucene/indexes. However, when I upload this jar to to an aws ec2 ubuntu instance, the app will run normally, but the index files are never created. It does however, create the index folder, and a file called “write.lock” and “segments_1” I’ve set log levels for hibernate and lucene to TRACE, and the only difference is this line:

[Hibernate Search: entityloader-1] WARN  o.h.s.b.i.lucene.IndexWriterHolder - HSEARCH000052: Going to force release of the IndexWriter lock

I have tried deleting the folder, deleting the write.lock file, but none of those seem to help. I’ve tried changing the permissions of the indexes folder and i’ve also tried changing the indexes folder to other locations, including /var/lucene/index and /home/ubuntu/

I am using springboot 1.5.4.RELEASE version and these hibernate dependencies

<dependency>
    <groupId>org.hibernate</groupId>
    <artifactId>hibernate-search-orm</artifactId>
<version>5.5.4.Final</version>
</dependency>

<dependency>
    <groupId>org.hibernate</groupId>
    <artifactId>hibernate-core</artifactId>
    <version>5.1.1.Final</version>
</dependency>

<dependency>
    <groupId>org.hibernate</groupId>
    <artifactId>hibernate-entitymanager</artifactId>
    <version>5.1.1.Final</version>
</dependency>

I should add, I don’t get any exceptions or errors (aside form the WARN I posted above). The indexes are simply not created, so my search suggestions field does not work.

I’m really at a loss as to what to do next.

I can’t tell you why it doesn’t work, because I don’t know much about running applications on EC2, but I may have some leads to help you debugging this.

This warning should only appear when an exception was thrown while applying changes to the Lucene index, so if you don’t see anything in you logs, it’s probably that the exception got swallowed somewhere. You could check that your code logs or re-throws all caught exceptions. If you’re not using the default ErrorHandler, you should check that your custom error handler properly logs the exceptions, too.

That being said… you should know that you are running an outdated, unmaintained version of Hibernate Search, and you may very well be experiencing a bug in Hibernate Search that was never reported before, or was reported but fixed in a later version only.
If you have to use Hibernate ORM 5.1, then you can at least upgrade to Hibernate Search 5.6.
If you are able to upgrade to Hibernate ORM 5.2, then I recommend doing so and upgrading to Hibernate Search 5.9.
The upgrade may require some changes in your application (see the migration guides for Search and for ORM), and it may, or may not, solve your immediate issue; but you will have to do it eventually, and it will certainly solve other bugs, so you might as well do it now if you can.
In Spring Boot, changing the Hibernate ORM version can be done by overriding the hibernate.version property, like this.