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
700 stars 283 forks source link

MQTT add new datasource can't save #2920

Closed subairi closed 1 month ago

subairi commented 1 month ago

Describe the bug i just install from [Scada-LTS_v2.7.7.3_Installer_v2.0.2_Setup.exe] , when add Data Sources MQTT and click save button, but can't save, just blink icon save for long time. server host: test.mosquitto.org port: 1883

Limraj commented 1 month ago

Hi @subairi, image I cannot reproduce this problem, I run the mqtt broker from Docker and I can save this data source normally, after almost 2 seconds the information data source saved appears.

  1. In 'Current alarms' there are also entries when the broker was not running. Do you see any errors in 'Current alarms'? You can send me a screenshot.
  2. Send tomcat/logs, Do you see any errors in the logs?
  3. Try changing the port or host to an address where there is no broker and how will it behave then? Do you see any errors in 'Current alarms'?
  4. Try changing the Mqtt protocol versions: image
  5. I guess it can't connect to the broker and is waiting for timeout. You can reduce the timeout (e.g. to 1000), if it somehow affects the behavior.
  6. It's best to send me a screenshot of your configuration of this Data Source, maybe you have the update set high, e.g. to 5 minutes.
  7. It also works for me on this test host: image

I configured one point to be a settable on topic /a/b and the other for reading on /a/b/ and it works on this test broker: image

  1. Iam testing on version: image
  2. Describe your configuration, how many Data Sources and Data Points of what type you have, and if possible, send an export of the project. (On Main page click on Import/Export ->Export Project (Download) -> Click on button 'Export Project')

Regards, Kamil Jarmusik

subairi commented 1 month ago

