On a newly installed drupal instance, I cannot place blocks.
Server : Lighttpd/ Kubuntu 17.10 server, Drupal 8.4.4, no content added (this is a new installation installed especially to investigate the problem which had occurred on another site)

At: admin/structure/block - Header -> Place block --> times out --> then the browser console shows message below
There are no log messages, no server error messages
Suspect it could be due to lighttpd. Increased PHP timeout etc., with no effect

In console:

Drupal.AjaxError {message: "↵An AJAX HTTP error occurred.↵HTTP Result Code: 20…10be6325a45766c8abfe9f6eeb85e5648e3bfd507eb58"}}↵", name: "AjaxError"}
message
:
"↵An AJAX HTTP error occurred.↵HTTP Result Code: 200↵Debugging information follows.↵Path: /admin/structure/block/library/bartik?region=header↵StatusText: OK↵ResponseText: ↵Place block | admin↵Skip to main content↵Toolbar items↵Back to site↵Manage↵Administration menuContentStructureAppearanceExtendConfigurationPeopleReportsHelp ↵Shortcuts↵User-defined shortcutsAdd contentAll contentEdit shortcuts ↵Edit↵Tour↵admin↵User account actionsView profileEdit profileLog out ↵Place block↵Add to Default shortcuts↵Breadcrumb↵Home↵Administration↵Structure↵Block layout↵Add custom block↵Filter↵Block↵Category↵Operations↵Page title↵core↵Place block↵Primary admin actions↵core↵Place block↵Tabs↵core↵Place block↵Search form↵Forms↵Place block↵User login↵Forms↵Place block↵Help↵Help↵Place block↵Recent comments↵Lists (Views)↵Place block↵Recent content↵Lists (Views)↵Place block↵Who's online↵Lists (Views)↵Place block↵Administration↵Menus↵Place block↵Footer↵Menus↵Place block↵Main navigation↵Menus↵Place block↵Shortcuts↵Menus↵Place block↵Tools↵Menus↵Place block↵User account menu↵Menus↵Place block↵Breadcrumbs↵System↵Place block↵Main page content↵System↵Place block↵Messages↵System↵Place block↵Powered by Drupal↵System↵Place block↵Site branding↵System↵Place block↵Syndicate↵System↵Place block↵Who's new↵User↵Place block↵{"ajaxPageState":{"theme":"seven","theme_token":"owMjX-41_Pcx... removed ... KjyZ5xKq0gw","libraries":"block\/drupal.block,block\/drupal.block.admin,block\/drupal.block.admin,classy\/base,classy\/base,classy\/messages,classy\/messages,contextual\/drupal.contextual-links,contextual\/drupal.contextual-links,contextual\/drupal.contextual-toolbar,contextual\/drupal.contextual-toolbar,core\/drupal.active-link,core\/drupal.active-link,core\/drupal.dropbutton,core\/drupal.dropbutton,core\/drupal.tabledrag,core\/drupal.tableheader,core\/drupal.tableresponsive,core\/drupal.tableresponsive,core\/html5shiv,core\/html5shiv,core\/normalize,core\/normalize,seven\/drupal.nav-tabs,seven\/global-styling,seven\/global-styling,shortcut\/drupal.shortcut,shortcut\/drupal.shortcut,toolbar\/toolbar,toolbar\/toolbar,toolbar\/toolbar.escapeAdmin,toolbar\/toolbar.escapeAdmin,tour\/tour,tour\/tour,user\/drupal.user.icons,user\/drupal.user.icons"},"toolbar":{"breakpoints":{"toolbar.narrow":"only screen and (min-width: 16.5em)","toolbar.standard":"only screen and (min-width: 38.125em)","toolbar.wide":"only screen and (min-width: 61em)"},"subtreesHash":"q5SbYHg6y4...removed.... K47EstXN08M"},"path":{"baseUrl":"\/","pathPrefix":"","currentPath":"admin\/structure\/block\/library\/bartik","currentPathIsAdmin":true,"isFront":false,"currentLanguage":"en","currentQuery":{"error":"404"}},"pluralDelimiter":"\u0003","user":{"uid":"1","permissionsHash":"744e0258b..removed.3bfd507eb58"}}↵"
name
:
"AjaxError"
__proto__
:
Error at https://www.drupalservertest.com/sites/default/files/js/js_5YKInKTXfkhKH... at https://www.drupalservertest.com/sites/default/files/js/js_5YKInKTXfkhKH...
constructor
:
ƒ (xmlhttp, uri, customMessage)
stack
:
"Error↵ at https://www.drupalservertest.com/sites/default/files/js/js_5YKInKTXfkhKH...↵ at https://www.drupalservertest.com/sites/default/files/js/js_5YKInKTXfkhKH..."
__proto__

Comments

DropInTheOcean created an issue. See original summary.

cilefen’s picture

Component: ajax system » block_place.module
Status: Active » Postponed (maintainer needs more info)

When you get Ajax errors you must read the server logs.

DropInTheOcean’s picture

Thanks - I did not see any error message either in the lighttpd error log, nor Drupal/recent log messages.

For now I have switched to using Apache2. The Place block button works, (same installation)

cilefen’s picture

Issue tags: -Ajax Blocks Admin +lighttpd
DropInTheOcean’s picture

On further investigation, I adjusted the server settings for the Drupal site in etc/lighttpd/lighttpd.conf, according to the following article:

https://www.cyberciti.biz/tips/lighttpd-drupal-htacess-seo-clean-urls.html
[Note the article is dated 2008; and there are further discussions below the article]

Previously I only had the following rewrite rule in lighttpd.conf -- for clean-urls:
server.error-handler-404 = "/index.php?error=404"

Adding the following rule solved the problem with placing blocks :
url.rewrite-final = (
"^/([^.?]*)\?(.*)$" => "/index.php?q=$1&$2",
)

Presumably the other rules were/ are still relevant:

url.rewrite-final = (
"^/system/test/(.*)$" => "/index.php?q=system/test/$1",
"^/system/test-clean-url/(.*)$" => "/index.php?q=system/test-clean-url/$1",
"/rss.xml$" => "/index.php?q=rss.xml",
"^/search/(.*)$" => "/index.php?q=search/$1",
"^/([^.?]*)\?(.*)$" => "/index.php?q=$1&$2",
"^/([^.?]*)$" => "/index.php?q=$1",
}
# Error 404
server.error-handler-404 = "/index.php"

# stop these
url.access-deny = ( "~", ".inc", ".engine", ".install", ".module", ".sh", "sql", ".theme", ".tpl.php", ".xtmpl", "Entries", "Repository", "Root" )

Maybe there is more recent documentation on best-practice Lighttpd server configuration for Drupal 8?

cilefen’s picture

Status: Postponed (maintainer needs more info) » Fixed

You are the subject matter expert at this moment. Edit or suggest on https://www.drupal.org/docs/8/system-requirements/web-server.

Status: Fixed » Closed (fixed)

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