• Welcome to the Chevereto user community!

    Here users from all over the world gather around to learn the latest about Chevereto and contribute with ideas to improve the software.

    Please keep in mind:

    • 😌 This community is user driven. Be polite with other users.
    • 👉 Is required to purchase a Chevereto license to participate in this community (doesn't apply to Pre-sales).
    • 💸 Purchase a Pro Subscription to get access to active software support and faster ticket response times.
  • Chevereto Support CLST

    Support response

    Support checklist

Stats becoming 0

Status
Not open for further replies.

siddharth

💖 Chevereto Fan
🎯Description of the issue

1) In the admin panel, it is showing 0 whereas we have more than 100k images. And also I have applied the fix which has given before, but still, the site is getting 0 stats often.

FYI, our storage server which is FTP are getting down daily due to CP and we are mitigating it somehow. Whether this may be the problem for 0 stats? if so, the issue needs to be fixed permanently

1573979218308.png


2) Site is loading slow

We are using i9 processor and 64gigs of ram and 1gbps of bandwidth for main server, still when loading the images page and other settings pages, we are getting 504 error. And when checking the error log we saw this error

2019/11/17 13:57:58 [error] 3359#0: *302850 FastCGI sent in stderr: "PHP message: CHV\ImageException: SQLSTATE[22001]: String data, right truncated: 1406 Data too long for column 'deleted_content_original_filename' at row 1 (LINE:473) in /home/public_html/app/lib/classes/class.image.php:1429
Stack trace:
#0 /home/public_html/app/loader.php(409): CHV\Image::deleteExpired(50)
#1 [internal function]: CHV\{closure}()
#2 {main}
PHP message: CHV\UserException: SQLSTATE[22001]: String data, right truncated: 1406 Data too long for column 'deleted_content_original_filename' at row 1 (LINE:473) in /home/public_html/app/lib/classes/class.user.php:448
Stack trace:
#0 /home/public_html/app/lib/classes/class.user.php(619): CHV\User::delete(Array)
#1 /home/public_html/app/loader.php(422): CHV\User::cleanUnconfirmed(5)
#2 [internal function]: CHV\{closure}()
 
Because you're just addressing the request ..
Maybe it's because the footer of your page loads a certain image?
[CODE lang="html" title="on row 698"]<img data-content="queue-pixel" src="https://youre.domain/?queue&r=6f2f5d82a6d0a5ad1b33b276047fd4ad" width="1" height="1" alt="" style="display: none;">[/CODE]
 
Please, try to always keep the rule of one issue per ticket.

1) In the admin panel, it is showing 0 whereas we have more than 100k images. And also I have applied the fix which has given before, but still, the site is getting 0 stats often.

The only way stats get zeroed is if someone altered the stats table. The system doesn't reset these by any means.

If you want to re-build the stats you will have to run this:

[CODE lang="sql" title="Rebuild stats"]
TRUNCATE TABLE `chv_stats`;

INSERT INTO `chv_stats` (stat_id, stat_date_gmt, stat_type) VALUES ("1", NULL, "total") ON DUPLICATE KEY UPDATE stat_type=stat_type;

UPDATE `chv_stats` SET
stat_images = (SELECT IFNULL(COUNT(*),0) FROM `chv_images`),
stat_albums = (SELECT IFNULL(COUNT(*),0) FROM `chv_albums`),
stat_users = (SELECT IFNULL(COUNT(*),0) FROM `chv_users`),
stat_image_views = (SELECT IFNULL(SUM(image_views),0) FROM `chv_images`),
stat_disk_used = (SELECT IFNULL(SUM(image_size) + SUM(image_thumb_size) + SUM(image_medium_size),0) FROM `chv_images`)
WHERE stat_type = "total";

INSERT INTO `chv_stats` (stat_type, stat_date_gmt, stat_images, stat_image_views, stat_disk_used)
SELECT sb.stat_type, sb.stat_date_gmt, sb.stat_images, sb.stat_image_views, sb.stat_disk_used
FROM (SELECT "date" AS stat_type, DATE(image_date_gmt) AS stat_date_gmt, COUNT(*) AS stat_images, SUM(image_views) AS stat_image_views, SUM(image_size + image_thumb_size + image_medium_size) AS stat_disk_used FROM `chv_images` GROUP BY DATE(image_date_gmt)) AS sb
ON DUPLICATE KEY UPDATE stat_images = sb.stat_images;

INSERT INTO `chv_stats` (stat_type, stat_date_gmt, stat_users)
SELECT sb.stat_type, sb.stat_date_gmt, sb.stat_users
FROM (SELECT "date" AS stat_type, DATE(user_date_gmt) AS stat_date_gmt, COUNT(*) AS stat_users FROM `chv_users` GROUP BY DATE(user_date_gmt)) AS sb
ON DUPLICATE KEY UPDATE stat_users = sb.stat_users;

INSERT INTO `chv_stats` (stat_type, stat_date_gmt, stat_albums)
SELECT sb.stat_type, sb.stat_date_gmt, sb.stat_albums
FROM (SELECT "date" AS stat_type, DATE(album_date_gmt) AS stat_date_gmt, COUNT(*) AS stat_albums FROM `chv_albums` GROUP BY DATE(album_date_gmt)) AS sb
ON DUPLICATE KEY UPDATE stat_albums = sb.stat_albums;

UPDATE `chv_users` SET user_content_views = COALESCE((SELECT SUM(image_views) FROM `chv_images` WHERE image_user_id = user_id GROUP BY user_id), "0");
[/CODE]

All these must be executed to rebuild the stats.

2) Site is loading slow

You should run a query repair command. In any case, try to open a new ticket for that issue and leave this topic for the stats problem.
 
Because you're just addressing the request ..
Maybe it's because the footer of your page loads a certain image?
[CODE lang="html" title="on row 698"]<img data-content="queue-pixel" src="https://youre.domain/?queue&r=6f2f5d82a6d0a5ad1b33b276047fd4ad" width="1" height="1" alt="" style="display: none;">[/CODE]

But admin says, it is making the site to go down. I am making a new post for the site slowing down issue.
 
@Rodolfo When the storage servers are live (FTP) then this issue got solved. So I believe, this needs to be fixed on the script level as when storage servers are down, it causing the entire site to go down.
 
@Rodolfo When the storage servers are live (FTP) then this issue got solved. So I believe, this needs to be fixed on the script level as when storage servers are down, it causing the entire site to go down.
Thanks for the update, the system already does that. Problem is that external servers, specially FTP, aren't reliable at all.

Try using SFTP.
 
Unfortunately, this ticket has more than seven days without a reply or feedback from the original poster. We will now consider this ticket abandoned and its now closed.

Don't hesitate to create a new ticket if this matter is still causing you issues.

Ticket closed.
 
Status
Not open for further replies.
Back
Top