You have requested a non-existent service "security.acl.dbal.connection"
Asked Answered
I

3

8

when I run init:acl in symfony2.0 I got this error, anyone knows how to fix it!

You have requested a non-existent service "security.acl.dbal.connection"
Impetrate answered 30/7, 2011 at 9:11 Comment(0)
J
18

You need to enable ACL support in your application. Add this line to your security.yml configuration file:

acl:
    connection: default

Then run php app/console init:acl again.

Jacquard answered 30/7, 2011 at 16:41 Comment(0)
B
2

Just to give heads up that, acl keywords should be placed on lines following the security keyword. If you ONLY put

acl:
  connection: default 

In the top of your security.yml file, you may get this error. I am quoting it so that people can come to this thread by googling the error.

  [Symfony\Component\Config\Exception\FileLoaderLoadException]         
  Cannot import resource "/home/jupiter/symfony/cupon/app/config/secu  
  rity.yml" from "/home/jupiter/symfony/cupon/app/config/config.yml".  
  (There is no extension able to load the configuration for "acl" 
  (in /home/jupiter/symfony/cupon/app/config/security.yml). Looked for   
  namespace "acl", found "framework", "security", "twig", "monolog",   
  "swiftmailer", "assetic", "doctrine", "sensio_framework_extra", "ci  
  udad", "usuario", "tienda", "oferta", "backend", "ideup_simple_pagi  
  nator", "web_profiler", "sensio_distribution")    


  [Symfony\Component\DependencyInjection\Exception\InvalidArgumentException]  
  There is no extension able to load the configuration for "acl" (in          
  /home/jupiter/symfony/cupon/app/config/security.yml). Looked for na         
  mespace "acl", found "framework", "security", "twig", "monolog", "s         
  wiftmailer", "assetic", "doctrine", "sensio_framework_extra", "ciud         
  ad", "usuario", "tienda", "oferta", "backend", "ideup_simple_pagina         
  tor", "web_profiler", "sensio_distribution"       

So just make sure acl is after security keyword:

security:
    acl:
        connection: default
Bcd answered 20/4, 2014 at 11:36 Comment(2)
In ArrayNode.php line 331: Unrecognized option "acl" under "security". Available options are "access_control", "access_decision_manager", "access_denied_url", "always_authenticate_before_gran ting", "encoders", "erase_credentials", "firewalls", "hide_user_not_found", "providers", "role_hierarchy", "session_fixation_strategy".Oliviaolivie
@YusufIbrahim looks like acl is not built-in anymore as of Symfony 4. Documentation for acl says: ACL support was removed in Symfony 4.0. Install the Symfony ACL bundle and refer to its documentation if you want to keep using ACL.Bcd
M
0

Neither worked for me. This service is actually not available...

Mastitis answered 24/7, 2013 at 19:31 Comment(1)
working or not, if you just update schema using... "php app/console do:sch:upd --force", FW will update you database with ACL tables, and problem solved :)Mastitis

© 2022 - 2024 — McMap. All rights reserved.