• 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:

  • Chevereto Support CLST

    Support response

    Support checklist

    • Got a Something went wrong message? Read this guide and provide the actual error. Do not skip this.
    • Confirm that the server meets the System Requirements
    • Check for any available Hotfix - your issue could be already reported/fixed
    • Read documentation - It will be required to Debug and understand Errors for a faster support response

4.2.3 Update major db failure(s).

user_dfc1a

Chevereto Member
Please open one ticket per issue. If you are experiencing multiple issues don't hesitate to create multiple tickets for each issue.

Installation environment:
CWP 7
CWPpro version: 0.9.8.1189
  • CPU Model: QEMU Virtual CPU version 2.5+
  • CPU Details: 56 Core (2400 MHz)
  • Distro Name: AlmaLinux release 8.10 (Cerulean Leopard)
  • Kernel Version: 4.18.0-553.27.1.el8_10.x86_64
  • Platform: x86_64

Reproduction steps
  1. All update procedures fail to 4.2.3. Complaint by Chevereto's db.
  2. Code:
    Using username "root".
    Authenticating with public key "helium11.mydomain.com" from agent
    Last login: Wed Nov 27 20:59:44 2024 from 10.188.20.200
    
    ********************************************
     Welcome to CWP (CentOS WebPanel) server
    ********************************************
    
    CWP Wiki: http://wiki.centos-webpanel.com
    CWP Forum: http://forum.centos-webpanel.com
    CWP Support: http://centos-webpanel.com/support-services
    
     23:36:31 up 1 day, 12:13,  1 user,  load average: 1.29, 1.93, 3.27
    USER     TTY      FROM             LOGIN@   IDLE   JCPU   PCPU WHAT
    root     pts/0    10.188.20.241    23:36    1.00s  0.08s  0.04s w
    
    [root@helium11 ~]# cd /home/cheveret/public_html/pics
    [root@helium11 pics]# bash <(curl -s https://raw.githubusercontent.com/chevereto/vps/4.0/common/get.sh)
          __                        __
     ____/ /  ___ _  _____ _______ / /____
    / __/ _ \/ -_) |/ / -_) __/ -_) __/ _ \
    \__/_//_/\__/|___/\__/_/  \__/\__/\___/
    
    Chevereto V4 License key (if any): 🔑
      % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                     Dload  Upload   Total   Spent    Left  Speed
    100 70.3M    0 70.3M    0     0  43.5M      0 --:--:--  0:00:01 --:--:-- 43.6M
    curl: Saved to filename 'chevereto_4.2.3_4d5c2e199bd4.zip'
    /home/cheveret/public_html/pics
    [NOTICE] www-data user not found, skipping ownership change
    [OK] Chevereto V4 files provisioned!
    [root@helium11 pics]# chown -R cheveret:cheveret /home/cheveret/public_html/pics
    [root@helium11 pics]# app/bin/legacy -C update
    PHP Warning:  Version warning: Imagick was compiled against ImageMagick version 1692 but version 1693 is loaded. Imagick will run but may behave surprisingly in Unknown on line 0
    [STATUS] Updating Chevereto database (this may take a while)...
    [SQL]
    UPDATE `chv_settings` SET `setting_value` = 1 WHERE `setting_name` = 'maintenance';
    ALTER TABLE `chv_logins` MODIFY `login_secret` text DEFAULT NULL COMMENT 'The secret part';
    ALTER TABLE `chv_settings` MODIFY `setting_value` text ;
    ALTER TABLE `chv_settings` MODIFY `setting_default` text ;
    ALTER TABLE `chv_storages` MODIFY `storage_key` text ;
    ALTER TABLE `chv_storages` MODIFY `storage_secret` text ;
    ALTER TABLE `chv_pages` MODIFY `page_code` text ;
    ALTER TABLE `chv_users` ADD `user_file_meta_tag_camera_model` tinyint(1) NOT NULL DEFAULT '0';
    ALTER TABLE `chv_categories` MODIFY `category_url_key` varchar(32) COLLATE utf8mb4_bin NOT NULL;
    ALTER TABLE `chv_storages` ADD `storage_use_path_style_endpoint` tinyint(1) UNSIGNED NOT NULL DEFAULT "0";
    ALTER TABLE `chv_storages` ADD `storage_deleted_at` DATETIME NULL DEFAULT NULL;
    ALTER TABLE `chv_images` MODIFY `image_type` tinyint(3) UNSIGNED as (case
     when `image_extension` in ('pdf','doc','md') then 4
     when `image_extension` in ('mp3','m4a','wav') then 3
     when `image_extension` in ('mp4','webm','mov') then 2
     when `image_extension` in ('avif','jpg','jpeg','gif','png','webp') then 1
     else 0 end) stored;
    ALTER TABLE `chv_stats` ADD `stat_tags` bigint(32) UNSIGNED NOT NULL DEFAULT '0';
    ALTER TABLE `chv_stats` ADD `stat_cron_runs` bigint(32) UNSIGNED NOT NULL DEFAULT '0';
    ALTER TABLE `chv_stats` ADD `stat_cron_time` bigint(32) UNSIGNED NOT NULL DEFAULT '0';
    DROP TABLE IF EXISTS `chv_tags`;
    CREATE TABLE `chv_tags` (
     `tag_id` bigint(32) NOT NULL AUTO_INCREMENT,
     `tag_name` varchar(32) COLLATE utf8mb4_bin NOT NULL,
     `tag_description` text,
     `tag_user_id` bigint(32) NOT NULL,
     `tag_date_gmt` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP,
     `tag_files` bigint(32) NOT NULL DEFAULT 0,
     `tag_views` bigint(32) NOT NULL DEFAULT 0,
     PRIMARY KEY (`tag_id`),
     UNIQUE KEY `tag_name` (`tag_name`) USING BTREE,
     KEY `tag_user_id` (`tag_user_id`),
     KEY `tag_date_gmt` (`tag_date_gmt`),
     KEY `tag_files` (`tag_files`),
     KEY `tag_views` (`tag_views`),
     KEY `tag_user_id_date_gmt` (`tag_user_id`,`tag_date_gmt`),
     KEY `tag_user_id_files` (`tag_user_id`,`tag_files`),
     KEY `tag_user_id_views` (`tag_user_id`,`tag_views`)
    ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;
    
    DROP TABLE IF EXISTS `chv_tags_files`;
    CREATE TABLE `chv_tags_files` (
     `tag_file_tag_id` bigint(32) NOT NULL,
     `tag_file_file_id` bigint(32) NOT NULL,
     FOREIGN KEY (tag_file_tag_id) REFERENCES `chv_tags` (tag_id) ON DELETE CASCADE,
     FOREIGN KEY (tag_file_file_id) REFERENCES `chv_images` (image_id) ON DELETE CASCADE,
     UNIQUE INDEX `tag_file_UNIQUE` (`tag_file_tag_id` ASC, `tag_file_file_id` ASC) VISIBLE
    ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;
    
    DROP TABLE IF EXISTS `chv_tags_users`;
    CREATE TABLE `chv_tags_users` (
     `tag_user_tag_id` bigint(32) NOT NULL,
     `tag_user_user_id` bigint(32) NOT NULL,
     `tag_user_count` int(11) NOT NULL DEFAULT 0,
     `tag_user_last_used_datetime` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP,
     FOREIGN KEY (tag_user_tag_id) REFERENCES `chv_tags` (tag_id) ON DELETE CASCADE,
     FOREIGN KEY (tag_user_user_id) REFERENCES `chv_users` (user_id) ON DELETE CASCADE,
     UNIQUE INDEX `tag_user_UNIQUE` (`tag_user_tag_id` ASC, `tag_user_user_id` ASC) VISIBLE,
     KEY `tag_user_count` (`tag_user_count`),
     KEY `tag_user_last_used_datetime` (`tag_user_last_used_datetime`)
    ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;
    
    DROP TABLE IF EXISTS `chv_tags_albums`;
    CREATE TABLE `chv_tags_albums` (
     `tag_album_tag_id` bigint(32) NOT NULL,
     `tag_album_album_id` bigint(32) NOT NULL,
     `tag_album_user_id` bigint(32) NOT NULL,
     `tag_album_count` int(11) NOT NULL DEFAULT 0,
     `tag_album_last_used_datetime` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP,
     FOREIGN KEY (tag_album_tag_id) REFERENCES `chv_tags` (tag_id) ON DELETE CASCADE,
     FOREIGN KEY (tag_album_album_id) REFERENCES `chv_albums` (album_id) ON DELETE CASCADE,
     FOREIGN KEY (tag_album_user_id) REFERENCES `chv_users` (user_id) ON DELETE CASCADE,
     UNIQUE INDEX `tag_album_UNIQUE` (`tag_album_tag_id` ASC, `tag_album_album_id` ASC, `tag_album_user_id` ASC) VISIBLE,
     KEY `tag_album_count` (`tag_album_count`),
     KEY `tag_album_last_used_datetime` (`tag_album_last_used_datetime`)
    ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;
    
    DROP TABLE IF EXISTS `chv_variables`;
    CREATE TABLE `chv_variables` (
     `variable_id` int(11) NOT NULL AUTO_INCREMENT,
     `variable_name` varchar(255) CHARACTER SET utf8 COLLATE utf8_bin NOT NULL,
     `variable_datetime_utc` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
     `variable_value` text,
     `variable_type` enum('string','bool','int','float','array','object') DEFAULT 'string',
     PRIMARY KEY (`variable_id`),
     UNIQUE KEY `variable_name` (`variable_name`) USING BTREE
    ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;
    
    INSERT IGNORE INTO `chv_variables` (variable_name, variable_value, variable_type)
    VALUES('crypt_salt', (SELECT `setting_value` FROM `chv_settings` WHERE `setting_name` = 'crypt_salt'), 'string');
    INSERT IGNORE INTO `chv_variables` (variable_name, variable_value, variable_type)
    VALUES('chevereto_version_installed', (SELECT `setting_value` FROM `chv_settings` WHERE `setting_name` = 'chevereto_version_installed'), 'string');
    INSERT IGNORE INTO `chv_variables` (variable_name, variable_value, variable_type)
    VALUES('last_used_storage', (SELECT `setting_value` FROM `chv_settings` WHERE `setting_name` = 'last_used_storage'), 'int');
    INSERT IGNORE INTO `chv_variables` (variable_name, variable_value, variable_type)
    VALUES('id_padding', (SELECT `setting_value` FROM `chv_settings` WHERE `setting_name` = 'id_padding'), 'int');
    INSERT IGNORE INTO `chv_variables` (variable_name, variable_value, variable_type)
    VALUES('update_check_datetimegmt', (SELECT `setting_value` FROM `chv_settings` WHERE `setting_name` = 'update_check_datetimegmt'), 'string');
    INSERT IGNORE INTO `chv_variables` (variable_name, variable_value, variable_type)
    VALUES('update_check_notified_release', (SELECT `setting_value` FROM `chv_settings` WHERE `setting_name` = 'update_check_notified_release'), 'string');
    INSERT IGNORE INTO `chv_variables` (variable_name, variable_value, variable_type)
    VALUES('chevereto_news', (SELECT `setting_value` FROM `chv_settings` WHERE `setting_name` = 'chevereto_news'), 'array');
    INSERT IGNORE INTO `chv_variables` (variable_name, variable_value, variable_type)
    VALUES('cron_last_ran', (SELECT `setting_value` FROM `chv_settings` WHERE `setting_name` = 'cron_last_ran'), 'string');
    INSERT IGNORE INTO `chv_variables` (variable_name, variable_value, variable_type)
    VALUES('news_check_datetimegmt', (SELECT `setting_value` FROM `chv_settings` WHERE `setting_name` = 'news_check_datetimegmt'), 'string');
    ALTER TABLE `chv_images` MODIFY `image_original_exifdata` mediumtext ;
    ALTER TABLE `chv_importing` MODIFY `importing_content_id` bigint(32) DEFAULT NULL;
    ALTER TABLE `chv_storages` ADD KEY `storage_deleted_at` (`storage_deleted_at`);
    ALTER TABLE `chv_confirmations` ADD KEY `confirmation_user` (`confirmation_user_id`);
    ALTER TABLE `chv_confirmations` ADD KEY `confirmation_user_type` (`confirmation_user_id`, `confirmation_type`);
    ALTER TABLE `chv_confirmations` ADD KEY `confirmation_user_type_status_date` (`confirmation_user_id`, `confirmation_type`, `confirmation_status`, `confirmation_date_gmt`);
    ALTER TABLE `chv_users` ADD KEY `user_file_meta_tag_camera_model` (`user_file_meta_tag_camera_model`);
    INSERT IGNORE INTO `chv_settings` (setting_name, setting_value, setting_default, setting_typeset)
    VALUES ('asset_storage_api_id', '8', '8', 'string');
    INSERT IGNORE INTO `chv_settings` (setting_name, setting_value, setting_default, setting_typeset)
    VALUES ('asset_storage_url', '/', '/', 'string');
    INSERT IGNORE INTO `chv_settings` (setting_name, setting_value, setting_default, setting_typeset)
    VALUES ('asset_storage_account_id', '', '', 'string');
    INSERT IGNORE INTO `chv_settings` (setting_name, setting_value, setting_default, setting_typeset)
    VALUES ('asset_storage_account_name', '', '', 'string');
    INSERT IGNORE INTO `chv_settings` (setting_name, setting_value, setting_default, setting_typeset)
    VALUES ('asset_storage_bucket', '/home/cheveret/public_html/pics/', '/home/cheveret/public_html/pics/', 'string');
    INSERT IGNORE INTO `chv_settings` (setting_name, setting_value, setting_default, setting_typeset)
    VALUES ('asset_storage_key', '', '', 'string');
    INSERT IGNORE INTO `chv_settings` (setting_name, setting_value, setting_default, setting_typeset)
    VALUES ('asset_storage_region', '', '', 'string');
    INSERT IGNORE INTO `chv_settings` (setting_name, setting_value, setting_default, setting_typeset)
    VALUES ('asset_storage_secret', '', '', 'string');
    INSERT IGNORE INTO `chv_settings` (setting_name, setting_value, setting_default, setting_typeset)
    VALUES ('asset_storage_server', '', '', 'string');
    INSERT IGNORE INTO `chv_settings` (setting_name, setting_value, setting_default, setting_typeset)
    VALUES ('asset_storage_service', '', '', 'string');
    INSERT IGNORE INTO `chv_settings` (setting_name, setting_value, setting_default, setting_typeset)
    VALUES ('asset_storage_use_path_style_endpoint', '0', '0', 'bool');
    INSERT IGNORE INTO `chv_settings` (setting_name, setting_value, setting_default, setting_typeset)
    VALUES ('guest_albums', '0', '0', 'bool');
    INSERT IGNORE INTO `chv_settings` (setting_name, setting_value, setting_default, setting_typeset)
    VALUES ('route_video', 'video', 'video', 'string');
    INSERT IGNORE INTO `chv_settings` (setting_name, setting_value, setting_default, setting_typeset)
    VALUES ('route_audio', 'audio', 'audio', 'string');
    INSERT IGNORE INTO `chv_settings` (setting_name, setting_value, setting_default, setting_typeset)
    VALUES ('cache_ttl', '0', '0', 'string');
    INSERT IGNORE INTO `chv_settings` (setting_name, setting_value, setting_default, setting_typeset)
    VALUES ('arachnid_api_username', '', '', 'string');
    INSERT IGNORE INTO `chv_settings` (setting_name, setting_value, setting_default, setting_typeset)
    VALUES ('arachnid_api_password', '', '', 'string');
    INSERT IGNORE INTO `chv_variables` (variable_name, variable_value, variable_type)
    VALUES ('id_padding', '0', 'int');
    INSERT IGNORE INTO `chv_variables` (variable_name, variable_value, variable_type)
    VALUES ('crypt_salt', '', 'string');
    INSERT IGNORE INTO `chv_variables` (variable_name, variable_value, variable_type)
    VALUES ('chevereto_version_installed', '4.2.3', 'string');
    INSERT IGNORE INTO `chv_variables` (variable_name, variable_value, variable_type)
    VALUES ('last_used_storage', '0', 'int');
    INSERT IGNORE INTO `chv_variables` (variable_name, variable_value, variable_type)
    VALUES ('update_check_datetimegmt', '0000-00-00 00:00:00', 'string');
    INSERT IGNORE INTO `chv_variables` (variable_name, variable_value, variable_type)
    VALUES ('update_check_notified_release', '4.2.3', 'string');
    INSERT IGNORE INTO `chv_variables` (variable_name, variable_value, variable_type)
    VALUES ('chevereto_news', 'a:0:{}', 'array');
    INSERT IGNORE INTO `chv_variables` (variable_name, variable_value, variable_type)
    VALUES ('cron_last_ran', '0000-00-00 00:00:00', 'string');
    INSERT IGNORE INTO `chv_variables` (variable_name, variable_value, variable_type)
    VALUES ('news_check_datetimegmt', '0000-00-00 00:00:00', 'string');
    INSERT IGNORE INTO `chv_variables` (variable_name, variable_value, variable_type)
    VALUES ('storages_all', '0', 'int');
    INSERT IGNORE INTO `chv_variables` (variable_name, variable_value, variable_type)
    VALUES ('storages_active', '0', 'int');
    INSERT IGNORE INTO `chv_variables` (variable_name, variable_value, variable_type)
    VALUES ('login_providers_active', '0', 'int');
    
    INSERT INTO `chv_variables` (variable_name, variable_value, variable_type)
    VALUES ("chevereto_version_installed", "4.2.3", "string")
    ON DUPLICATE KEY UPDATE variable_value = "4.2.3", variable_type = "string";
    UPDATE `chv_settings` SET `setting_value` = 0 WHERE `setting_name` = "maintenance";
    [OK] Chevereto database has been updated
  3. All update methods have been used, all fail with the db bug.

firefox_plxiVhniiN.png

firefox_IZAe4wDY6H.png

firefox_9OLzhu0n0i.png



Unexpected result

Unexpected result is no one has had this issue in the last two weeks as I have watched the forums. Obviously, the unexpected result is it can't be updated. (Well sort of - I suspect it is updating as it says so from the CLI while manually updating the db (as well as the screencap above.) Updating through the GUI has the same behavior, or a something went wrong dialogue now and again (random...)

Error log message

None, Chevereto seems to think everything is okay until it forces the site back into maintenance mode (after manually turning it off.) Because it thinks the db is not updated... Makes site totally off line.

This sure looks like support ticket material, but I'll leave that up to you - or your request for me to do so - please include what I can include that is not here that might help you diagnoses this issue. I would imagine you will want me to run this in debug mode and post some sort of logs, but I can't find any and am too swamped with other stuff right now to read an hour's worth of material to find out. Thanks in advance.

Douglas
 
Thank you for reaching out, Douglas (@user_dfc1a)

The message [OK] Chevereto database has been updated appears after all the update queries have been executed. Please check the chv_variables table for the chevereto_version_installed value, as this is where the system stores the application database version.

If the value is in the database the problem could be filesystem cache related. If the value is not in the database it signals a problem in the update query that needs to be investigated.

Let me know how it goes.
 
Hmm, I don't have a chv_variables table on the current version without updating. I wonder how this is even working now???

Thank you for reaching out, Douglas (@user_dfc1a)

The message [OK] Chevereto database has been updated appears after all the update queries have been executed. Please check the chv_variables table for the chevereto_version_installed value, as this is where the system stores the application database version.

If the value is in the database the problem could be filesystem cache related. If the value is not in the database it signals a problem in the update query that needs to be investigated.

Let me know how it goes.

What operation should I run to add the table? I am guessing if I add it to the "old" version maybe the update will pick that right up... I can query/etc through phpMyAdmin.
 
What operation should I run to add the table?
Chevereto added chv_variables in 4.2.

Chevereto already attempts to create that table automatically. If it failed to do so, I would like to investigate why. Fortunately, this issue doesn't seem to be affecting other users, so it might be related to your specific database setup.

Please provide more details about your database configuration so we can look into this further. Thank you for your understanding and cooperation.
 
Don't know that this helps any. Can you give me some guidance as to what you want? There would seem to be no queries I can run on something that's not there. I am at your disposal if you know what you need to see...

  • MySQL version: 10.4.34-MariaDB

vivaldi_sGc4p3Dh3h.png

This is version 4.1.4.

Setting debugging nets nothing. And xRDebug has a permission issue with it. Maybe related? - Most of your users are in www-data land...
 
Last edited:
I'm not sure what access you need granted - just for Chevereto to login? That post is not clear to me. I can email you whatever, but you won't be able to get on the server without a key. Chevereto access on the other hand is easy. Is that what you are asking for?
 
To inspect the system I need SSH root access to the machine.
 
Thank you for your patience. I've identified an odd query affecting MariaDB 10.4, and this has been fixed on your website. The patch will be available in Chevereto v4.2.4 for all users.
 
Back
Top