I've updated a 6.20 site to 7.0 I've seen no errors during the update.
Strangely, a lot of comments are now empty. That is: The title, author and date are correct, but the comment content is not there anymore. It's not a theme issue: I've tested with garland. Additionally I'm receiving this error in dblog
Warning: array_flip() [function.array-flip]: Can only flip STRING and INTEGER values! in DrupalDefaultEntityController->cacheGet() (line 354 of /var/www/zona7/includes/entity.inc).
But the error appear also when I visit a page without comments, it seems to be unrelated.
If I create a new comment, there content is there.
In what table of the database is the content comment? (I've checked the 'comment' table and I found the title of the comments, but not the content)
Please, report if you have seen this behavior or write a comment if you can help me somehow, thanks
Comment | File | Size | Author |
---|---|---|---|
#69 | stop_bleeding_please_0.patch | 2.23 KB | catch |
#55 | stop_bleeding_please.patch | 4.97 KB | webchick |
#50 | last_reroll_i_hope.patch | 1.27 KB | catch |
#46 | still_depends_on_1097100_3_weeks_later.patch | 4.45 KB | catch |
#46 | stop_bleeding_please_d7.patch | 4.97 KB | catch |
Comments
Comment #1
droplet CreditAttribution: droplet commentedI can't confirm but its like an upgrade path problem. so changed to bug report
Comment #2
catchThis is now in field_data_comment_body.
things to check:
1. SELECT COUNT(*) FROM comments; vs. SELECT COUNT(*) FROM field_data_comment_body
2. Check a specific comment in your D6 comment table, compared to the D7 field table. (entity_id in the D7 field table will be the same as {comments}.cid
3. If you find that the comment body text has made it into the D7 site, but the comments aren't showing up, then check which text format is being used in field_data_comment_body - it may be that the filter is broken due to a missing contrib module and you'll need to go to admin/config/ (something text formats) to sort it out - after doing so + cache clear it may all come back.
Comment #3
federico CreditAttribution: federico commentedSELECT COUNT( * ) FROM comment = 2791
SELECT COUNT( * ) FROM comments = 2791 (drupal 6 DB)
SELECT COUNT( * ) FROM field_data_comment_body = 380
* I've made the update twice (same D6 database), with the same results.
* I've tried to manually find a pattern in the comments that made into the D7 database vs those that didn't:
- I noticed is that either all comments in a node are updated the right way, or no comment in a node is correctly upgraded.
- All comments in node type 'story' where updated OK, all comments in other node types ('blog' or 'page') weren't
* Update: I've tried to update a second site from D6 to D7, obtaining the same results. (2586 comments in D6 versus 164 comments with content in D7, 'story comments' updated, 'other comments' without field_data_comment_body).
Comment #4
federico CreditAttribution: federico commentedIn my previous attempts, I've disabled all optional modules including "blog" and "forum", I've tried again letting those modules enabled before upgrade, and now I can see the comments after upgrade.
UPGRADE.txt says
So it was my mistake.Anyway, I don't know if this behavior is by design or if this is a bug. I think this is a bug because:
Comment #5
catch#895014: All fields of a node type are lost on module disable is the issue this was originally found in. That issue was happily closed, forgetting that we needed patches for Drupal 5 and 6 - those patches should have blocked the first beta.
I'm bumping this one to critical, but it depends on a Drupal 6 patches for #895014: All fields of a node type are lost on module disable - however we need to have an active, critical issue in the Drupal 7 queue so it doesn't get lost again.
Comment #6
catchThis needs tests.
Comment #7
carlos8f CreditAttribution: carlos8f commentedsubscribing.
Comment #8
carlos8f CreditAttribution: carlos8f commentedSimilar issue, not sure if it's related or not: #890128: Comment body missing if comment module enabled after a content type module
Comment #9
catchThinking about it, the backport doesn't do anything for D6 sites that have already disabled a node-type providing module.
I'm wondering if we can do an additional catch-all in Drupal 7 which would more or less amount to SELECT DISTINCT type FROM {node} and then create disabled node types for any that are missing in the Drupal 7 upgrade path itself with some default settings. This would mean the configuration for those node types will get lost, but the actual data at least in the body field and taxonomy would be preserved.
Comment #10
jpsoto CreditAttribution: jpsoto commentedLet me a sideline remark ... I think, there is something essentially bad when managing node types and fields of disabled modules.
Please, have a quick look at ...
#943588: node_type_delete(): hook_node_type_delete will fail for a disabled node_type. Trying to get property of non-object in hook_node_type_delete()
#943772: field_delete_field() and others fail for inactive fields
Comment #11
joachim CreditAttribution: joachim commentedIsn't this a duplicate of #895014: All fields of a node type are lost on module disable?
Comment #12
catchIt is, but it's intentional, I really want active Drupal 7 and Drupal 6 issues so this doesn't get lost a second time.
Comment #13
Leeteq CreditAttribution: Leeteq commentedSubscribing.
Comment #14
catchHere's a rough patch that starts the process of trying to fix this within D7 - I think we need this because any Drupal 6 site that has ever disabled a node type before the backport goes in will still have orphaned node types that don't exist anywhere except for {node}.
This issue is really a continuation of #232327: Deleting node type leaves orphan nodes and similar.
Also note there is absolutely no way we can repair this for sites that have already upgraded to Drupal 7 and lost content, because we drop the node_revision.body column in that update.
I won't have much time to look at this further, next step would be either trying this on a real D6 site, or adding a test case.
Comment #15
drumrwaldo CreditAttribution: drumrwaldo commentedSubscribing. Will try to test the patch out once I can return my site to D6.2, as I've already gone to D7 and have a host of issues with image nodes now.
Comment #16
catchTwo patches, test_only.patch should have one fail. The other should pass.
Comment #19
catchExtra comment for node upgrade was causing duplicate key errors, with that gone the comment upgrade ran fine, seeing what's left.
Comment #21
aspilicious CreditAttribution: aspilicious commentedTest bot seems down?
Needs work?
Comment #22
catchYep, it's still broke. The data in the upgrade path dump is what breaks it, need to re-organise things so that it doesn't conflict with any of the other tests.
Comment #23
catchI may not get to this for a while. If anyone wants to take over, all that really needs doing is scrapping the upgrade data from the patch here, then adding it separately similar to other tests, so it doesn't conflict with them. The actual fix and test changes should be more or less identical once that's done.
Comment #24
catchAlso this is now D7 only after #1097100: Remove all 7xxx update functions and tests (D6 to D7 upgrade path), there's not much we can do for 7-7 or 7-8 installs that were already upgraded from Drupal 6 (if there is this should be a new issue) - so no need to move this to D8 and backport (as I'm currently doing for other Drupal 7 criticals).
Comment #25
catchHere's a patch that passes tests locally.
Off-topic - anyone thinking this is the only Drupal 7 critical, 'fraid not, but it's the only one that doesn't need to go into Drupal 8 first.
Comment #26
catch_update_7000_node_get_types() is in Drupal 8, so patch for that.
Comment #27
catchBot!
Comment #29
catchPatch doesn't apply due to #1097100: Remove all 7xxx update functions and tests (D6 to D7 upgrade path). Waiting on resolution there.
Comment #30
catchMarked #1133402: Cannot upgrade site if no node types exist as duplicate since this is similar, and exactly the same code.
Attached untested patch (for D7 only, since it is still impossible to roll a patch for Drupal 8 until #1097100: Remove all 7xxx update functions and tests (D6 to D7 upgrade path) is fixed), ought to do it.
Comment #31
q0rban CreditAttribution: q0rban commentedOne other scenario that this (looks like it) would fix is the instance where you actually have no node types or nodes. Currently if you attempt to upgrade a Drupal 6 site that has no node types, you receive a PDO exception, as it's trying to use
WHERE type NOT IN ();
. See #1133402: Cannot upgrade site if no node types exist for more details.Comment #32
q0rban CreditAttribution: q0rban commentedComment #33
q0rban CreditAttribution: q0rban commentedI tested this patch with an orphaned node, and saw the data created properly. This test also was on a database with no node types, so #1133402 was also resolved.
Comment #34
catchThis might fix the issue, but it is still blocked on #1097100: Remove all 7xxx update functions and tests (D6 to D7 upgrade path) since there is no viable D8 patch. Leaving at needs review since there is no work that can currently be done here, and 'postponed' would take it out of the default criticals listing.
Comment #35
catchThis is the patch from #30, rolled against 8.x with #1097100: Remove all 7xxx update functions and tests (D6 to D7 upgrade path) already applied. Once that patch is in, it should apply cleanly.
(edit, thank you git for making this a 2 minute process)
Comment #36
catchComment #37
q0rban CreditAttribution: q0rban commentedLooks great!
Comment #38
Dries CreditAttribution: Dries commentedI committed #1097100: Remove all 7xxx update functions and tests (D6 to D7 upgrade path).
Comment #39
Dries CreditAttribution: Dries commentedI had to read this 3 times but I'm still not sure I understand this explanation. Can we rephrase this a bit better?
It would also be good to add a sentence explaining what is going on at a slightly higher level.
Powered by Dreditor.
Comment #40
q0rban CreditAttribution: q0rban commentedHeh, yeah, that comment actually made it into D7, but also took me about 5 reads before I understood it. Revised patch.
Comment #41
catchThat comment has been in Drupal 7 since September last year, and is unchanged by the patch, the only reason it's here is because we're moving the hunk of code around. But this bug has only been known about for 8 months so it's entirely appropriate to hold it up on an 8 month old comment.
Comment #42
catch#1097100: Remove all 7xxx update functions and tests (D6 to D7 upgrade path) wasn't actually committed, so I had to re-roll this one again, to depend on that patch.
Comment #44
MichelleWhen I upgraded my site in February, I did a really bad winging it job and messed a lot of things up. I noticed that all the comments were gone on all the forum posts and assumed it was yet another thing I had done wrong in the major fail upgrade. Since I really didn't care about the old forum posts, I just said f-it and deleted all the forum nodes as well. Now I see talk about this on IRC and wonder if I got bit by this and that's why all the comments were gone?
Not much useful there but catch said it would be good to post that I lost data to this. In my case I didn't care so much but I would definitely be upset if I still cared about the forum on that site.
Michelle
Comment #45
MichelleWhoops, crossposted.
Michelle
Comment #46
catchUpdated comment via beejeebus.
Comment #48
catchPatch doesn't apply because it depends on the still uncommitted #1097100: Remove all 7xxx update functions and tests (D6 to D7 upgrade path). Back to CNR.
Comment #49
catch#46: still_depends_on_1097100_3_weeks_later.patch queued for re-testing.
Comment #50
catch#1097100: Remove all 7xxx update functions and tests (D6 to D7 upgrade path) was committed, re-rolled again. I'm not re-rolling this patch another time so hopefully this is it now, otherwise someone else is going to have to take over here.
Comment #51
q0rban CreditAttribution: q0rban commentedLooks good!
Comment #52
Dries CreditAttribution: Dries commentedCommitted to 7.x and 8.x. Marking this fixed. Sorry for the delays -- and thanks for all the work.
Comment #53
xmacinfoCommit for 7.x missing from the commit log: http://drupal.org/node/3060/commits
Comment #54
webchickReally committed this time. :)
Thanks a lot for sticking with this, catch. I know it's been very frustrating for you. Don't worry; we'll get D7 into tip-top shape here in the next couple of weeks. :)
Comment #55
webchickGrrr. So I tried (I really did!) to commit this earlier, but it failed testbot for some reason. The error was related to DrupalWebTestCase not being able to be loaded from Block module (I was terribly distracted and forgot to copy it) which makes absolutely no sense, and doesn't happen from the UI. Then I tried to figure out run-tests.sh and that was a disaster. And now I'm about to be traveling all day tomorrow.
So I'll take another look at this this weekend when I have some uninterrupted time in front of the computer (probably late night, since I'll be seeing my family).
In the meantime, I'm re-uploading catch's patch from #46 in the hopes that testbot can either a) like it, or b) give us some extra help in figuring out what the problem is.
Comment #57
catch#55: stop_bleeding_please.patch queued for re-testing.
Comment #59
webchickWell, at least it's consistent, I guess...
For the record, this is the line the testbot is running:
I'm trying to replicate some proximity of this on localhost (I don't have concurrency support):
...and with or without the patch applied, the test suite, including the block tests, seems to execute fine. :( It definitely hasn't crapped out at 0 seconds with a fatal error, at any rate.
I'm going to need Damien or Randy to help me debug this. :(
Comment #60
catchLast test was from client 659, I want to see this fail on another test client.
#55: stop_bleeding_please.patch queued for re-testing.
Comment #62
catch659 again. Disabled the client. Sending for retest again.
Comment #63
catch#55: stop_bleeding_please.patch queued for re-testing.
Comment #65
catchDifferent test bot, same failure. Re-enabled 659.
That's me out of this issue: I have neither access to debug it on the test bots, nor any intention to put more time into the black hole.
Good luck folks.
Comment #66
Starminder CreditAttribution: Starminder commentedSubscribe. I'm open to suggestions as to what I can or should do about this. (Most or all of my comment text is blank on a 3 year old site). Blah. It's a showstopper for me.
Comment #67
Eric_A CreditAttribution: Eric_A commentedAny upgrade test that works with just drupal-6.bare.database.php gets into trouble at the array_diff().
Edit: I'm reading up now, the above may or me not be nonsense. The one thing on my mind was "If there is no next record, FALSE will be returned".
Comment #69
catchThe ->fetchCol() and ->fetchAllAssoc() methods both return array() if there's no result, so that ought to be OK unless I missed something.
I bit my tongue and bisected this on another issue to try to track down the test failures.
The actual fix passes tests fine. Uploading the tests by themselves or combined with the patch causes the bizarre block.test issue. Since this has passed the test bot in the past, passes locally etc. I don't think it should be delayed any further on test bot weirdness (and if it is, I'm out of this issue again). so I'm uploading #55 minus the tests and marking RTBC again.
Just to add to the ultra-urgency of finally getting this applied - there is more than one reason that comment bodies might not display after upgrade, if I remember correctly we committed a patch for text formats to display empty content if filter configuration is invalid. Additionally if some node types are disabled and some aren't, then you will have the table for the comment body field created, and it'll have some perfectly fine records in it - just not for all of the comments on your site.
So not only does this delete the content during upgrade, and not only does it fail silently during the upgrade process itself: unless you've seen this issue, the only way to diagnose it is to run database queries against your upgraded database and understand the results - so even people who backup and run the upgrade, might not realise they've run into the bug until it's too late, and then they'd either have to start over from scratch, or try to restore from a D6 backup into their D7 site (if they still have one).
Comment #70
Starminder CreditAttribution: Starminder commentedThat sound you just heard was the scream of 8000 comments going off into the wind.
Comment #71
catchOpened #1160928: Add tests for node type/comment body upgrade path.
Comment #72
webchickYay!! Committed to 7.x at long last!!
Thank you thank you thank you thank you thank you thank you thank you thank you thank you thank you thank you thank you thank you thank you thank you thank you thank you thank you thank you thank you thank you thank you thank you thank you!!!
Comment #74
joachim CreditAttribution: joachim commentedCould we get this released in a 7.3 pretty soon, so contrib modules can tell users to use that to upgrade?
Comment #75
droplet CreditAttribution: droplet commented@joachim,
it's already in 7.2