I dont know why, but I cannot run the rebuild permissions in post settings. When I select rebuild permissions, it appears to be loading for a second, then goes to the node settings page. No permissions rebuild done.

Also, this may or may not be related, the update.php goes straight to the frontpage when I am at the point of starting the updated of the database.

I use drush to get around issues with slow response and update.php, but do not have a command line work around for rebuilding permissions. Ideas?

Comments

Netzarim’s picture

Also, while troubleshooting this issue, I found that the node_access table gets truncated when I run the rebuild in the web interface and then it dumps back to the other page...

At least that tells me that it is actually in the process when something goes bad..

Is there some temp folder or something that it needs to write to? I am not seeing anything in syslog, apache, or in the drupal watchdog logs indicating what the problem is. It is very frustrating..

I build a clean 6.12 dev site, installed the modules... When I installed FriendList, the problem showed up there too... I uninstalled friendlist and the problem stays..

okokokok’s picture

Status: Active » Closed (fixed)

To rebuild permissions from the command-line: install drush and try

drush php-eval 'node_access_rebuild();'
koppie’s picture

Works for me too, with D7. Thanks for the tip!

Anonymous’s picture

worked on drupal 7.16. Thanks Kasper Souren, big help!

dafeder’s picture

Issue summary: View changes

I've created this drush extention to do this as a batch job on D7 - just running the php command times out on larger sites:

https://github.com/dafeder/node_access_rebuild

jduhls’s picture

Kudos @dafeder for https://github.com/dafeder/node_access_rebuild

Works great!

tapas_talukder’s picture

Drush command drush php-eval 'node_access_rebuild()'

chOP’s picture

For Drupal 8.4 this function still exists. So the Drush command method also still works:

# drush php-eval 'node_access_rebuild();'
ressa’s picture

Thanks @Tapas Talukder and @chOP, and it still works in Drupal 8.5.0.

mogtofu33’s picture

There is a Drupal console command for Drupal 8.x : drupal node:access:rebuild

drupal nar
jrockowitz’s picture

swatee_karpe’s picture

Version: 6.12 » 10.0.x-dev

Hi Guys,

I also tried below command mentioned in #8 for my 8.7.8 drupal version. but it is not working though it shows "rebuilt successfully".

do we need to do special setting in drush?

# drush php-eval 'node_access_rebuild();

I am following below steps:
- i am migrating some CSV data using migration module into the site.
- after that nodes get import and we need to rebuild the permission to get added data visible to the normal viewer.
- we have default drush is installed on server
- I am running "drush php-eval 'node_access_rebuild();' " using SSH but data not get reflect on site.
- instead i used admin panel and status page link to rebuild node permission it works well.

But here i wanted to run some script at the backend so need to add above command in script but not working.

Any clue, why is not working? Did I missing any steps here.

Please guide.
Thanks in advance.

ressa’s picture

Version: 10.0.x-dev » 8.9.x-dev

Which Drush version are you using?

swatee_karpe’s picture

Hi Ressa,

i am using Drupal 8.7.8.

swatee_karpe’s picture

Hi Ressa,

I am using drupal 8.7.8.

ressa’s picture

Not Drupal, Drush :-)

swatee_karpe’s picture

Ohh sorry,

It's Drush version : 9.7.1

ressa’s picture

You could try updating to the latest version 9.7.2 or even Drush 10? Have you tried running the command with extra verbosity, by adding -vvv?