"Migration failed" error while trying to install OpenMRS 2.5.0

I’m trying to implement OpenMRS Core 2.5.0 using war file. I have manually imported openmrs demo data on MySQL (version 8.0.29 on ubuntu 20).

I try to install OpenMRS without creating a database or adding the demo data. So it just needs to update the database, but it fails. Here’s the issue. How I can solve it?

@roozbeh Oh sorry! kindly share your server side log via pastebin.com

Kindly another alternative will be having a new installation without choosing to add demo data.

@jwnasambu Thanks a lot for your reply! I am installing it without adding demo data from installation options. I have added demo data manually.

Here’s the server log for localhost: localhost.2022-07-07.log - Pastebin.com

Here’s the server log for localhost_access_log: localhost_access_log.2022-07-07 - Pastebin.com

@roozbeh Kindly forgive me but what you have shared doesn’t look like an error. It looks like and INFO statement that prints at startup. Kindly share the entire error log on your terminal using pastebin. Am sorry for a bother!

@jwnasambu oh sorry! But that was the whole log file.

Here is another log file, the catalina.log file: catalina.2022-07-07.log - Pastebin.com

If this is also not what you need, could you please elaborate where I can find that log file? thanks

@roozbeh this is okay. The reason it doesn’t work is because you may be using modularized dependencies with old TomCat version. TomCat (bcel library) tries to scan class files attempting to find annotations like @WebServlet and others, but encounters unknown byte code. Kindly which Tomcat version are you running?

@roozbeh Openmrs 2.5.0 supports Tomcat 8.5+ and 9 basing on the release notes on this link. kindly am not certain the version you are running but keep posting the community for more help.

@jwnasambu Oh I see! Thanks a lot! My tomcat version is 7. So I’ll upgrade it and try one more time. Thanks for your help.

Normally, this error happens because you’ve imported an export of an OpenMRS database that has a column definition like:

date_created   datetime DEFAULT '0000-00-00 00:00:00'

Versions of MySQL prior to 5.7 accepted all zeroes as a valid date. This was deprecated in 5.7 and, IIRC, support was basically dropped in MySQL 8 unless you just disable constraint checking altogetehr. You’re best bet might be to clean-up the MySQL dump that you manually imported to remove any DEFAULT '0000-00-00' or DEFAULT '0000-00-00 00:00:00 declarations and re-import the database.

Another alternative would be this:

Update connection.url in openmrs-runtime.properties, by appending &zeroDateTimeBehavior=convertToNull so that 0000-00-00 00:00:00 dates can be converted to null.

1 Like

I still could not resolve this problem…

@jwnasambu I also tried Tomcat 10 but the error still exists

@ibacher I am using the published demo data available here: Demo Data - Resources - OpenMRS Wiki How can I remove those values from this dump?

@dkayiwa I don’t find the openmrs-runtime.properties in the server. Maybe this file is created after installing openmrs? Because in my case, I can not install it at all. I search with

sudo find / -type f -name “openmrs-runtime.properties”

but there is no result.