Upfront:
- using remotes
- migration between to platforms which are 99% the same. There is a minor code change ( update of module )
- Issue is 100% reproduceable - happens on all sites
- all sites use taxonomy_access and nodeaccess extension

When you migrate a site from platform A to B on the same remote ( and pretty sure to any other platform on every server ) the sites content is not accessable by anybody after the migration. You must rebuild the nodeaccess table ( admin/content/node-settings ) for getting it work again. Migrating the site again will have the same effect again and again. Even if the platfom stays identicly ( use the same makefile ) the nodeaccess table is still broken.

Marking as critical, as this make migration unuseable.

CommentFileSizeAuthor
#8 accessrebuildui1.patch1.45 KBEugenMayer
#4 ccuid1.patch680 bytesEugenMayer
Support from Acquia helps fund testing for Drupal Acquia logo

Comments

EugenMayer’s picture

Just to be sure, its not a dupe of http://drupal.org/node/1062070 .. because in the other issue rebuilding does not help. All nodeaccess settings are lost there ( grants table deleted or flushed ), while here they are still there but not generated correctly.

EugenMayer’s picture

I just tested it. After the migration i dumped node_access, rebuild permissions and compared them. It seems like the node_access table missses 80% of all entries. That smells very much again because of running stuff like rebuild as anon and not -u 1

EugenMayer’s picture

Title: nodeaccess table compromised after platform migration » nodeaccess table compromised after site verify ( migration )

fixing title ( has nothing to do with a platform ). Verified it happens on site verify, making this one a huge bomb on my side..

EugenMayer’s picture

FileSize
680 bytes

Well as expected, its due the node_access_rebuild with anon, which simply fails as not all nodes can be loaded due to db_rewrite_sql. E.g. term_access and og nodes are missing then.

Patch attached

EugenMayer’s picture

Status: Active » Needs review
anarcat’s picture

Status: Needs review » Needs work

I think this patch should also be ported to the drupal5 and drupal7 engines. You seem to already have the d7 code, it just needs to be moved to the relevant file. Not sure about the d5 api.

Can you update the patch for this?

I am a bit surprised to see cache_clear_all() doesn't already operate with uid 1, maybe that patch should be sent upstream to drush?

Thanks for the catch...

EugenMayer’s picture

iam really running low on time, esp. because of the number of other issues with aegirs ( see issue queue ) on which it seems i have to work on all on my own. I would be happy if you could add those things anarcat. Thanks!

EugenMayer’s picture

Status: Needs work » Needs review
FileSize
1.45 KB

rerolled, added docs and D7 code.

Dont expect me to add anything for D5 - i simply dont know the API and not going to waste my time looking at the API. Its 2 releases back in time, its time to drop it.

omega8cc’s picture

I'm not sure we should fix in Aegir something looking as a bug in the Drush itself?

Why is it running node access rebuild on drush cc, after all?

I see it was introduced here: http://drupal.org/node/655808 but maybe it should be reverted in the Drush?

anarcat’s picture

Priority: Critical » Major
Status: Needs review » Closed (works as designed)

I had this conversation with webchick, and as moshe, she's also of the opinion that node_access modules shouldn't check the running user: that's the bug.

I would check taxonomy_access and node_access modules to see if they do user_access() checks or node_access() checks without an explicit uid. Checking against the running user doesn't make sense, because if you run as UID 1, then you get access to everything anyways.

Otherwise, I believe we can just skip flushing those node_access tables, unless really necessary. I will commit a fix to master and stable to make sure we don't rebuild those caches unless node_access_needs_rebuild has been raised somewhere.

EugenMayer’s picture

anarcat you might think about that keyword:

db_rewrite_sql

Iam pretty sure you wil discover that not a single "user check" is done in those modules. Its simply the D6 access / rewrite sql API which counterfires here.

anarcat’s picture

Eugen, I am aware of db_rewrite_sql.

If the contrib modules do not check the logged in user, then they are implemented properly. If they are implemented properly, then we do not need to do special user session changes.

  • Commit 891f5b6 on 6.x-1.x, dev-ssl-ip-allocation-refactor, dev-1205458-move_sites_out_of_platforms, 7.x-3.x, dev-subdir-multiserver, 6.x-2.x-backports, dev-helmo-3.x by anarcat:
    #1075002 - rebuild the node access tables only when necessary, and only...
  • Commit 99788ab on dev-ssl-ip-allocation-refactor, dev-1205458-move_sites_out_of_platforms, 7.x-3.x, dev-subdir-multiserver, 6.x-2.x-backports, dev-helmo-3.x by anarcat:
    #1075002 - rebuild the node access tables only when necessary, and only...

  • anarcat committed 891f5b6 on
    #1075002 - rebuild the node access tables only when necessary, and only...
  • anarcat committed 99788ab on
    #1075002 - rebuild the node access tables only when necessary, and only...

  • anarcat committed 891f5b6 on 7.x-3.x-1966886-context-to-entity
    #1075002 - rebuild the node access tables only when necessary, and only...
  • anarcat committed 99788ab on 7.x-3.x-1966886-context-to-entity
    #1075002 - rebuild the node access tables only when necessary, and only...

  • anarcat committed 891f5b6 on 6.x-2.x-1995506-profile-option
    #1075002 - rebuild the node access tables only when necessary, and only...
  • anarcat committed 99788ab on 6.x-2.x-1995506-profile-option
    #1075002 - rebuild the node access tables only when necessary, and only...