OpenMage / magento-lts

Official OpenMage LTS codebase | Migrate easily from Magento Community Edition in minutes! Download the source code for free or contribute to OpenMage LTS | Security vulnerability patches, bug fixes, performance improvements and more.
https://www.openmage.org
Open Software License 3.0
868 stars 436 forks source link

The graphs in the Dashboard page no longer display data #4058

Closed ADDISON74 closed 3 months ago

ADDISON74 commented 3 months ago

Latest OM version 20 cloned today from the repository. DDEV + PHP 8.3 + Apache + Maria DB + Magento Sample Data.

Steps to reproduce this issue:

  1. Place an order in the Frontend
  2. Go to the Backend and edit this order and ship it
  3. Go to the Dashboard page and look to the charts in both tabs Orders and Amounts. For the current day it displays the word "chart" for other time range nothing is displayed.

screenshot

I went further completing the order issuing the Invoice. Nothing changed in the charts. At this moment in production an older version is displaying correctly the graph even I am only shipping the orders, not completing them (it is cash on delivery only). Both tabs display the graphs

screenshot_2

I guess we should check the history for this file /app/code/core/Mage/Adminhtml/Block/Dashboard/Graph.php.

maximus-sallam commented 3 months ago

Did you already perform typical troubleshooting like flushing the application cache and page cache , the Cloudflare cache (this takes 15 minutes), and the browser cache, cookies, site data, and history? Have you used a tool like curl to retrieve headers of the file that appears to fail to display the most recent change? Have you tested with Nessus, burpsuite, or Ghidra?

This looks like a caching issue, not a Cloudflare issue. It's either the application isn't telling the browser that there's been a change, so the index is outdated, or your team didn't reindex the catalog or deploy the static content after making changes.

ADDISON74 commented 3 months ago

@maximus-sallam - I am an advanced OM user. In my case I use a DDEV test environment for which I created a tutorial in the Discussions section.

I have enabled log files, debugging, the cache is disabled. My opinion that it is possible that there is a dropped or rejected connection to the source for the graphic.

The file responsible for generating the chart is /app/code/core/Mage/Adminthml/Block/Dashboard/Graph.php. API_URL is https://image-charts.com/chart

I will check again these day.

maximus-sallam commented 3 months ago

Are there any errors present in the PHP and Apache Error logs, or Magento system.log, exception.log, and debug.log?

ADDISON74 commented 3 months ago

If there were errors I would have mentioned them, but there are not. I will check the connection with that URL.

ADDISON74 commented 3 months ago

@maximus-sallam - With all due respect, but we are in the OpenMage repository which continues Magento 1 platform. I deleted some of your messages because they are off-topic.

maximus-sallam commented 3 months ago

@maximus-sallam - With all due respect, but we are in the OpenMage repository which continues Magento 1. I deleted some of your messages because they are off-topic.

Ah, my apologies. I did confuse Magento 2 and 1 in my last comment, but I don't think that warranted deleting all of my comments, many of which were valid in reference to Magneto 1.x or your issue.

My opinion that it is possible that there is a dropped or rejected connection to the source for the graphic.

If that's the case, you can replay the GET request to the API using curl to display response codes. If that returns a 200 OK when sent from the server, than it's unlikely the API connection.

You may also want to ensure that the cron is installed correctly, running as expected, and paths are accurate, because that could result in issues as well.

ADDISON74 commented 3 months ago

Cron was installed correctly on my DDEV environment. I will follow the curl tip. Thank you.

maximus-sallam commented 3 months ago

You're welcome. You can use Burpsuite to record and replay the GET request, or you can review the curl PHP function that you found the API domain name in, in the Graph.php file, and use php -r from the command line to execute the code responsible for generating the GET request, and print it to the screen. Alternatively, you can simply change the API domain name to a domain you own and control, test, and review the Apache transfer.log file for the domain you changed it to, to see the GET request.

fballiano commented 3 months ago

on the main branch I can't reproduce the problem:

Screenshot 2024-07-01 alle 12 17 19
ADDISON74 commented 3 months ago

It is related to the connection to the API_URL which was down yesterday, maybe because it was Sunday? Who knows, today it shows the transaction in both tabs. I will close the issue.