Skip to:
Content

bbPress.org

Opened 8 months ago

Last modified 2 months ago

#3419 new defect

After export from SMF error: bbp_converter_db_connection_failed

Reported by: SirLouen Owned by:
Milestone: Awaiting Review Priority: highest
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 (6)

#1 @SirLouen
8 months 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 follow-up: @SirLouen
8 months 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 );

#3 in reply to: ↑ 2 @johnjamesjacoby
8 months ago

Replying to SirLouen:

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 );

Bingo. That's exactly what I just typing out here. This appears to really be the crux of the issue. 👍

BBP_Converter_Base::callback_pass(); needs to delete that row from usermeta just like it does _bbp_password.

#4 follow-up: @HammyHavoc
2 months 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
2 months 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 @HammyHavoc
2 months 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.

Note: See TracTickets for help on using tickets.