WordPress import error: "Could not select entry informa

Found a bug? Tell us!!
pmjdebruijn
Regular
Posts: 14
Joined: Sun Dec 30, 2007 3:16 pm
Location: Netherlands
Contact:

WordPress import error: "Could not select entry informa

Post by pmjdebruijn »

After starting the WordPress import procedure, I'm getting these messages:

Starting import procedure...
Importing users...
Imported users.
Importing categories (WP 2.3 style)...
Imported categories.
Rebuilding category tree...
Rebuilt category tree.
Importing entries...
Could not select entry information: .ID: 68 - Microsoft: One open document standard good, two better
Import failed: Entries were not successfully inserted!

This post seems to be causing the problem:
http://blog.pcode.nl/2005/12/15/microso ... wo-better/

The import procedure halts to a dead stop at this post, it doesn't even skip it.

What might be wrong? Could this be a bug?

I'm using s9y with PHP 5.2 and PostgreSQL 8.1.
garvinhicking
Core Developer
Posts: 30022
Joined: Tue Sep 16, 2003 9:45 pm
Location: Cologne, Germany
Contact:

Re: WordPress import error: "Could not select entry inf

Post by garvinhicking »

Hi!

This error should only happen if a mysql error occurs. Can you check your WP DB tables for integrity, with phpmYAdmin? (Check Table ...)

The error msg can occur in 3 places in the s9y file. Could you try to edit your include/admin/importers/wordpress.inc.php file and look for this:

Code: Select all

