SCADA-LTS / Scada-LTS

Scada-LTS is an Open Source, web-based, multi-platform solution for building your own SCADA (Supervisory Control and Data Acquisition) system.
GNU General Public License v2.0
743 stars 292 forks source link

Database migrations not working properly (new columns not added) #3024

Closed felipecarneiro closed 1 month ago

felipecarneiro commented 2 months ago

I just did a fresh install of ScadaLTS v2.7.8 on a new Linux server using the .war file, it creates the database in the first run, but there are some new fields that are not present.

This seems to be related to: https://github.com/SCADA-LTS/Scada-LTS/issues/1947#issuecomment-972915101

These errors are shown in tomcat logs:


26-Sep-2024 02:14:33.473 SEVERE [main] org.apache.catalina.core.ApplicationContext.log Servlet.init() for servlet [springDispatcher] threw exception
    org.springframework.jdbc.BadSqlGrammarException: PreparedStatementCallback; bad SQL grammar [select e.id, e.typeId, e.typeRef1, e.typeRef2,e.activeTs,e.rtnApplicable, e.rtnTs,e.rtnCause, e.alarmLevel, e.message, e.shortMessage, e.ackTs, e.ackUserId, u.username,e.alternateAckSource from events e left join users u on e.ackUserId=u.id  where  e.rtnApplicable=? and (e.rtnTs is null or e.rtnTs=0)]; nested exception is com.mysql.jdbc.exceptions.jdbc4.MySQLSyntaxErrorException: Unknown column 'e.shortMessage' in 'field list'
        at org.springframework.jdbc.support.SQLErrorCodeSQLExceptionTranslator.doTranslate(SQLErrorCodeSQLExceptionTranslator.java:231)
        at org.springframework.jdbc.support.AbstractFallbackSQLExceptionTranslator.translate(AbstractFallbackSQLExceptionTranslator.java:73)
        at org.springframework.jdbc.core.JdbcTemplate.execute(JdbcTemplate.java:655)
        at org.springframework.jdbc.core.JdbcTemplate.query(JdbcTemplate.java:690)
        at org.springframework.jdbc.core.JdbcTemplate.query(JdbcTemplate.java:722)
        at org.springframework.jdbc.core.JdbcTemplate.query(JdbcTemplate.java:732)
        at org.springframework.jdbc.core.JdbcTemplate.query(JdbcTemplate.java:782)
        at org.scada_lts.dao.event.EventDAO.filtered(EventDAO.java:900)
        at org.scada_lts.mango.service.EventService.getActiveEvents(EventService.java:198)
        at com.serotonin.mango.rt.EventManager.initialize(EventManager.java:324)
        at com.serotonin.mango.MangoContextListener.eventManagerInitialize(MangoContextListener.java:500)
        at com.serotonin.mango.MangoContextListener.initialized(MangoContextListener.java:143)
        at com.serotonin.mango.MangoContextListener.contextInitialized(MangoContextListener.java:93)
        at org.scada_lts.web.beans.ScadaContextRefreshedEvent.onApplicationEvent(ScadaContextRefreshedEvent.java:24)
        at org.scada_lts.web.beans.ScadaContextRefreshedEvent.onApplicationEvent(ScadaContextRefreshedEvent.java:11)
        at org.springframework.context.event.SimpleApplicationEventMulticaster.doInvokeListener(SimpleApplicationEventMulticaster.java:172)
        at org.springframework.context.event.SimpleApplicationEventMulticaster.invokeListener(SimpleApplicationEventMulticaster.java:165)
        at org.springframework.context.event.SimpleApplicationEventMulticaster.multicastEvent(SimpleApplicationEventMulticaster.java:139)
        at org.springframework.context.support.AbstractApplicationContext.publishEvent(AbstractApplicationContext.java:393)
        at org.springframework.context.support.AbstractApplicationContext.publishEvent(AbstractApplicationContext.java:347)
        at org.springframework.context.support.AbstractApplicationContext.finishRefresh(AbstractApplicationContext.java:883)
        at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:546)
        at org.springframework.web.servlet.FrameworkServlet.configureAndRefreshWebApplicationContext(FrameworkServlet.java:668)
        at org.springframework.web.servlet.FrameworkServlet.createWebApplicationContext(FrameworkServlet.java:634)
        at org.springframework.web.servlet.FrameworkServlet.createWebApplicationContext(FrameworkServlet.java:682)
        at org.springframework.web.servlet.FrameworkServlet.initWebApplicationContext(FrameworkServlet.java:553)
        at org.springframework.web.servlet.FrameworkServlet.initServletBean(FrameworkServlet.java:494)
        at org.springframework.web.servlet.HttpServletBean.init(HttpServletBean.java:171)
        at javax.servlet.GenericServlet.init(GenericServlet.java:143)
        at org.apache.catalina.core.StandardWrapper.initServlet(StandardWrapper.java:984)
        at org.apache.catalina.core.StandardWrapper.loadServlet(StandardWrapper.java:941)
        at org.apache.catalina.core.StandardWrapper.load(StandardWrapper.java:838)
        at org.apache.catalina.core.StandardContext.loadOnStartup(StandardContext.java:4180)
        at org.apache.catalina.core.StandardContext.startInternal(StandardContext.java:4480)
        at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:164)
        at org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase.java:599)
        at org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:571)
        at org.apache.catalina.core.StandardHost.addChild(StandardHost.java:603)
        at org.apache.catalina.startup.HostConfig.deployWAR(HostConfig.java:1014)
        at org.apache.catalina.startup.HostConfig$DeployWar.run(HostConfig.java:1866)
        at java.base/java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:539)
        at java.base/java.util.concurrent.FutureTask.run(FutureTask.java:264)
        at org.apache.tomcat.util.threads.InlineExecutorService.execute(InlineExecutorService.java:75)
        at java.base/java.util.concurrent.AbstractExecutorService.submit(AbstractExecutorService.java:123)
        at org.apache.catalina.startup.HostConfig.deployWARs(HostConfig.java:816)
        at org.apache.catalina.startup.HostConfig.deployApps(HostConfig.java:468)
        at org.apache.catalina.startup.HostConfig.start(HostConfig.java:1584)
        at org.apache.catalina.startup.HostConfig.lifecycleEvent(HostConfig.java:312)
        at org.apache.catalina.util.LifecycleBase.fireLifecycleEvent(LifecycleBase.java:109)
        at org.apache.catalina.util.LifecycleBase.setStateInternal(LifecycleBase.java:385)
        at org.apache.catalina.util.LifecycleBase.setState(LifecycleBase.java:332)
        at org.apache.catalina.core.ContainerBase.startInternal(ContainerBase.java:776)
        at org.apache.catalina.core.StandardHost.startInternal(StandardHost.java:721)
        at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:164)
        at org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1203)
        at org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1193)
        at java.base/java.util.concurrent.FutureTask.run(FutureTask.java:264)
        at org.apache.tomcat.util.threads.InlineExecutorService.execute(InlineExecutorService.java:75)
        at java.base/java.util.concurrent.AbstractExecutorService.submit(AbstractExecutorService.java:145)
        at org.apache.catalina.core.ContainerBase.startInternal(ContainerBase.java:749)
        at org.apache.catalina.core.StandardEngine.startInternal(StandardEngine.java:211)
        at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:164)
        at org.apache.catalina.core.StandardService.startInternal(StandardService.java:415)
        at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:164)
        at org.apache.catalina.core.StandardServer.startInternal(StandardServer.java:874)
        at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:164)
        at org.apache.catalina.startup.Catalina.start(Catalina.java:735)
        at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:77)
        at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
        at java.base/java.lang.reflect.Method.invoke(Method.java:569)
        at org.apache.catalina.startup.Bootstrap.start(Bootstrap.java:345)
        at org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:473)
    Caused by: com.mysql.jdbc.exceptions.jdbc4.MySQLSyntaxErrorException: Unknown column 'e.shortMessage' in 'field list'
        at java.base/jdk.internal.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
        at java.base/jdk.internal.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:77)
        at java.base/jdk.internal.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
        at java.base/java.lang.reflect.Constructor.newInstanceWithCaller(Constructor.java:500)
        at java.base/java.lang.reflect.Constructor.newInstance(Constructor.java:481)
        at com.mysql.jdbc.Util.handleNewInstance(Util.java:403)
        at com.mysql.jdbc.Util.getInstance(Util.java:386)
        at com.mysql.jdbc.SQLError.createSQLException(SQLError.java:944)
        at com.mysql.jdbc.MysqlIO.checkErrorPacket(MysqlIO.java:3933)
        at com.mysql.jdbc.MysqlIO.checkErrorPacket(MysqlIO.java:3869)
        at com.mysql.jdbc.MysqlIO.sendCommand(MysqlIO.java:2524)
        at com.mysql.jdbc.MysqlIO.sqlQueryDirect(MysqlIO.java:2675)
        at com.mysql.jdbc.ConnectionImpl.execSQL(ConnectionImpl.java:2465)
        at com.mysql.jdbc.PreparedStatement.executeInternal(PreparedStatement.java:1915)
        at com.mysql.jdbc.PreparedStatement.executeQuery(PreparedStatement.java:2023)
        at jdk.internal.reflect.GeneratedMethodAccessor135.invoke(Unknown Source)
        at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
        at java.base/java.lang.reflect.Method.invoke(Method.java:569)
        at org.apache.tomcat.jdbc.pool.interceptor.AbstractQueryReport$StatementProxy.invoke(AbstractQueryReport.java:214)
        at jdk.proxy2/jdk.proxy2.$Proxy122.executeQuery(Unknown Source)
        at jdk.internal.reflect.GeneratedMethodAccessor135.invoke(Unknown Source)
        at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
        at java.base/java.lang.reflect.Method.invoke(Method.java:569)
        at org.apache.tomcat.jdbc.pool.interceptor.AbstractQueryReport$StatementProxy.invoke(AbstractQueryReport.java:214)
        at jdk.proxy2/jdk.proxy2.$Proxy122.executeQuery(Unknown Source)
        at jdk.internal.reflect.GeneratedMethodAccessor135.invoke(Unknown Source)
        at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
        at java.base/java.lang.reflect.Method.invoke(Method.java:569)
        at org.apache.tomcat.jdbc.pool.StatementFacade$StatementProxy.invoke(StatementFacade.java:123)
        at jdk.proxy2/jdk.proxy2.$Proxy122.executeQuery(Unknown Source)
        at org.springframework.jdbc.core.JdbcTemplate$1.doInPreparedStatement(JdbcTemplate.java:698)
        at org.springframework.jdbc.core.JdbcTemplate.execute(JdbcTemplate.java:639)
        ... 70 more