ERROR 2024-06-11T08:37:13,020 (org.scada_lts.mango.service.SystemSettingsService.getWebResourceGraphicsPath:433) - PreparedStatementCallback; bad SQL grammar [select settingValue from systemSettings where settingName=? ]; nested exception is com.mysql.jdbc.exceptions.jdbc4.MySQLSyntaxErrorException: Table 'scadalts.systemsettings' doesn't exist INFO 2024-06-11T08:37:15,357 (com.serotonin.mango.db.MySQLAccess.newDatabaseCheck:103) - schemaExist:false INFO 2024-06-11T08:37:15,357 (com.serotonin.mango.db.MySQLAccess.newDatabaseCheck:111) - BaseLineNotExist:true WARN 2024-06-11T08:37:15,373 (org.flywaydb.core.internal.logging.slf4j.Slf4jLog.warn:53) - Use of dots (.) as path separators will be deprecated in Flyway 7. Path: org.scada_lts.dao.migration.mysql INFO 2024-06-11T08:37:15,388 (org.flywaydb.core.internal.logging.slf4j.Slf4jLog.info:49) - Flyway Community Edition 6.5.5 by Redgate INFO 2024-06-11T08:37:15,451 (org.flywaydb.core.internal.logging.slf4j.Slf4jLog.info:49) - Database: jdbc:mysql://localhost:3306/scadalts (MySQL 8.0) INFO 2024-06-11T08:37:15,542 (org.flywaydb.core.internal.logging.slf4j.Slf4jLog.info:49) - Successfully validated 30 migrations (execution time 00:00.030s) INFO 2024-06-11T08:37:15,570 (org.flywaydb.core.internal.logging.slf4j.Slf4jLog.info:49) - Creating Schema History table scadalts.schema_version ... INFO 2024-06-11T08:37:15,653 (org.flywaydb.core.internal.logging.slf4j.Slf4jLog.info:49) - Current version of schema scadalts: << Empty Schema >> INFO 2024-06-11T08:37:15,653 (org.flywaydb.core.internal.logging.slf4j.Slf4jLog.info:49) - Migrating schema scadalts to version 1 - BaseVersion INFO 2024-06-11T08:37:17,826 (org.flywaydb.core.internal.logging.slf4j.Slf4jLog.info:49) - Migrating schema scadalts to version 1.1 - ViewsHierarchy INFO 2024-06-11T08:37:17,919 (org.flywaydb.core.internal.logging.slf4j.Slf4jLog.info:49) - Migrating schema scadalts to version 1.2 - SetViewSizeProperties INFO 2024-06-11T08:37:17,935 (org.flywaydb.core.internal.logging.slf4j.Slf4jLog.info:49) - Migrating schema scadalts to version 1.3 - SetXidPointHierarchy INFO 2024-06-11T08:37:17,982 (org.flywaydb.core.internal.logging.slf4j.Slf4jLog.info:49) - Migrating schema scadalts to version 2.0 - CMP history INFO 2024-06-11T08:37:18,015 (org.flywaydb.core.internal.logging.slf4j.Slf4jLog.info:49) - Migrating schema scadalts to version 2.3 - FaultsAndAlarms WARN 2024-06-11T08:37:18,031 (org.scada_lts.dao.migration.mysql.V2_3FaultsAndAlarms.migrate:76) - org.springframework.jdbc.BadSqlGrammarException: StatementCallback; bad SQL grammar [ALTER TABLE dataPoints DROP COLUMN pointName;]; nested exception is com.mysql.jdbc.exceptions.jdbc4.MySQLSyntaxErrorException: Can't DROP 'pointName'; check that column/key exists WARN 2024-06-11T08:37:18,037 (org.scada_lts.dao.migration.mysql.V2_3FaultsAndAlarms.migrate:92) - org.springframework.jdbc.BadSqlGrammarException: StatementCallback; bad SQL grammar [ALTER TABLE dataPoints DROP COLUMN plcAlarmLevel;]; nested exception is com.mysql.jdbc.exceptions.jdbc4.MySQLSyntaxErrorException: Can't DROP 'plcAlarmLevel'; check that column/key exists INFO 2024-06-11T08:37:18,112 (org.flywaydb.core.internal.logging.slf4j.Slf4jLog.info:49) - Migrating schema scadalts to version 2.4 INFO 2024-06-11T08:37:18,138 (org.flywaydb.core.internal.logging.slf4j.Slf4jLog.info:49) - Migrating schema scadalts to version 2.5 - ScheduledExecuteInactiveEvent INFO 2024-06-11T08:37:18,200 (org.flywaydb.core.internal.logging.slf4j.Slf4jLog.info:49) - Migrating schema scadalts to version 2.6 INFO 2024-06-11T08:37:18,231 (org.flywaydb.core.internal.logging.slf4j.Slf4jLog.info:49) - Migrating schema scadalts to version 2.6.5.0 - ZIndexForViewComponent INFO 2024-06-11T08:37:18,247 (org.flywaydb.core.internal.logging.slf4j.Slf4jLog.info:49) - Migrating schema scadalts to version 2.7.0.1 - UserParameters INFO 2024-06-11T08:37:18,294 (org.flywaydb.core.internal.logging.slf4j.Slf4jLog.info:49) - Migrating schema scadalts to version 2.7.0.2 - FixViewPermissions INFO 2024-06-11T08:37:18,310 (org.flywaydb.core.internal.logging.slf4j.Slf4jLog.info:49) - Migrating schema scadalts to version 2.7.0.3 - AnonymousUser INFO 2024-06-11T08:37:18,325 (org.flywaydb.core.internal.logging.slf4j.Slf4jLog.info:49) - Migrating schema scadalts to version 2.7.0.4 - ExtendedDelayForMetaDatapoints INFO 2024-06-11T08:37:18,341 (org.flywaydb.core.internal.logging.slf4j.Slf4jLog.info:49) - Migrating schema scadalts to version 2.7.0.4.1 - CorrectProcedurePrcAlarmsNotify INFO 2024-06-11T08:37:18,356 (org.flywaydb.core.internal.logging.slf4j.Slf4jLog.info:49) - Migrating schema scadalts to version 2.7.0.4.2 - MultiChangeHistory INFO 2024-06-11T08:37:18,388 (org.flywaydb.core.internal.logging.slf4j.Slf4jLog.info:49) - Migrating schema scadalts to version 2.7.0.5 - SynopticPanel INFO 2024-06-11T08:37:18,403 (org.flywaydb.core.internal.logging.slf4j.Slf4jLog.info:49) - Migrating schema scadalts to version 2.7.1.0 - UserNames INFO 2024-06-11T08:37:18,450 (org.flywaydb.core.internal.logging.slf4j.Slf4jLog.info:49) - Migrating schema scadalts to version 2.7.1.1 - HttpRetriever INFO 2024-06-11T08:37:18,466 (org.flywaydb.core.internal.logging.slf4j.Slf4jLog.info:49) - Migrating schema scadalts to version 2.7.1.2 - PurgeLimitStrategyDatapointProperty INFO 2024-06-11T08:37:18,481 (org.flywaydb.core.internal.logging.slf4j.Slf4jLog.info:49) - Migrating schema scadalts to version 2.7.1.3 - ExportImportReport INFO 2024-06-11T08:37:18,497 (org.flywaydb.core.internal.logging.slf4j.Slf4jLog.info:49) - Migrating schema scadalts to version 2.7.2.1 - MqttPointLocatorUpdateDataPointXid INFO 2024-06-11T08:37:18,513 (org.flywaydb.core.internal.logging.slf4j.Slf4jLog.info:49) - Migrating schema scadalts to version 2.7.3.0 - SqlDataSourceUpdate INFO 2024-06-11T08:37:18,528 (org.flywaydb.core.internal.logging.slf4j.Slf4jLog.info:49) - Migrating schema scadalts to version 2.7.4.1 - AddSoapServicesUser INFO 2024-06-11T08:37:18,544 (org.flywaydb.core.internal.logging.slf4j.Slf4jLog.info:49) - Migrating schema scadalts to version 2.7.5.3 - AddLangToUser INFO 2024-06-11T08:37:18,591 (org.flywaydb.core.internal.logging.slf4j.Slf4jLog.info:49) - Migrating schema scadalts to version 2.7.5.3.1 - AddHttpdsUser INFO 2024-06-11T08:37:18,606 (org.flywaydb.core.internal.logging.slf4j.Slf4jLog.info:49) - Migrating schema scadalts to version 2.7.5.3.2 - AddFullScreenToUser INFO 2024-06-11T08:37:18,669 (org.flywaydb.core.internal.logging.slf4j.Slf4jLog.info:49) - Migrating schema scadalts to version 2.7.5.4.1 - UpdateAbsoluteToRelativeUrlInLinkComponent INFO 2024-06-11T08:37:18,669 (org.flywaydb.core.internal.logging.slf4j.Slf4jLog.info:49) - Migrating schema scadalts to version 2.7.6.1 - ChangeLengthLimitForSettingName INFO 2024-06-11T08:37:18,711 (org.flywaydb.core.internal.logging.slf4j.Slf4jLog.info:49) - Migrating schema scadalts to version 2.7.7.1 - SqlDataSourceLimit INFO 2024-06-11T08:37:18,716 (org.flywaydb.core.internal.logging.slf4j.Slf4jLog.info:49) - Successfully applied 30 migrations to schema scadalts (execution time 00:03.073s) INFO 2024-06-11T08:37:18,736 (org.flywaydb.core.internal.logging.slf4j.Slf4jLog.info:49) - Successfully validated 30 migrations (execution time 00:00.004s) INFO 2024-06-11T08:37:18,741 (org.flywaydb.core.internal.logging.slf4j.Slf4jLog.info:49) - Current version of schema scadalts: 2.7.7.1 INFO 2024-06-11T08:37:18,741 (org.flywaydb.core.internal.logging.slf4j.Slf4jLog.info:49) - Schema scadalts is up to date. No migration necessary. INFO 2024-06-11T08:37:18,748 (org.scada_lts.quartz.ScadaScheduler.doSchedule:116) - Quartz - job-ResetCacheHighestAlarmLevel scheduled, Trigger 'DEFAULT.Quartz - trigger-ResetCacheHighestAlarmLevel': triggerClass: 'org.quartz.CronTrigger isVolatile: false calendar: 'null' misfireInstruction: 0 nextFireTime: Tue Jun 11 10:00:00 ICT 2024 INFO 2024-06-11T08:37:18,774 (com.serotonin.mango.MangoContextListener.initialized:150) - Cache event detectors initialized INFO 2024-06-11T08:37:18,776 (com.serotonin.mango.MangoContextListener.initialized:157) - Cache data points initialized INFO 2024-06-11T08:37:18,793 (org.scada_lts.quartz.ScadaScheduler.doSchedule:116) - Quartz - job-DataSourcePointsCache scheduled, Trigger 'DEFAULT.Quartz - trigger-DataSourcePointsCache': triggerClass: 'org.quartz.CronTrigger isVolatile: false calendar: 'null' misfireInstruction: 0 nextFireTime: Tue Jun 11 08:38:00 ICT 2024 INFO 2024-06-11T08:37:18,809 (com.serotonin.mango.MangoContextListener.initialized:176) - Cache point hierarchy initialized INFO 2024-06-11T08:37:18,809 (com.serotonin.mango.MangoContextListener.initialized:183) - Cache views initialized INFO 2024-06-11T08:37:18,871 (com.serotonin.mango.MangoContextListener.initialized:190) - Cache views hierarchy initialized INFO 2024-06-11T08:37:18,872 (org.scada_lts.quartz.ScadaScheduler.doSchedule:116) - Quartz - job-EverySecond scheduled, Trigger 'DEFAULT.Quartz - trigger-EverySecondTrigger': triggerClass: 'org.quartz.CronTrigger isVolatile: false calendar: 'null' misfireInstruction: 0 nextFireTime: Tue Jun 11 08:37:07 ICT 2024 INFO 2024-06-11T08:37:18,873 (com.serotonin.mango.MangoContextListener.initSchedule:655) - Quartz EverySecond initialized INFO 2024-06-11T08:37:18,873 (com.serotonin.mango.MangoContextListener.initialized:197) - Scada-LTS context started INFO 2024-06-11T10:00:00,300 (org.scada_lts.quartz.ResetCacheHighestAlarmLevel.execute:57) - ResetCacheHighestAlarmLevel executed in [141] ms Stable Library