printf(COULDNT_SELECT_ENTRY_INFO
Before each of the 3 occurences, add this:

Code: Select all

echo "Step 1<br />\n";
Change it to step 2 and step 3 on the other occurences. This will allow us to see which one of the three error places executes the error.

Actually, you shold see a mysql error message - I'm wondering, why in your case you see nothing there?!

Regards,
Garvin
# Garvin Hicking (s9y Developer)
# Did I help you? Consider making me happy: http://wishes.garv.in/
# or use my PayPal account "paypal {at} supergarv (dot) de"
# My "other" hobby: http://flickr.garv.in/
pmjdebruijn
Regular
Posts: 14
Joined: Sun Dec 30, 2007 3:16 pm
Location: Netherlands
Contact:

Post by pmjdebruijn »

Thanks for your reply.

Checking the tables gives me this, and everything seems okay:

Table Op Msg_type Msg_text
pmjdebruij_wp_db.wp_comments check status OK
pmjdebruij_wp_db.wp_geotrack check status OK
pmjdebruij_wp_db.wp_geotrack_exclude check status OK
pmjdebruij_wp_db.wp_geotrack_ipblock check status OK
pmjdebruij_wp_db.wp_geotrack_ip_whitelist check status OK
pmjdebruij_wp_db.wp_links check status OK
pmjdebruij_wp_db.wp_options check status OK
pmjdebruij_wp_db.wp_postmeta check status OK
pmjdebruij_wp_db.wp_posts check status OK
pmjdebruij_wp_db.wp_terms check status OK
pmjdebruij_wp_db.wp_term_relationships check status OK
pmjdebruij_wp_db.wp_term_taxonomy check status OK
pmjdebruij_wp_db.wp_usermeta check status OK
pmjdebruij_wp_db.wp_users check status OK

After the check, I also optimized the tables.

Then I modified the importer file as you suggested, and I get this:

Starting import procedure...
Importing users...
Imported users.
Importing categories (WP 2.3 style)...
Imported categories.
Rebuilding category tree...
Rebuilt category tree.
Importing entries...
Step 2
Could not select entry information: .ID: 68 - Microsoft: One open document standard good, two better
Import failed: Entries were not successfully inserted!

This is the full text, I see no MySQL message.

Regards,
Pascal
garvinhicking
Core Developer
Posts: 30022
Joined: Tue Sep 16, 2003 9:45 pm
Location: Cologne, Germany
Contact:

Post by garvinhicking »

Hi!

Okay, can you try to modify:

Code: Select all

if (!is_int($entries[$x]['entryid'] = serendipity_updertEntry($entry))) {
to:

Code: Select all

$entries[$x]['entryid'] = serendipity_updertEntry($entry);
if (!is_int($entries[$x]['entryid'])) {
    echo 'Not an integer: ' . $entries[$x]['entryid'] . "<br />\n";
And try again. It seems as if this entry can't be saved, which is quite strange.

If you remove the line

Code: Select all

return $entries[$x]['entryid'];
within that IF-structure (with your "Step 2") you can make s9y still process the other entries and not bail out.

HTH,
Garvin
# Garvin Hicking (s9y Developer)
# Did I help you? Consider making me happy: http://wishes.garv.in/
# or use my PayPal account "paypal {at} supergarv (dot) de"
# My "other" hobby: http://flickr.garv.in/
pmjdebruijn
Regular
Posts: 14
Joined: Sun Dec 30, 2007 3:16 pm
Location: Netherlands
Contact:

Post by pmjdebruijn »

Ah, that seems to change some things. It seems multiple posts are causing issues. And now I do get MySQL errors.

Starting import procedure...
Importing users...
Imported users.
Importing categories (WP 2.3 style)...
Imported categories.
Rebuilding category tree...
Rebuilt category tree.
Importing entries...
Not an integer: Entries were not successfully inserted!
Could not select entry information: .ID: 68 - Microsoft: One open document standard good, two better
Not an integer: Entries were not successfully inserted!
Could not select entry information: .ID: 146 - Extracting Fonts from PDFs
Not an integer: Entries were not successfully inserted!
Could not select entry information: .ID: 172 - SGI XFS and its competition
Not an integer: Entries were not successfully inserted!
Could not select entry information: .ID: 224 - The Open Source Radeon Drivers
Not an integer: Entries were not successfully inserted!
Could not select entry information: .ID: 233 - Missing Icons
Not an integer: Entries were not successfully inserted!
Could not select entry information: .ID: 235 - Ripping vynil records
Not an integer: Entries were not successfully inserted!
Could not select entry information: .ID: 244 - File Sharing
Not an integer: Entries were not successfully inserted!
Could not select entry information: .ID: 249 - I'm LPI Certified Level Two
Imported entries...
Could not select entry information: MySQL server has gone away.Could not select comment information: MySQL server has gone away.Import successfully completed

Maybe I should clarify one thing. I'm using a MySQL 5.0 client, to connect on my old webhosters MySQL server... I have no clue which version he runs.
pmjdebruijn
Regular
Posts: 14
Joined: Sun Dec 30, 2007 3:16 pm
Location: Netherlands
Contact:

Post by pmjdebruijn »

By the way, shouldn't the "skip on error" behaviour be the default, instead of "stop on error" for importers?

Also, I wish I knew what the problem was, I would be happy to manually correct those posts.
Last edited by pmjdebruijn on Mon Dec 31, 2007 3:07 pm, edited 1 time in total.
garvinhicking
Core Developer
Posts: 30022
Joined: Tue Sep 16, 2003 9:45 pm
Location: Cologne, Germany
Contact:

Post by garvinhicking »

Hi!

Ah! It seems your mysql client is aborting the connection. This is why it only happens after some time.

Ask your mysql DB provider what the connection limits are, they might need to be risen to start a larger import?

Regards,
Garvin
# Garvin Hicking (s9y Developer)
# Did I help you? Consider making me happy: http://wishes.garv.in/
# or use my PayPal account "paypal {at} supergarv (dot) de"
# My "other" hobby: http://flickr.garv.in/
pmjdebruijn
Regular
Posts: 14
Joined: Sun Dec 30, 2007 3:16 pm
Location: Netherlands
Contact:

Post by pmjdebruijn »

Oh wait...

But it did finish! I have my most recent posts! Only those listed are missing.

Regards,
Pascal
pmjdebruijn
Regular
Posts: 14
Joined: Sun Dec 30, 2007 3:16 pm
Location: Netherlands
Contact:

Post by pmjdebruijn »

I've emailed my old provider to see what the limits are. But that'll probably take till wednesday.
pmjdebruijn
Regular
Posts: 14
Joined: Sun Dec 30, 2007 3:16 pm
Location: Netherlands
Contact:

Post by pmjdebruijn »

My webhoster claims the database timeout should be 7 minutes. So this should not be the issue.
pmjdebruijn
Regular
Posts: 14
Joined: Sun Dec 30, 2007 3:16 pm
Location: Netherlands
Contact:

Post by pmjdebruijn »

I also tried dumping/restoring my database, but that did nothing as well.
pmjdebruijn
Regular
Posts: 14
Joined: Sun Dec 30, 2007 3:16 pm
Location: Netherlands
Contact:

Post by pmjdebruijn »

Doh! I'm such an ass...

Actually PostgreSQL is having trouble with converting the encoding... Which means these posts have an "illegal" character in them.

2008-01-05 14:37:06 CET ERROR: invalid byte sequence for encoding "UTF8": 0x80
2008-01-05 14:37:06 CET HINT: This error can also happen if the byte sequence does not match the encoding expected by the server, which is controlled by "client_encoding".
2008-01-05 14:37:13 CET ERROR: invalid byte sequence for encoding "UTF8": 0x82
2008-01-05 14:37:13 CET HINT: This error can also happen if the byte sequence does not match the encoding expected by the server, which is controlled by "client_encoding".
pmjdebruijn
Regular
Posts: 14
Joined: Sun Dec 30, 2007 3:16 pm
Location: Netherlands
Contact:

Post by pmjdebruijn »

Ok so, so we're talking about these:

80 = PAD = Padding Character
82 = BPH = Break Permitted Here

Now, is there a way to filter those?

(Of course I could just set my database to latin1, however I would like to stick to UTF8.)
garvinhicking
Core Developer
Posts: 30022
Joined: Tue Sep 16, 2003 9:45 pm
Location: Cologne, Germany
Contact:

Post by garvinhicking »

Hi!

Phew, I know too little of postgresql. Maybe you can direct this problem to a postgresql-mailinglist or forum and ask the pgsql guys, what you can do to fix the issue? Surely pgsql supports some way of operation to properly replace those characters...

Regards,
Garvin
# Garvin Hicking (s9y Developer)
# Did I help you? Consider making me happy: http://wishes.garv.in/
# or use my PayPal account "paypal {at} supergarv (dot) de"
# My "other" hobby: http://flickr.garv.in/
pmjdebruijn
Regular
Posts: 14
Joined: Sun Dec 30, 2007 3:16 pm
Location: Netherlands
Contact:

Post by pmjdebruijn »

The problem isn't really PostgreSQL, it just strictly adheres to UTF8.

Somehow, the latin1 data gotten from the MySQL server isn't properly being converted to UTF8.

http://nl3.php.net/manual/en/function.iconv.php

If you append the string //IGNORE, characters that cannot be represented in the target charset are silently discarded.

I don't see that IGNORE anyway in the serendipity code.
Post Reply