• 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.0.0-beta.10 to 4.0.0-beta.11 database update error.

elliotks

Chevereto Member
Hi,

After updating files from 4.0.0-beta.10 to 4.0.0-beta.11 and trying to run database update, receive an error.

▶ Reproduction steps
  1. Update files from 4.0.0-beta.10 to 4.0.0-beta.11
  2. 4.0.0-beta.10 DB [install update] or via CLI $ app/bin/legacy -C database-update
😢 Unexpected result

Database update error.

📃 Error log message

Code:
Chevere\Throwable\Exceptions\LogicException thrown in /home/X/public_html/app/legacy/install/installer.php:1905

# Incident ID:630cfd0deb54b

# Time
2022-08-29T17:53:17+00:00 [1661795597]

# Stack trace
------------------------------------------------------------
#0 /home/X/public_html/app/legacy/install/installer.php:1905
{main}()
------------------------------------------------------------
#1 /home/X/public_html/app/legacy/commands/database-update.php:18
require_once()
------------------------------------------------------------
#2 /home/X/public_html/app/legacy/entrypoints/cli.php:53
require_once(string(length=66))
------------------------------------------------------------
#3 /home/X/public_html/app/bin/legacy:4
require_once(string(length=57))
------------------------------------------------------------

# Server
Linux X 5.4.0-113-generic #127-Ubuntu SMP Wed May 18 14:30:56 UTC 2022 x86_64

SQL:
ALTER TABLE pix_requests MODIFY request_type enum('upload','signup','account-edit','account-password-forgot','account-password-reset','account-resend-activation','account-email-needed','account-change-email','account-activate','login','content-password', 'account-two-factor') NOT NULL;
INSERT INTO pix_login_passwords (login_password_user_id, login_password_date_gmt, login_password_hash)
SELECT login_user_id, max(login_date_gmt), login_secret
FROM pix_logins
WHERE login_type = "password"
GROUP BY login_user_id;
INSERT INTO pix_login_cookies (login_cookie_user_id, login_cookie_connection_id, login_cookie_date_gmt,
login_cookie_ip, login_cookie_user_agent, login_cookie_hash)
SELECT login_user_id, 0, login_date_gmt, login_ip, login_hostname, login_secret
FROM pix_logins
WHERE login_type = "cookie"
GROUP BY login_date_gmt
ORDER BY login_date_gmt DESC;
INSERT INTO pix_login_connections (login_connection_user_id, login_connection_provider_id, login_connection_date_gmt,
login_connection_resource_id, login_connection_resource_name,
login_connection_token)
SELECT login_user_id, login_provider_id, max(login_date_gmt), login_resource_id, login_resource_name, '' token
FROM pix_logins
JOIN pix_login_providers ON login_provider_name = login_type
WHERE login_type IN ('facebook', 'twitter', 'google', 'vk')
GROUP BY login_user_id, login_provider_id;
UPDATE pix_login_providers
SET login_provider_key_id = 'X', login_provider_key_secret = 'X', login_provider_is_enabled = '0'
WHERE login_provider_name = 'facebook';
UPDATE pix_login_providers
SET login_provider_key_id = 'X', login_provider_key_secret = 'X', login_provider_is_enabled = '0'
WHERE login_provider_name = 'twitter';
UPDATE pix_login_providers
SET login_provider_key_id = 'X.apps.googleusercontent.com', login_provider_key_secret = 'X', login_provider_is_enabled = '0'
WHERE login_provider_name = 'google';
UPDATE pix_login_providers
SET login_provider_key_id = '', login_provider_key_secret = '', login_provider_is_enabled = '0'
WHERE login_provider_name = 'Vkontakte';
INSERT INTO pix_settings (setting_name, setting_value, setting_default, setting_typeset) VALUES ('website_random_guest', '1', '1', 'bool');
INSERT INTO pix_settings (setting_name, setting_value, setting_default, setting_typeset) VALUES ('website_search_guest', '1', '1', 'bool');
INSERT INTO pix_settings (setting_name, setting_value, setting_default, setting_typeset) VALUES ('debug_errors', '0', '0', 'bool');
INSERT INTO pix_settings (setting_name, setting_value, setting_default, setting_typeset) VALUES ('news_check_datetimegmt', '', '', 'string');
UPDATE pix_settings SET setting_value = "4.0.0-beta.11" WHERE setting_name = "chevereto_version_installed";
 
Last edited by a moderator:
I just ran those on a stock database without issues. Either you have a different schema or the queries ran twice due to another issue (took too long? perhaps the login provider passwords broke the query?).

The error in the above queries is on the INSERT INTO statements as these assume that the table is empty. You need to change these queries to INSERT IGNORE INTO.
 
I just ran those on a stock database without issues. Either you have a different schema or the queries ran twice due to another issue (took too long? perhaps the login provider passwords broke the query?).

The error in the above queries is on the INSERT INTO statements as these assume that the table is empty. You need to change these queries to INSERT IGNORE INTO.

The database was upgraded from v3 to v4 so that would make sense. I ran through the queries manually with INSERT IGNORE INTO and everything went fine.

One issue I am facing is an error while trying to connect my account to a provider like Facebook - which I had previously connected with in v3. It created a new account instead. So I deleted the newly created account, logged in with user/pass and tried to "connect to facebook" in the Connections tab and received the vague error of "Something went wrong".

I understand this is a beta - so I guess I'll leave it at that.

Thanks for your assistance.
 
Back
Top