Debug School

rakesh kumar
rakesh kumar

Posted on

Drupal error:The website encountered an unexpected error. Please try again later

Problem
The website encountered an unexpected error. Please try again later
Solution
in setting.php inside site folder

$settings['config_sync_directory'] = 'sites/default/files/config_SZzI1SjN4gkGdHShuJy26JCmMWdebgRJo7a9fCwjyM9hk4T0vP8dTcFJ_3HGKq6HkrrsAZrJSg/sync';
$config['system.logging']['error_level'] = 'verbose';
Enter fullscreen mode Exit fullscreen mode

now u will get exact error in drupal

The website encountered an unexpected error. Please try again later.


Drupal\Component\Serialization\Exception\InvalidDataTypeException: C:\xampp\htdocs\my_drupal9/modules/custom/my_module/my_module.routing.yml: Duplicate key "my_module.list_nodestable" detected at line 25 (near " _permission: 'access content' "). in Drupal\Core\Discovery\YamlDiscovery->decode() (line 24 of core\lib\Drupal\Core\Discovery\YamlDiscovery.php).
Symfony\Component\Yaml\Parser->parse('my_module.list_nodes:
  path: '/my_module/list-nodes'
  defaults:
    _controller: '\Drupal\my_module\Controller\NodeListController::listNodes'
    _title: 'List Nodes'
  requirements:
    _permission: 'access content'

my_module.list_nodeslist:
  path: '/my_module/list-nodeslist'
Enter fullscreen mode Exit fullscreen mode

Top comments (0)