Integration with liquibase :ERROR invalid value for parameter "TimeZone": "Asia/Calcutta"

Hello,

I am using liquibase in my application using MySql database. However, we are now planning to move with liquibase+cockroach db combination in our application.

While I am executing liquibase xml via “gradlew update command” getting below error. However this was working fine with my sql.

D:\myapp>gradlew update

Task :core:update FAILED
liquibase-plugin: Running the ‘main’ activity…
Unexpected error running Liquibase: org.postgresql.util.PSQLException: ERROR: invalid value for parameter “TimeZone”: “Asia/Calcutta”
Detail: timezone data cannot be found

SEVERE 11/02/19, 12:01 PM: liquibase: org.postgresql.util.PSQLException: ERROR: invalid value for parameter “TimeZone”: “Asia/Calcutta”
Detail: timezone data cannot be found
liquibase.exception.DatabaseException: liquibase.exception.DatabaseException: org.postgresql.util.PSQLException: ERROR: invalid value for parameter “TimeZone”: “Asia/Calcutta”
Detail: timezone data cannot be found
at liquibase.integration.commandline.CommandLineUtils.createDatabaseObject(CommandLineUtils.java:157)
at liquibase.integration.commandline.Main.doMigration(Main.java:915)


  • List item

In my build.gradle, I am using postgres driver and added following dependencies :
classpath ‘org.postgresql:postgresql:42.2.5’

I checked my machine timezone and it is UTC+5.30. which is India timezone.

In my cockroach db it is showing UTC time zone:

root@:26257/defaultdb> show timezone;
timezone
±---------+
UTC
(1 row)

Time: 55.189ms

root@:26257/defaultdb>

  • List item
    Even I changed my local machine time zone but still facing same error.
    Please help here to get ride of this issue.

This is issue https://github.com/cockroachdb/cockroach/issues/32415.

You are running CockroachDB on Windows. This is not well supported. If you want to run your client app on Windows that’s 100% fine, but then run CockroachDB on a separate unix server or a VM.
A workaround is to use a numeric time zone instead.

Thanks for quickly clarifying the things.

Hello,

As per suggestion, install cockroach on Linux machine and now unable to connect to DBeaver on window machine and getting “connection time out” error.

I checked Linux machine and seems port is enabled:

root@172.16.23.29:~ r-xr-x— # telnet 172.16.23.29 26257
Trying 172.16.23.29…
Connected to 172.16.23.29.
Escape character is ‘^]’.


Any suggestion would be really helpful.

I got connection after stopping firewall.:disappointed:

System.setProperty(“user.timezone”, “UTC”);
try this,it worked for me.