When my profiler installation profile completes, the success screen shows the following error:

You do not have permission to unblock placeholder-for-uid-1.

This doesn't appear to cause any problems on a manual installation - however when installed through Aegir it causes Aegir to report that the site creation on this platform failed.

Commenting out the creation of user 1 in the .info file didn't solve the problem, it just displayed the screen to create the admin user - but then still showed this error on the success screen.

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

steveparks’s picture

The issue appears to be caused by something in this (in profiler_api.inc), which is the last function to be called by profiler before completing...

206	function profiler_install_configure($config) {
207	  if ($array = profiler_config_load_superuser($config)) {
208	    // We need to mimic being user 1 in order to bypass administeruserbyrole.
209	    global $user;
210	    $user->uid = 1;
211	
212	    // Save user 1
213	    profiler_install_users(array($array));
214	    user_authenticate($array);
215	
216	    // The user is now logged in, but has no session ID yet, which
217	    // would be required later in the request, so remember it.
218	    $user->sid = session_id();
219	
220	    // Force clean URLs... (why?)
221	    variable_set('clean_url', TRUE);
222	
223	    // Record when this install ran.
224	    variable_set('install_time', time());
225	  }
226	}

googling has brought up nothing about the error message mentioned above. Has anyone else had this same message?

q0rban’s picture

Hey Steve! Sorry for the delay in responding.. :)

A few questions:

- What version of Aegir are you running?
- Are you creating any users in your profile's .info file?
- If so, have you tried commenting them out?
- If not have you tried adding an entry for user 1

steveparks’s picture

Hi q0rban,

No problem, and no rush - any help is appreciated. I tried to figure it out on my own, but couldn't quite get there :)

I'm running:
+ aegir version 4.0-alpha13 on one server and alpha14 on the other - both get the same problem
+ profiler 2.0-beta1

The install profile I'm building, and that I get this problem with can be built using this stub makefile:
drush make http://github.com/pilotinternet/jumpjet/raw/master/jumpjet_build_core.make jumpjet

However it's not just in the interaction with aegir that this error occurs - that error message is generated during a manual install too, it's just that the presence of an error (even though the site and DB are all installed fine) stops aegir in its tracks. It may also confuse other users that I plan to release the distribution to.

I have tried not creating users in the profile's .info, and I've tried creating them - the same error is created regardless.

Thanks for profiler - am finding it very powerful and simple.

cheers
Steve

Riaan Burger’s picture

Having the same problem here.

I also just now noticed that when this error occurs, I'm not logged in once the install completes.

Disabled some modules in the profile and wittled things down to the administerusersbyrole module.

An earlier search through all files for the string "You do not have permission to unblock" didn't reveal anything. But now I see line 117 of the module is:

drupal_set_message(t('You do not have permission to !action %user.'...;

A few drupal_set_message lines and the error fires because of line 62:

  // allow only uid1 to edit uid1
  if ($account->uid == 1) {
    return FALSE;
  }

Where, of course, $account=>uid is equal to 1.

That's about where I ran out of time to check this out, but maybe it helps.

My quick workaround was to remove the module from the _profile_modules() function in my profile and add then add it later in the profile as follows with pilfered code from the /modules/system/system.admin.inc file:

  drupal_install_modules(array('administerusersbyrole'));
  drupal_rebuild_theme_registry();
  node_types_rebuild();
  menu_rebuild();
  cache_clear_all('schema', 'cache');
  drupal_clear_css_cache();
  drupal_clear_js_cache();

This doesn't give an error and installs fine.

q0rban’s picture

Ah yes, I before had some custom code in here to account for the administerusersbyrole module, but I've since removed it since I'm not happy with the way that module implements it's functionality. Steve, are you using that module as well? If so, I think we need to move this issue to administerusersbyrole, as it really is a bug in that module's implementation.

steveparks’s picture

Title: Install warning prevents Aegir install » Install warning when Administer Users by Role is activated by an installation profile
Project: Profiler » Administer Users by Role
Version: 6.x-2.0-beta1 » 6.x-1.4

aha - yes. I'm using administerusersbyrole too.

Nice work Riaan.

I've moved it between issue queues, and changed the title - but q0rban - perhaps you'd explain to the administerusersbyrole maintainer what workaround you'd previously implemented?

q0rban’s picture

If I remember correctly, I was tricking the install profile into thinking that user 1 was logged in while user 1 was being unblocked. See line 383 of the old profiler include:

http://drupalcode.org/viewvc/drupal/contributions/modules/profiler/profi...

dkingofpa’s picture

Sub

mrfelton’s picture

Same issue here for me. Aegir 1.9, and have the the administerusersbyrole module enabled as part of a dependency from a feature that gets enabled as part of the install profile. Aegir will not complete the site spin up because of the error.

mrfelton’s picture

Status: Active » Needs review
FileSize
611 bytes

Here is a path against the D7 version in @axel.rutz's sandbox (http://drupal.org/sandbox/axel.rutz/1350924) form #908424: Drupal 7 port of Administer Users by Role. I suspect it will apply cleanly to the D6 version.

Status: Needs review » Needs work

The last submitted patch, 923882-administerusersbyrole-install-issue-D7.patch, failed testing.

mrfelton’s picture

Version: 6.x-1.4 » 7.x-1.x-dev

Bumping this to 7.x-1.x. Lets get it fixed there first, and then look at backporting.

mrfelton’s picture

mrfelton’s picture

Status: Needs work » Fixed

Fixed for D7 here, and D6 here.

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.