subairi commented 1 month ago

this is major error?

ERROR 2024-06-11T08:37:13,020 (org.scada_lts.mango.service.SystemSettingsService.getWebResourceGraphicsPath:433) - PreparedStatementCallback; bad SQL grammar [select settingValue from systemSettings where settingName=? ]; nested exception is com.mysql.jdbc.exceptions.jdbc4.MySQLSyntaxErrorException: Table 'scadalts.systemsettings' doesn't exist

Limraj commented 1 month ago

Hi @subairi, Take a screenshot of 'Add or remove programs' with the Scada-LTS application: image

Attach logs as files.

Regards, Kamil Jarmusik

subairi commented 1 month ago

Screenshot 2024-06-11 144110

Limraj commented 1 month ago

@subairi

  1. Add logs as files from tomcat/logs.

  2. What kind of system is this? edit: Okay, it's windows 11

  3. I asked for a screenshot of the "Add or Remove Programs" function.

  4. Next: https://www.windowsdigitals.com/windows-11-system-properties-advanced-system-settings/ image Is there a CATALINA_HOME variable?

  5. Do you have any MySQL client installed? I recommend DBeaver: https://dbeaver.io/download/ How install and connection configure: https://github.com/SCADA-LTS/Scada-LTS/wiki/Getting-started-Development-%E2%80%90-Windows#21-mysql-client- If default installation then port is 3306;

  6. And execute query: select * from scadalts.schema_version; image If you have all 1 in the success column, the migration was successful.

  7. Try restarting tomcat, and send logs as files;

In the first message, I wrote to you about other steps that you did not take. In general, it is important that you try to follow these instructions, and if you cannot, this is also important information. The point is to send files, screenshots if possible, and not text. I need to have the complete picture, excluding error.

subairi commented 1 month ago

image

image

subairi commented 1 month ago

api.log catalina.2024-06-11.log commons-daemon.2024-06-11.log dao.log flyway.log history.log host-manager.2024-06-11.log localhost.2024-06-11.log manager.2024-06-11.log mango.log modbus.log scadaLTSDAO.log scada-lts-stderr.2024-06-11.log scada-lts-stdout.2024-06-11.log scripts.log viehierarchyservicelogfile.log

subairi commented 1 month ago

image

I was click save for 2 minutes but nothing happen

Limraj commented 1 month ago

@subairi,

  1. In addition to the attempt to create mqtt Data Source, have you created other Data Source?
  2. Try changing the Mqtt protocol versions ?
  3. I guess it can't connect to the broker and is waiting for timeout. You can reduce the timeout (e.g. to 1000), if it somehow affects the behavior ?
  4. Try set localhost? Does it behave the same with any host?
  5. In file scada-lts-stdout.2024-06-11.log
    
    INFO  2024-06-11T16:01:46,010 (com.serotonin.mango.MangoContextListener.initialized:197) - Scada-LTS context started 
    Stable Library
    =========================================
    Native lib Version = RXTX-2.2pre2
    Java lib Version   = RXTX-2.1-7
    WARNING:  RXTX Version mismatch
    Jar version = RXTX-2.1-7
    native lib Version = RXTX-2.2pre2

I can see that you tried installing rxtx, can you remove it and then try? This library is probably not stable and may cause serious problems. 

Downlaoded from: http://rxtx.qbang.org/wiki/index.php/Download ?

We tested this version and it is unstable, leads to a JVM crash, which leads to an immediate stop with a windows message that informs about an attempt to dangerously modify the memory. Having been working with Java for several years, I have never seen such behavior of the JVM. Therefore, I advise against using this build version. You can try to compile it yourself from sources, but we didn't try to do so. I would also advise against this.

Instead of Rxtx for Modbus Serial we use: 
https://github.com/SCADA-LTS/Scada-LTS/wiki/Getting-started-Development-%E2%80%90-Windows#jserialcomm---configuration-