26-Sep-2024 02:14:33.476 SEVERE [main] org.apache.catalina.core.StandardContext.loadOnStartup Servlet [springDispatcher] in web application [/Scada-LTS] threw load() exception
    com.mysql.jdbc.exceptions.jdbc4.MySQLSyntaxErrorException: Unknown column 'e.shortMessage' in 'field list'
        at java.base/jdk.internal.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
        at java.base/jdk.internal.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:77)
        at java.base/jdk.internal.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
        at java.base/java.lang.reflect.Constructor.newInstanceWithCaller(Constructor.java:500)
        at java.base/java.lang.reflect.Constructor.newInstance(Constructor.java:481)
        at com.mysql.jdbc.Util.handleNewInstance(Util.java:403)
        at com.mysql.jdbc.Util.getInstance(Util.java:386)
        at com.mysql.jdbc.SQLError.createSQLException(SQLError.java:944)
        at com.mysql.jdbc.MysqlIO.checkErrorPacket(MysqlIO.java:3933)
        at com.mysql.jdbc.MysqlIO.checkErrorPacket(MysqlIO.java:3869)
        at com.mysql.jdbc.MysqlIO.sendCommand(MysqlIO.java:2524)
        at com.mysql.jdbc.MysqlIO.sqlQueryDirect(MysqlIO.java:2675)
        at com.mysql.jdbc.ConnectionImpl.execSQL(ConnectionImpl.java:2465)
        at com.mysql.jdbc.PreparedStatement.executeInternal(PreparedStatement.java:1915)
        at com.mysql.jdbc.PreparedStatement.executeQuery(PreparedStatement.java:2023)
        at jdk.internal.reflect.GeneratedMethodAccessor135.invoke(Unknown Source)
        at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
        at java.base/java.lang.reflect.Method.invoke(Method.java:569)
        at org.apache.tomcat.jdbc.pool.interceptor.AbstractQueryReport$StatementProxy.invoke(AbstractQueryReport.java:214)
        at jdk.proxy2/jdk.proxy2.$Proxy122.executeQuery(Unknown Source)
        at jdk.internal.reflect.GeneratedMethodAccessor135.invoke(Unknown Source)
        at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
        at java.base/java.lang.reflect.Method.invoke(Method.java:569)
        at org.apache.tomcat.jdbc.pool.interceptor.AbstractQueryReport$StatementProxy.invoke(AbstractQueryReport.java:214)
        at jdk.proxy2/jdk.proxy2.$Proxy122.executeQuery(Unknown Source)
        at jdk.internal.reflect.GeneratedMethodAccessor135.invoke(Unknown Source)
        at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
        at java.base/java.lang.reflect.Method.invoke(Method.java:569)
        at org.apache.tomcat.jdbc.pool.StatementFacade$StatementProxy.invoke(StatementFacade.java:123)
        at jdk.proxy2/jdk.proxy2.$Proxy122.executeQuery(Unknown Source)
        at org.springframework.jdbc.core.JdbcTemplate$1.doInPreparedStatement(JdbcTemplate.java:698)
        at org.springframework.jdbc.core.JdbcTemplate.execute(JdbcTemplate.java:639)
        at org.springframework.jdbc.core.JdbcTemplate.query(JdbcTemplate.java:690)
        at org.springframework.jdbc.core.JdbcTemplate.query(JdbcTemplate.java:722)
        at org.springframework.jdbc.core.JdbcTemplate.query(JdbcTemplate.java:732)
        at org.springframework.jdbc.core.JdbcTemplate.query(JdbcTemplate.java:782)
        at org.scada_lts.dao.event.EventDAO.filtered(EventDAO.java:900)
        at org.scada_lts.mango.service.EventService.getActiveEvents(EventService.java:198)
        at com.serotonin.mango.rt.EventManager.initialize(EventManager.java:324)
        at com.serotonin.mango.MangoContextListener.eventManagerInitialize(MangoContextListener.java:500)
        at com.serotonin.mango.MangoContextListener.initialized(MangoContextListener.java:143)
        at com.serotonin.mango.MangoContextListener.contextInitialized(MangoContextListener.java:93)
        at org.scada_lts.web.beans.ScadaContextRefreshedEvent.onApplicationEvent(ScadaContextRefreshedEvent.java:24)
        at org.scada_lts.web.beans.ScadaContextRefreshedEvent.onApplicationEvent(ScadaContextRefreshedEvent.java:11)
        at org.springframework.context.event.SimpleApplicationEventMulticaster.doInvokeListener(SimpleApplicationEventMulticaster.java:172)
        at org.springframework.context.event.SimpleApplicationEventMulticaster.invokeListener(SimpleApplicationEventMulticaster.java:165)
        at org.springframework.context.event.SimpleApplicationEventMulticaster.multicastEvent(SimpleApplicationEventMulticaster.java:139)
        at org.springframework.context.support.AbstractApplicationContext.publishEvent(AbstractApplicationContext.java:393)
        at org.springframework.context.support.AbstractApplicationContext.publishEvent(AbstractApplicationContext.java:347)
        at org.springframework.context.support.AbstractApplicationContext.finishRefresh(AbstractApplicationContext.java:883)
        at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:546)
        at org.springframework.web.servlet.FrameworkServlet.configureAndRefreshWebApplicationContext(FrameworkServlet.java:668)
        at org.springframework.web.servlet.FrameworkServlet.createWebApplicationContext(FrameworkServlet.java:634)
        at org.springframework.web.servlet.FrameworkServlet.createWebApplicationContext(FrameworkServlet.java:682)
        at org.springframework.web.servlet.FrameworkServlet.initWebApplicationContext(FrameworkServlet.java:553)
        at org.springframework.web.servlet.FrameworkServlet.initServletBean(FrameworkServlet.java:494)
        at org.springframework.web.servlet.HttpServletBean.init(HttpServletBean.java:171)
        at javax.servlet.GenericServlet.init(GenericServlet.java:143)
        at org.apache.catalina.core.StandardWrapper.initServlet(StandardWrapper.java:984)
        at org.apache.catalina.core.StandardWrapper.loadServlet(StandardWrapper.java:941)
        at org.apache.catalina.core.StandardWrapper.load(StandardWrapper.java:838)
        at org.apache.catalina.core.StandardContext.loadOnStartup(StandardContext.java:4180)
        at org.apache.catalina.core.StandardContext.startInternal(StandardContext.java:4480)
        at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:164)
        at org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase.java:599)
        at org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:571)
        at org.apache.catalina.core.StandardHost.addChild(StandardHost.java:603)
        at org.apache.catalina.startup.HostConfig.deployWAR(HostConfig.java:1014)
        at org.apache.catalina.startup.HostConfig$DeployWar.run(HostConfig.java:1866)
        at java.base/java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:539)
        at java.base/java.util.concurrent.FutureTask.run(FutureTask.java:264)
        at org.apache.tomcat.util.threads.InlineExecutorService.execute(InlineExecutorService.java:75)
        at java.base/java.util.concurrent.AbstractExecutorService.submit(AbstractExecutorService.java:123)
        at org.apache.catalina.startup.HostConfig.deployWARs(HostConfig.java:816)
        at org.apache.catalina.startup.HostConfig.deployApps(HostConfig.java:468)
        at org.apache.catalina.startup.HostConfig.start(HostConfig.java:1584)
        at org.apache.catalina.startup.HostConfig.lifecycleEvent(HostConfig.java:312)
        at org.apache.catalina.util.LifecycleBase.fireLifecycleEvent(LifecycleBase.java:109)
        at org.apache.catalina.util.LifecycleBase.setStateInternal(LifecycleBase.java:385)
        at org.apache.catalina.util.LifecycleBase.setState(LifecycleBase.java:332)
        at org.apache.catalina.core.ContainerBase.startInternal(ContainerBase.java:776)
        at org.apache.catalina.core.StandardHost.startInternal(StandardHost.java:721)
        at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:164)
        at org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1203)
        at org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1193)
        at java.base/java.util.concurrent.FutureTask.run(FutureTask.java:264)
        at org.apache.tomcat.util.threads.InlineExecutorService.execute(InlineExecutorService.java:75)
        at java.base/java.util.concurrent.AbstractExecutorService.submit(AbstractExecutorService.java:145)
        at org.apache.catalina.core.ContainerBase.startInternal(ContainerBase.java:749)
        at org.apache.catalina.core.StandardEngine.startInternal(StandardEngine.java:211)
        at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:164)
        at org.apache.catalina.core.StandardService.startInternal(StandardService.java:415)
        at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:164)
        at org.apache.catalina.core.StandardServer.startInternal(StandardServer.java:874)
        at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:164)
        at org.apache.catalina.startup.Catalina.start(Catalina.java:735)
        at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:77)
        at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
        at java.base/java.lang.reflect.Method.invoke(Method.java:569)
        at org.apache.catalina.startup.Bootstrap.start(Bootstrap.java:345)
        at org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:473)
