Skip to:
Content

bbPress.org

Opened 3 years ago

Closed 2 years ago

Last modified 6 months ago

#3419 closed defect (bug) (fixed)

After export from SMF error: bbp_converter_db_connection_failed

Reported by: sirlouen's profile SirLouen Owned by: johnjamesjacoby's profile johnjamesjacoby
Milestone: 2.6.10 Priority: highest omg sweet tea
Severity: critical Version: trunk
Component: API - Importers Keywords:
Cc:

Description

For all users who were exported with SMF I've found this error:

{"success":false,"data":[{"code":"bbp_converter_db_connection_failed","message":"Database connection failed"}]}

I exported from an SMF forum hosted in server A (lets say IP AAA.BBB.CCC.DDD)
My new server for bbPress is server B (lets say EEE.FFF.GGG.HHH)

I have set up in the bbPress migration config the information from server A, mysql host (the AAA.BBB.CCC.DDD), the mysql database, the user and the password.

I also have set up in the server A, an open bind address (0.0.0.0) so that server B with bbPress can connect. As long as server B with bbPress can connect the database of server A, everything is great.

But as soon as I remove this connection, for example by removing the MySQL bind address, the error bbp_converter_db_connection_failed starts popping for all the imported users that try to log in:

Why is this happening?
Maybe some old SMF users have never migrated or are missing some wp_usermeta info?
After some research, what I've noticed is that all users in this situation (just the ones that were migrated, have a wp_usermeta property called:

meta_key= _bbp_class 
meta_value = SMF

I've tried removing this tag and "voila": it has been solved.
So, something suggests me that there might be something broken in the code.

Change History (11)

#1 @SirLouen
3 years ago

A simple "patch" obviously could be around this QUERY:

UPDATE `wp_usermeta` SET `meta_value`=NULL WHERE `meta_key` LIKE '_bbp_class' AND `meta_value` LIKE 'SMF'

But obviously, we are going around a more serious issue within the code and not sure how important is this meta key for the Importer standpoint.

#2 @SirLouen
3 years ago

I also think that the problem comes from

includes/users/functions.php

After the password conversion done correctly, the converter doesn't remove the _bbp_class to avoid repeated conversions from the same converter in line 982

$converter = bbp_new_converter( $row->meta_value );

#4 follow-up: @HammyHavoc
3 years ago

Did anybody ever make any progress with this? This problem was fixed, but has returned out of the blue.

#5 in reply to: ↑ 4 @SirLouen
3 years ago

Replying to HammyHavoc:

Did anybody ever make any progress with this? This problem was fixed, but has returned out of the blue.

For some reason, the server database where you exported, has to be permanently linked in the exporting section of bbpress. Why? I'm not 100% sure. Is like everything is not fully exported, and needs to keep doing some lookups.

In case there is no SQL connection between the two servers or at least the two databases (the one exported and the bbpress one), you will receive this message.

A serious bug definitelly because DB shall be disengaged at some point.

#6 follow-up: @HammyHavoc
3 years ago

Interesting thing I've just found:

If users who were migrated use their email address rather than their username then it works without problem. Usernames seem to be what causes the issue, at least for me.

#7 @johnjamesjacoby
2 years ago

  • Milestone changed from Awaiting Review to 2.6.10
  • Owner set to johnjamesjacoby
  • Status changed from new to assigned

#8 @johnjamesjacoby
2 years ago

  • Resolution set to fixed
  • Status changed from assigned to closed

In 7243:

Converter: remove _bbp_class key on successful authentication.

This change cleans up the usermeta key that is used to determine if the relative user has a password from a converted platform that still needs to be rehashed.

Cleaning this up fixes a bug that would cause recurrent conversions from some platforms.

In branches/2.6, for 2.6.10.

Props sirlouen. Fixes #3419.

#9 @johnjamesjacoby
2 years ago

In 7244:

Converter: remove _bbp_class key on successful authentication.

This change cleans up the usermeta key that is used to determine if the relative user has a password from a converted platform that still needs to be rehashed.

Cleaning this up fixes a bug that would cause recurrent conversions from some platforms.

In trunk, for 2.7.0.

Props sirlouen. Fixes #3419.

#10 in reply to: ↑ 6 @johnjamesjacoby
2 years ago

Replying to HammyHavoc:

Interesting thing I've just found:

If users who were migrated use their email address rather than their username then it works without problem. Usernames seem to be what causes the issue, at least for me.

Separate issue that will be addressed on its own. 👍

#11 @johnjamesjacoby
2 years ago

In 7245:

Converter: improvements to bbp_user_maybe_convert_pass():

  • Unslash 'log' posted value
  • Trim 'pwd' posted value
  • Bail early if either are empty
  • Use get_user_by() and get_user_meta() instead of direct MySQL query
  • Bail if user/meta are not found
  • Bail if converter not string or not found

This change ensures that users who sign in via either their username or email are converted. Before this change, signing in via email would not trigger a conversion.

In trunk, for 2.7.0.

See #3419.

#12 @johnjamesjacoby
2 years ago

In 7246:

Converter: improvements to bbp_user_maybe_convert_pass():

  • Unslash 'log' posted value
  • Trim 'pwd' posted value
  • Bail early if either are empty
  • Use get_user_by() and get_user_meta() instead of direct MySQL query
  • Bail if user/meta are not found
  • Bail if converter not string or not found

This change ensures that users who sign in via either their username or email are converted. Before this change, signing in via email would not trigger a conversion.

In branches/2.6, for 2.6.10.

See #3419.

Note: See TracTickets for help on using tickets.