So I recommend uninstalling rxtx and trying again.

I also recommend being very careful before installing native libraries, especially from unreliable sources, because you can do a lot of damage.
subairi commented 1 month ago

image

i Install version 2.7.6.1 is running well, while I use this version, thank you

Limraj commented 1 month ago

Hi @subairi, It's certainly not the version's fault, as I proved on the screenshots. I asked you to follow the steps above and let me know what the result was. Well, if you don't want to cooperate, we can't figure out what happened.

We recommend using the stable version 2.6.18 or the latest prerelease version. (actual v2.7.7.3)

subairi commented 1 month ago
  1. i install version 2.7.6.1 it was running, then i change SCADA_LTS.WAR with version 2.7.7.3
    • first error on running tomcat

localhost_access_log.2024-06-16.txt catalina.2024-06-16.log localhost.2024-06-16.log mango.log scada-lts-stderr.2024-06-15.log scada-lts-stdout.2024-06-15.log

2- i remove some text on Server.xml image

  1. restart tomcat and running well version 2.7.7.3
  2. but when i make new datasource MQTT there is stag on save new datasource proses save, in tomcat cli any warning like this:

INFO 2024-06-16T10:19:45,258 (org.scada_lts.quartz.ResetCacheHighestAlarmLevel.execute:57) - ResetCacheHighestAlarmLevel executed in [31] ms 16-Jun-2024 10:20:02.467 SEVERE [MQTT Ping: 0a8539e4-4034-48b7-ac3f-bb01a8ecb6ed] org.eclipse.paho.mqttv5.client.internal.ClientState.checkForActivity 0a8539e4-4034-48b7-ac3f-bb01a8ecb6ed: Timed out as no write activity, keepAlive=20.000.000.000 lastOutboundActivity=32.946.731.940.799 lastInboundActivity=48.962.325.931.000 time=48.979.906.063.600 lastPing=32.946.731.944.699 16-Jun-2024 10:21:15.174 WARNING [MQTT Call: 0a8539e4-4034-48b7-ac3f-bb01a8ecb6ed] org.apache.tomcat.jdbc.pool.interceptor.SlowQueryReport.reportSlowQuery Slow Query Report SQL=insert pointValues (dataPointId,dataType,pointValue,ts) values (?,?,?,?); time=2110 ms;

subairi commented 1 month ago

scada LTS exe CLI record.txt

subairi commented 1 month ago

In addition to the attempt to create mqtt Data Source, have you created other Data Source?

other data source running well

Try changing the Mqtt protocol versions ?

I was try changing protocol version 3 and 5, but nothing happen

I guess it can't connect to the broker and is waiting for timeout. You can reduce the timeout (e.g. to 1000), if it somehow affects the behavior ?

this condition was try to change timeout to 3000 Try set localhost? Does it behave the same with any host? this was try but nothing/ still probelm

subairi commented 1 month ago

2024-06-16 11:56:31 Apache Commons Daemon procrun stderr initialized. WARNING: An illegal reflective access operation has occurred WARNING: Illegal reflective access by org.eclipse.paho.mqttv5.client.internal.FileLock (file:/C:/Program%20Files/Scada-LTS/tomcat/webapps/Scada-LTS/WEB-INF/lib/org.eclipse.paho.mqttv5.client-1.2.5.jar) to method sun.nio.ch.FileLockImpl.release() WARNING: Please consider reporting this to the maintainers of org.eclipse.paho.mqttv5.client.internal.FileLock WARNING: Use --illegal-access=warn to enable warnings of further illegal reflective access operations WARNING: All illegal access operations will be denied in a future release

Limraj commented 1 month ago

@subairi, I'm sorry, but I can't help you if you do such stupid things instead of following the instructions and describing the situation. It's just not possible if you have these ideas. If you change your attitude and really need help, please contact me.

edit:

You uninstall:

  1. rxtx;
  2. jave;
  3. tomcat;
  4. MySQL server if you don't have important data there, and it seems that you have just started configuring something so no, you can export the configuration and then import it in the application. Click on Import/Export -> Export project.
  5. Then you install the applications following the instructions on the windows-installer main page, using the latest version of the installer: https://github.com/SCADA-LTS/windows-installer/releases/tag/v2.0.2
subairi commented 4 weeks ago

I was installed this version https://github.com/SCADA-LTS/windows-installer/releases/tag/v2.0.2 that problem on browser (EDGE), i change to use opera browser and it's running well, thanks for your attention