26-Sep-2024 02:14:44.994 INFO [main] org.apache.catalina.core.ApplicationContext.log No Spring WebApplicationInitializer types detected on classpath

I found out these fields are not being created when the application creates the database structure on first execution. They are present in migration classes in the sources (src/org/scada_lts/dao/migration/mysql/) but the new ones are somehow not being applied.

mysql> desc users;
+-----------------------+--------------+------+-----+---------+----------------+
| Field                 | Type         | Null | Key | Default | Extra          |
+-----------------------+--------------+------+-----+---------+----------------+
| id                    | int          | NO   | PRI | NULL    | auto_increment |
| username              | varchar(40)  | NO   |     | NULL    |                |
| password              | varchar(30)  | NO   |     | NULL    |                |
| email                 | varchar(255) | NO   |     | NULL    |                |
| phone                 | varchar(40)  | YES  |     | NULL    |                |
| admin                 | char(1)      | NO   |     | NULL    |                |
| disabled              | char(1)      | NO   |     | NULL    |                |
| lastLogin             | bigint       | YES  |     | NULL    |                |
| selectedWatchList     | int          | YES  |     | NULL    |                |
| homeUrl               | varchar(255) | YES  |     | NULL    |                |
| receiveAlarmEmails    | int          | NO   |     | NULL    |                |
| receiveOwnAuditEvents | char(1)      | NO   |     | NULL    |                |
+-----------------------+--------------+------+-----+---------+----------------+
12 rows in set (0.00 sec)

