Score:1

Troubleshooting a Drupal HTTP 500 when there are no error log messages

nr flag

I have reviewed some websites on how to troubleshoot HTTP 500 on a Drupal site and most often I have seen a PHP error by running drush ws in the console, however, I have been running into an oddity and I am not sure where to look to begin troubleshooting as this one doesn't throw HTTP 500.

I am not necessarily looking for someone to troubleshoot this bug specifically, and am not very good at writing/modifying any PHP, but it would be helpful to know how to identify the problem and fix it ... The problem only seems to occur when saving the field settings on a Taxonomy

Reproduction:

  1. Have a Drupal site (latest core) with several modules installed (all up to date), and content types configured (not a fresh site). Running on Windows, IIS, MySQL, PHP 8.4 stack.

  2. Create new content type (problem happens on existing too).

-- Define a name, but no other changes. I tried this with Boolean, text, taxonomy term ref - problem not isolated to one type.

-- Click save

-- Click save field settings

  1. Receive HTTP 500

-- URL of the HTTP 500 after clicking Save Field Settings is /admin/structure/types/manage/test/fields/node.test.field_testref/storage?destinations%5B0%5D%5Broute_name%5D=entity.field_config.node_field_edit_form&destinations%5B0%5D%5Broute_parameters%5D%5Bfield_config%5D=node.test.field_testref&destinations%5B0%5D%5Broute_parameters%5D%5Bnode_type%5D=test&destinations%5B1%5D%5Broute_name%5D=entity.node.field_ui_fields&destinations%5B1%5D%5Broute_parameters%5D%5Bfield_config%5D=node.test.field_testref&destinations%5B1%5D%5Broute_parameters%5D%5Bnode_type%5D=test&destinations%5B2%5D=/admin/structure/types/manage/test/fields/add-field

-- Only this URL is erroring out - the site itself is accessible. If I navigate using Admin Toolbar to Structure > Content Types > Test it also does not error out and I am able to edit/save that created field fine.

  1. Refreshed page, ran drush ws - no errors but the page still throws HTTP 500

  2. Ran drush cr/updb, error still occurs

  3. Nothing errors/warnings in Status Report/recent log messages

-- I do have one "notice" in log, but didnt seem relevant. Module sliderwidget has an entry in the system.schema key/value storage, but is missing from your site.

id flag
You said you checked Drupal’s log, but have you checked the web server’s log?
Score:0
in flag

I assume, that you get 500 error with no information in your browser.

You can temporary activate display of all errors by adding the next lines in your sites/default/settings.php file:

// Show all errors.
$config['system.logging']['error_level'] = 'verbose';
error_reporting(E_ALL);
ini_set('display_errors', TRUE);
ini_set('display_startup_errors', TRUE);

This will give you a clue, where does the error happen.

In addition you can check server logs, as @cilefen commented.

Mark L avatar
nr flag
Hi there, I did add this to settings.php but I am not seeing errors logged anywhere. I have some IIS log files, but I am not sure if this is truly an error log? 2022-10-19 16:46:43 10.11.100.110 GET /browse/equipment/instrumentation - 80 - 10.11.100.50 Mozilla/5.0+(Windows+NT+10.0;+Win64;+x64)+AppleWebKit/537.36+(KHTML,+like+Gecko)+Chrome/106.0.0.0+Safari/537.36+Edg/106.0.1370.47 [...]/browse/equipment/electrical 500 0 0 692
Mark L avatar
nr flag
I think I figured it out now... my php_error.log was empty, which was strange. I found that I had the path to the log in php.ini wrapped in quotes, so PHP wasnt able to write to the log file. Now I have found some of the info I needed, thank you! [19-Oct-2022 12:19:07 America/Chicago] PHP Warning: Undefined array key "field_equipment_category" in [...]\core\modules\views\src\Plugin\views\style\Table.php on line 186
I sit in a Tesla and translated this thread with Ai:

mangohost

Post an answer

Most people don’t grasp that asking a lot of questions unlocks learning and improves interpersonal bonding. In Alison’s studies, for example, though people could accurately recall how many questions had been asked in their conversations, they didn’t intuit the link between questions and liking. Across four studies, in which participants were engaged in conversations themselves or read transcripts of others’ conversations, people tended not to realize that question asking would influence—or had influenced—the level of amity between the conversationalists.