6

I new to drupal and am facing an issue whereas any theme that I try to install will fail with the following message:

Installing light_skeleton
An error has occurred.
Please continue to the error page

An AJAX HTTP error occurred.
HTTP Result Code: 403
Debugging information follows.
Path: /core/authorize.php/core/authorize.php?batch=1&id=4&op=do_nojs&op=do
StatusText: Forbidden
ResponseText: 
403 Forbidden
403 Forbidden
nginx/1.9.10

The root folder is owned by www-data:www-data and I have given 775 permissions. I have also tried to give it a full access with 777 but without success. I have checked the logs of nginx and php but there are no errors displayed. The site itself with the standard theme works without any issues.

After getting the error I get:

Notice: Undefined index: log in update_authorize_install_batch_finished() (line 291 of core/modules/update/update.authorize.inc).
Warning: Invalid argument supplied for foreach() in update_authorize_install_batch_finished() (line 291 of core/modules/update/update.authorize.inc).
Notice: Undefined index: log in update_authorize_install_batch_finished() (line 332 of core/modules/update/update.authorize.inc).
Notice: Undefined index: tasks in update_authorize_install_batch_finished() (line 333 of core/modules/update/update.authorize.inc).
Installation failed! See the log below for more information.
  • I get you are trying to upload a theme from the site. – kiamlaluno Feb 21 '16 at 8:31
  • Yes. Choosing the downloaded theme, and clicking install new theme, and selecting the file – Fabrizio Mazzoni Feb 21 '16 at 8:35
  • I have the same problem with modules. Check admin/reports/dblog and see if you get errors about ini_set() being disabled. Maybe that is the problem. – kiamlaluno Feb 21 '16 at 8:41
  • Didn't find any ref to ini_set() – Fabrizio Mazzoni Feb 21 '16 at 9:01
13

This is an nginx configuration issue and discussed intensely on this page Yet curiously no solid solution could be offered. Some guy on an other page proposed a solution. I applied that proposed solution and can confirm that in works!

To apply proposed solution go to your nginx configuration file under

/etc/nginx/sites-available/ directory on Ubuntu and add

rewrite ^/core/authorize.php/core/authorize.php(.*)$ /core/authorize.php$1;

just above the

location ~ \..*/.*\.php$ {
    return 403;
}

block. Location does matter!.. Restart your server:

sudo service nginx restart

and that's it. The problem solved!

  • 1
    That works! It's a shame that Drupal 8 seems needs that workaround with nginx! – Alexei Rayu May 28 '17 at 13:23
0

Since you are getting a 403, it seems that Drupal is not giving you access for some reason. I haven't had any practical experience with this, but looking in the autorize.php file I found this:

function authorize_access_allowed(Request $request) {
  $account = \Drupal::service('authentication')->authenticate($request);
  if ($account) {
    \Drupal::currentUser()->setAccount($account);
  }
  return Settings::get('allow_authorize_operations', TRUE) && \Drupal::currentUser()->hasPermission('administer software updates');
}

It seems that you could get access denied if:

  • You don't have administer software updates permission
  • allow_authorize_operations is set to false. This would exist in your settings.php file AS $settings['allow_authorize_operations'] = FALSE;

Best guess is that it's the latter that might be your problem.

  • Tried both solutions but with no luck. I am the admin of the site as I have it on my own vps. – Fabrizio Mazzoni Feb 21 '16 at 9:02
-2

I have similar error, any solution?
update i just finally fixed it just add this: rewrite ^/core/authorize.php/core/authorize.php(.*)$ /core/authorize.php$1; to my server{} block of my nginx conf

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.