mysql> 

For instance, the table "users" is clearly missing the columns "hideMenu" and "theme", which are defined in _V2_7_0_1_UserParameters.java (line 13):

jdbcTmp.execute("ALTER TABLE users " +
                "ADD hideMenu BOOLEAN DEFAULT false, " +
                "ADD theme VARCHAR(255) DEFAULT 'DEFAULT';");

The table "events" is missing column "shortMessage" which is defined in _V2_6_.java (line 43):

jdbcTmp.execute("ALTER TABLE events ADD shortMessage LONGTEXT;");

And so on...

(The latest Docker version creates the database correctly.)

Scada-LTS version: v2.7.8 (Github ref. 6791491) Tomcat version: 9.0.95 Java version: JRE 17.0.12+7-Debian-2deb12u1 (also tried with jdk-11.0.2) Mysql version: 8.4.2 MySQL Community Server OS: Debian 12.7 - Linux kernel 6.1.0-25-amd64

Screenshot from 2024-09-26 00-06-02

Limraj commented 2 months ago

Hi @felipecarneiro, Simply put, the first time you ran it, you didn't wait for the app to finish migrating the database. That process was interrupted and now there's a problem.

  1. What do you have in the schema_version table? select * from scadalts.schema_version; We can try to remove the record related to the failed migration and run the application again.
  2. This is a fresh install, without data?
  3. How did you install the application? We recommend using our installers for first time installation: https://github.com/SCADA-LTS/linux-installer/releases and version 2.7.8. Instruction on main page: https://github.com/SCADA-LTS/linux-installer
Limraj commented 1 month ago

Hi @felipecarneiro, what is the situation, has the problem been solved?

Regards.

felipecarneiro commented 1 month ago

Hi, I didn’t have time to test this week yet, I’m going to replicate the scenario again and post the test results. Thanks!

On Thu, Oct 3, 2024 at 10:22 AM Kamil Jarmusik @.***> wrote:

Closed #3024 https://github.com/SCADA-LTS/Scada-LTS/issues/3024 as completed.

— Reply to this email directly, view it on GitHub https://github.com/SCADA-LTS/Scada-LTS/issues/3024#event-14504471436, or unsubscribe https://github.com/notifications/unsubscribe-auth/AB552RYW7CJISKKXUEMAKQTZZVAJLAVCNFSM6AAAAABO4A3KT6VHI2DSMVQWIX3LMV45UABCJFZXG5LFIV3GK3TUJZXXI2LGNFRWC5DJN5XDWMJUGUYDINBXGE2DGNQ . You are receiving this because you were mentioned.Message ID: @.***>

Limraj commented 1 month ago

Hi @felipecarneiro, you can ask here: https://github.com/SCADA-LTS/Scada-LTS/discussions