News:

Wondering if this will always be free?  See why free is better.

Main Menu

SMF 2.1 RC3 upgrade error

Started by Massl, October 16, 2020, 12:25:21 PM

Previous topic - Next topic

Massl

I can't login so the queries aren't showed  :(

shawnb61

The htmlspecialchars error might be a symptom, but it's not the problem.  I would put the RC3 code back. 

The error message you are getting indicates a DB query is failing.  Unfortunately, the query appears to have something to do with logging on.  And it is apparently not being logged in smf_log_errors, since above you indicated you only saw the htmlspecialchars error.

So...  Let's get the DB to cough the error up. 

Either at a mysql prompt or in phpmyadmin in the SQL window, enable logging as follows:
SET global general_log = 1;
SET global log_output = 'table';


After issuing the above commands, try to login to get the error again.

Then, issue the following:
select * from mysql.general_log;

We are looking in there for a query that failed...


(Note that SET global log_output = 'file'; is much easier to read (e.g., in Notepad++), but, then you have to poke around in your mysql config file to figure out where that log is hiding...)

Address the process rather than the outcome.  Then, the outcome becomes more likely.   - Fripp

Illori

this seems to have been reported in the past, but not many were able to duplicate the issue..

seems the old issues were related to registering it seems, but leaving this here anyway.

Quote from: hollermann on February 21, 2019, 05:43:34 PM
We can close this topic, i found the solution.

Many thanks to Sir Osis and Arantor: yes, I can see your accounts!

Mistake: in section "spam" the number of questions has been set to 1, but no questions has been defined. After setting to 0 signing in was possible just with solving the picture. Setting to 1 and definig a questions works too.

Thank you very much!

shawnb61

Another query you can do from either a mysql prompt or in the phpmyadmin SQL window is this:
select * from mysql.user

Two things to look for, specifically, for the DB user you use in your Settings.php file:
(1) Are all the privileges checked with a "Y"
(2) Is the plugin column set to 'mysql_native_password'
Address the process rather than the outcome.  Then, the outcome becomes more likely.   - Fripp

Massl

Quote from: shawnb61 on October 16, 2020, 07:42:39 PM
Then, issue the following:
select * from mysql.general_log;

('2020-10-17 08:59:38.899609', 'root[root] @ localhost [::1]', 782, 1, 'Query', 'SELECT passwd, id_member, id_group, lngfile, is_activated, email_address, additional_groups, member_name, password_salt,\n passwd_flood, tfa_secret\n FROM smf_members\n WHERE member_name = \'admin\'\n LIMIT 1'),
('2020-10-17 08:59:39.375831', 'root[root] @ localhost [::1]', 782, 1, 'Query', 'UPDATE smf_members\n SET password_salt = \'499dc555e005d57799dc530c273b3c66\'\n WHERE id_member = 2'),
('2020-10-17 08:59:39.376347', 'root[root] @ localhost [::1]', 782, 1, 'Prepare', 'INSERT INTO smf_log_errors\n (id_member, log_time, ip, url, message, session, error_type, file, line, backtrace)\n VALUES( ?, ?, unhex(?), ?, ?, ?, ?, ?, ?, ?)'),
('2020-10-17 08:59:39.376635', 'root[root] @ localhost [::1]', 782, 1, 'Execute', 'INSERT INTO smf_log_errors\n (id_member, log_time, ip, url, message, session, error_type, file, line, backtrace)\n VALUES( 0, 1602917979, unhex(\'00000000000000000000000000000001\'), \'?action=login2\', \'Database Error: Data too long for column \\\'password_salt\\\' at row 1\', \'c01a1e8f9fd34a22c5884165e4fb0f6e\', \'database\', \'C:/wamp/www/Sources/Subs.php\', 412, \'[{\\\"file\\\":\\\"C:\\\\\\\\wamp\\\\\\\\www\\\\\\\\Sources\\\\\\\\Subs-Db-mysql.php\\\",\\\"line\\\":489,\\\"function\\\":\\\"smf_db_error\\\",\\\"args\\\":[\\\"\\\\n\\\\t\\\\tUPDATE smf_members\\\\n\\\\t\\\\tSET password_salt = \\\'499dc555e005d57799dc530c273b3c66\\\'\\\\n\\\\t\\\\tWHERE id_member = 2\\\",{\\\"affected_rows\\\":null,\\\"client_info\\\":null,\\\"client_version\\\":null,\\\"connect_errno\\\":null,\\\"connect_error\\\":null,\\\"errno\\\":null,\\\"error\\\":null,\\\"error_list\\\":null,\\\"field_count\\\":null,\\\"host_info\\\":null,\\\"info\\\":null,\\\"insert_id\\\":null,\\\"server_info\\\":null,\\\"server_version\\\":null,\\\"stat\\\":null,\\\"sqlstate\\\":null,\\\"protocol_version\\\":null,\\\"thread_id\\\":null,\\\"warning_count\\\":null}]},{\\\"file\\\":\\\"C:\\\\\\\\wamp\\\\\\\\www\\\\\\\\Sources\\\\\\\\Subs.php\\\",\\\"line\\\":412,\\\"function\\\":\\\"smf_db_query\\\",\\\"args\\\":[\\\"\\\",\\\"\\\\n\\\\t\\\\tUPDATE smf_members\\\\n\\\\t\\\\tSET password_salt = \\\'499dc555e005d57799dc530c273b3c66\\\'\\\\n\\\\t\\\\tWHERE id_member = 2\\\",{\\\"member\\\":\\\"2\\\",\\\"p_password_salt\\\":\\\"499dc555e005d57799dc530c273b3c66\\\"}]},{\\\"file\\\":\\\"C:\\\\\\\\wamp\\\\\\\\www\\\\\\\\Sources\\\\\\\\LogInOut.php\\\",\\\"line\\\":405,\\\"function\\\":\\\"updateMemberData\\\",\\\"args\\\":[\\\"2\\\",{\\\"password_salt\\\":\\\"499dc555e005d57799dc530c273b3c66\\\"}]},{\\\"file\\\":\\\"C:\\\\\\\\wamp\\\\\\\\www\\\\\\\\index.php\\\",\\\"line\\\":173,\\\"function\\\":\\\"Login2\\\",\\\"args\\\":[]}]\')'),
('2020-10-17 08:59:39.376785', 'root[root] @ localhost [::1]', 782, 1, 'Query', 'SELECT COUNT(id_error)\n FROM smf_log_errors'),


Note that the forum was converted from MyBB and then updated to RC2.

Quote from: shawnb61 on October 16, 2020, 07:54:46 PM
Another query you can do from either a mysql prompt or in the phpmyadmin SQL window is this:
select * from mysql.user

Two things to look for, specifically, for the DB user you use in your Settings.php file:
(1) Are all the privileges checked with a "Y"
(2) Is the plugin column set to 'mysql_native_password'

(1) Yes
(2) No


shawnb61

#25
Ahhhhh....

Can you share the structure of your members table?  All columns, datatypes, lengths, collations?

Also, what are the primary languages used in your forum? 
Address the process rather than the outcome.  Then, the outcome becomes more likely.   - Fripp

Massl

Quote from: shawnb61 on October 17, 2020, 10:43:47 AM
Can you share the structure of your members table?  All columns, datatypes, lengths, collations?

Is there an easy way to do it?

Quote from: shawnb61 on October 17, 2020, 10:43:47 AM
Also, what are the primary languages used in your forum?

Italian but I switched to english before upgrade.

shawnb61

You can just open up the table in phpmyadmin and click on the Structure tab and take a screenshot.

My current theory is your DB is somehow utf8mb4, or something other than utf8.  If your forum was working fine in RC2, I suspect the backup/restore changed the collations & charsets somehow. 

I would restore, but make sure you are utf8, not utf8mb4, before doing the upgrade.  It may help to create the empty DB and change the default collation to utf8_general_ci before doing the restore.  THEN upgrade...

Address the process rather than the outcome.  Then, the outcome becomes more likely.   - Fripp

shawnb61

Scrolling to the bottom, so you can see password_salt, it should look something like the attached...
Address the process rather than the outcome.  Then, the outcome becomes more likely.   - Fripp

Massl

#29

After changing varchar(8) to varchar(255), like in your picture, I can login again  ;D

I have password_salt varchar(8) also on live site, it would be better to increase it during the update process.

Thanks for your help shawnb61  :)

PS. Undefined index: htmlspecialchars . Error 500 even updating the live site, solved by deleting upgrade files.

shawnb61

Address the process rather than the outcome.  Then, the outcome becomes more likely.   - Fripp

vbgamer45

Will make the change with the convertors to go to 255. in the few cases it was changed.
Community Suite for SMF - Take your forum to the next level built for SMF, Gallery,Store,Classifieds,Downloads,more!

SMFHacks.com -  Paid Modifications for SMF

Mods:
EzPortal - Portal System for SMF
SMF Gallery Pro
SMF Store SMF Classifieds Ad Seller Pro

shawnb61

Quote from: Massl on October 18, 2020, 05:04:55 AM
I have password_salt varchar(8) also on live site, it would be better to increase it during the update process.


With vbgamer45's help, converters were addressed here:
https://github.com/SimpleMachines/converters/pull/5

And making the upgrader a little smarter is in the works here:
https://github.com/SimpleMachines/SMF2.1/pull/6306
Address the process rather than the outcome.  Then, the outcome becomes more likely.   - Fripp

Advertisement: