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
721 stars 289 forks source link

Traditional graphics are not loading #2794

Closed fabiodurao closed 7 months ago

fabiodurao commented 9 months ago

Describe the bug Traditional charts are not loading on the datapoint details screen, neither in the graphical representation nor in the watch list when the datapoint has a rendering of the chart render properties (image) type.

To Reproduce Steps to reproduce the behavior:

  1. Go to the watch list;
  2. Choose a numeric datapoint and click the magnifying glass to view the datapoint details;
  3. On the datapoint details screen, everything is loaded correctly, except the graph, even forcing the generation of a graph for a defined interval does not work either. The same is true in other places where this type of traditional (old) chart is used.

Expected behavior the graph was expected to load

Screenshots image

Desktop (please complete the following information):

Additional context In the new UI, amCharts charts in the watch list work.

fabiodurao commented 9 months ago

Attached are the tomcat logs. For additional context, I asked Fabrício (a github user here who is helping with the Linux installer) how his installation was going, and he told me that these graphics weren't working during his installation either.

logs.zip

Limraj commented 9 months ago

image

Hi @fabiodurao

If you can send me your json configuration...

Check whether tomcat has connected to the database or whether it has lost connection to the database. To check this, in the SQL tab you can call a select that will retrieve the values ​​for this problematic point.

weschenfelder commented 9 months ago

Hello @fabiodurao & @Limraj, my projects that are running on Linux also have the same situation, the graphics do not load.

V2.7.6.1 Ubuntu 22.04 LTS

image

Limraj commented 9 months ago

Hi @fabiodurao and @weschenfelder, I can't repeat it on Windows and MacOS(base unix), I still have to check it on Linux. I'll do it tommorow.

Regards, Kamil Jarmusik

fabiodurao commented 9 months ago

Thanks for the feedback, I have an application on Ubuntu 22.04 with SLTS 2.6.18 and the graph appears normally. I have another application on Windows with SLTS 2.7.5.4 and the graph also appears normally.

In this application that is causing the problem (SLTS 2.7.6.1) on Ubuntu 22.04, I am accessing it via VPN, but I don't believe that is it. I inspected it in Chrome using the F12 button and I didn't find any errors, it may be that I didn't do it correctly, I don't know the resource very well, but I went through all the available tabs and didn't find anything. I've already sent the json privately and the logs, but if you need any testing, you can tell me.

Limraj commented 9 months ago

Hi @fabiodurao , on linux mint(base ubuntu)

image

after using installer and import data then: image

For Data Point 'Temperatura' (You need to set a data range that includes the values): image

Brwoser:

  1. Open 'http://localhost:8080/Scada-LTS/data_point_details.shtm?dpid=point_id_with_values';
  2. Click on F12;
  3. Click ctrl+r and ctrl+f5; ('Reload ignore cache')
  4. Screenshot from network and console tab;

Tomcat:

  1. Stop tomcat;
  2. Removed all logs;
  3. Start tomcat and try scenario;
  4. Send all logs as zip;

Scada-LTS:

  1. Use feature 'Export project' and send to me zip with config project;
fabiodurao commented 9 months ago

I do step, 5, 6, 7, 1, 2, 3, 4 without click to generate chart.

image

image

Then I clicked to generate the graph with a period that I'm sure has data

image

image

I clicked a few more times and this appeared and Tomcat apparently crashed and I tried a reload which kept looping forever.

image

image

After that I had to stop tomcat and start it again and SLTS came back. I didn't need to restart mysql.

Below are the logs. Note: I'm using Brave, but I tested it with Chrome and the same thing happened, both are based on Chromium.

logs.zip

Limraj commented 9 months ago

I can't open/size increase these screenshots, I click on the thumbnail and have a 404... image

But I still see that you are showing me the contents of the network tab at the wrong moment, the point is that you open f12 and then reload/refresh the page, and even the smaller screenshots show that you don't do it this way. This is a request from the address: image

fabiodurao commented 9 months ago

below the old prints.

prints.zip

i will do again.

Limraj commented 9 months ago

If you want me to help you, please try to follow my instructions, otherwise I am unable to help. How do you upload screenshots? Can you enlarge the screenshots I am sharing?

Okay, I managed to open one of the screenshots, it looks like you need to wait for the chart, it looks like it's loading...

Limraj commented 9 months ago

An example link, look for a similar link in your home and try to open it in a separate tab, and show network: http://localhost:8080/Scada-LTS/chart/ft_1702940989145_1702854549000_-1_74.png?w=1148&h=350

fabiodurao commented 9 months ago

For me, all the prints opened in full screen (that's why I downloaded them, compressed them and sent them to you, I thought it was a github problem), but I'm on an ultrawide monitor, I changed the resolution to full HD (1920x1080) to make the prints as asked, maybe it will help.

image image

I don't know what's important, so I clicked on the task "ft_1702...." and took screenshots of all the tabs that opened.

image image image image image image image

I hope this helps you, if it's not good yet, I'll do it again in whatever way works best.

Limraj commented 9 months ago

They write here that the cause may be something like adblock: (pending status for the request) https://stackoverflow.com/questions/5585918/what-does-pending-mean-for-request-in-chrome-developer-window

I see that at the address on the right, you have an icon with a red dot, but in the address you also have a blocking icon, you probably need to pass or disable the blocking mechanism.

fabiodurao commented 9 months ago

I thought it could be that, Brave already has several privacy restrictions and has a native adblocker, but the icon to the left of the red is where the adblock is, and it is disabled, but as a precaution I tested it on Chrome and disabled the adblock plugin and I gave ctrl+f5 and got the same response, and finally, I tested it in Firefox, which is a browser I never use, so it is clean with factory defaults and I got the same response, could it be related to the VPN or to firewall restrictions on the server where the STLS is hosted?

Limraj commented 9 months ago

@fabiodurao It may be, but I would uninstall ad blocking apps and with that privacy, they are probably causing this problem even if they appear to be disabled.

Limraj commented 9 months ago

What do you have in request and response? Did he send this request at all or did he block it at the client level?

Limraj commented 9 months ago

In your log it looks like the request goes to tomcat: (localhost_access_log...) image

So I think that here the browser is blocking the content from being displayed.

chrome://settings/content/images?search=site+settings image

chrome://settings/content/insecureContent?search=site+settings image

These may be more advanced programs, or during installation, they configure browsers and even if you turn off this tool, the settings in the browser remain...

You can try uninstalling firefox and installing it, maybe it will help.

fabiodurao commented 9 months ago

I did all the procedures you mentioned and the behavior remains the same, it doesn't seem to be the browser in general, because I can load the graphic in a locally installed SLTS (2.7.5.4 - it's not the same version, at the moment I can't uninstall this version to test the newest one locally). I uninstalled the adblock plugin, cleared cache, restarted Windows.

image

image

image

There is even a release to display content from http://192.168.0.250:8080/ (SLTS server address). I also uninstalled and reinstalled Firefox and it works the same as Chrome, it doesn't load the image.

I don't know how to test "request and response", if you can give me more instructions I will test it.

On this Scada-LTS server (http://192.168.0.250:8080/Scada-LTS) I migrated an application made in ScadaBR 1.2 (address http://192.168.0.156:8080/ScadaBR), this application still it is on the air and has the same VPN restrictions and from what I know it has the same firewall limitations (I don't have access to the restrictions, the IT department only gave me access to the server. I thought about testing the two applications side-by-side ScadaBR and Scada-LTS and ScadaBR is loading the graphics.

image

If there are more tests I can do to contribute, I'm at your disposal.

Limraj commented 9 months ago

Hi @fabiodurao, the only chance to solve the problem is to check all these things and not rely on guesses. So far, there is no indication that the problem is caused by the application (I am not able to repeat it), probably problem is the configuration of the environment, i.e. the server or the client.

  1. Download version 2.7.6.1 and run it locally on some Linux and check if it works, if it works, it means that the reason is the environment configuration, if it doesn't work, then we try to recreate the local environment.
  2. If in "Insepct->Network" you click on the address from Scada-LTS that generates the chart (the url from the chart), you will see the request and response tab there, you can see it.
  3. You also immediately check the logs that I showed you, those from localhost_access_log, whether a given request has been handled.
  4. The next thing is to check whether you can see these charts on version 2.7.6.1 directly from the server, i.e. on localhost.
  5. Try to install 2.7.6.1 on another server where the charts work.
  6. Adjust these chrome settings to the state as shown in my screenshot. (all empty)
  7. Uninstall Brave, maybe there is something wrong with the configuration of other browsers, or config system.
  8. Do you have any additional antivirus or system protection programs? (there is a difference between localhost and a specific address)
  9. Check whether the tomcat process on server that runs the application owns all files from CATALINA_HOME. To set this parameter chown -R tomcat_user:user_group dir
  10. Try to compare on the same points, etc.
  11. What is hidden under this icon? 292017590-25eb2a29-7c5b-4e46-96ba-3bb1fe8c61a6

Avoid guessing, test only specific versions, or only on a problematic server, this may only lead to the cause of the problem, the tests you did do not provide specific information(There is no point in testing different versions, on different servers, with different data, what do you think this can tell us?), we cannot rely on them.

edit: point 1 -> Download version 2.7.6.1 and run it locally on some Linux and check if it works, if it works, it means that the reason is the environment configuration, if it doesn't work, then we try to recreate the local environment.

Limraj commented 8 months ago

Hi @fabiodurao, @weschenfelder How's the situation? Did you check by running tomcat directly from the bin, without using service?

Regards, Kamil Jarmusik

weschenfelder commented 8 months ago

good afternoon sirs!

Happy New Year

@Limraj , after testing I identified that the problem occurs when Ubuntu Server is used without the GNOME package, that is, without the Ubuntu graphical interface only through ssh. If you are interested, I can provide access to the environment with the "problem" so you can debug.

Just provide me with an email and/or Telegram so I can send you the credentials.

Limraj commented 8 months ago

Hi @weschenfelder,

Thank you and to you too.

Instead of guessing, just try to do what I wrote. This is something in common between you and Fabio.

Regards, Kamil Jarmusik

weschenfelder commented 8 months ago

O @Limraj

I'm not good at guessing, so I tested in both environments. In other words, they are not assumptions, they are statements. In the GNOME version it works. The problem is in the server version without gnome, which is the most common on servers with few resources.

Regards, F. Weschenfelder

Limraj commented 8 months ago

Hi @weschenfelder, We have this configuration on our servers and there are no such problems, it's just a guess. Are you able to do this, run tomcat directly from bin, without systemd? The problem is probably related to permissions. These charts work in such a way that a graphic file with a chart is generated and saved on disk server, and then the browser downloads this graphic file from server disk.

Regards, Kamil Jarmusik