ArgumentCountError: Too few arguments to function Drupal\session_limit\Services\SessionLimit::__construct()

Created on 14 June 2024, 5 months ago

Problem/Motivation

I just upgraded this module from 2.0.0-beta3 to 2.0.1 and got WSOD with these errors:

ArgumentCountError: Too few arguments to function Drupal\session_limit\Services\SessionLimit::__construct(), 8 passed in /var/www/html/web/core/lib/Drupal/Component/DependencyInjection/Container.php on line 259 and exactly 9 expected in Drupal\session_limit\Services\SessionLimit->__construct() (line 122 of modules/contrib/session_limit/src/Services/SessionLimit.php).
Drupal\Component\DependencyInjection\Container->createService(Array, 'session_limit') (Line: 177)
Drupal\Component\DependencyInjection\Container->get('session_limit') (Line: 105)
Drupal\Component\EventDispatcher\ContainerAwareEventDispatcher->dispatch(Object, 'kernel.request') (Line: 157)
Symfony\Component\HttpKernel\HttpKernel->handleRaw(Object, 1) (Line: 76)
Symfony\Component\HttpKernel\HttpKernel->handle(Object, 1, 1) (Line: 58)
Drupal\Core\StackMiddleware\Session->handle(Object, 1, 1) (Line: 48)
Drupal\Core\StackMiddleware\KernelPreHandle->handle(Object, 1, 1) (Line: 28)
Drupal\Core\StackMiddleware\ContentLength->handle(Object, 1, 1) (Line: 32)
Drupal\big_pipe\StackMiddleware\ContentLength->handle(Object, 1, 1) (Line: 106)
Drupal\page_cache\StackMiddleware\PageCache->pass(Object, 1, 1) (Line: 85)
Drupal\page_cache\StackMiddleware\PageCache->handle(Object, 1, 1) (Line: 50)
Drupal\ban\BanMiddleware->handle(Object, 1, 1) (Line: 48)
Drupal\Core\StackMiddleware\ReverseProxyMiddleware->handle(Object, 1, 1) (Line: 51)
Drupal\Core\StackMiddleware\NegotiationMiddleware->handle(Object, 1, 1) (Line: 36)
Drupal\Core\StackMiddleware\AjaxPageState->handle(Object, 1, 1) (Line: 49)
Drupal\remove_http_headers\StackMiddleware\RemoveHttpHeadersMiddleware->handle(Object, 1, 1) (Line: 51)
Drupal\Core\StackMiddleware\StackedHttpKernel->handle(Object, 1, 1) (Line: 704)
Drupal\Core\DrupalKernel->handle(Object) (Line: 19)

I'm using D10.2.7...

๐Ÿ› Bug report
Status

Active

Version

2.0

Component

Code

Created by

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Merge Requests

Comments & Activities

  • Issue created by @monaw
  • i download grade to 2.0.0, same problem; then downgraded to 2.0.0-rc1, same problem. finally downgrade back to 2.0.0-beta3 and the WSOD and error message went away...

  • ๐Ÿ‡ฎ๐Ÿ‡ณIndia ayush.pandey

    Tried reproducing the issue on D10, but seems like everything works fine. Please provide more concise way to reproduce the issue. It seemed like a drupal's logger factory issue, but the services are well defined . Also, please mention your drupal's version and module's.

  • i'm using D10.2.7

    here's a list of non-core modules i have enabled:

    $ ddev drush pml --no-core --type=module --status=enabled 
     ----------------- --------------------------------- --------- --------------- 
      Package           Name                              Status    Version        
     ----------------- --------------------------------- --------- --------------- 
      Administration    Admin Toolbar (admin_toolbar)     Enabled   3.4.2          
      Administration    Admin Toolbar Links Access        Enabled   3.4.2          
                        Filter                                                     
                        (admin_toolbar_links_access_fil                            
                        ter)                                                       
      Administration    Admin Toolbar Search              Enabled   3.4.2          
                        (admin_toolbar_search)                                     
      Administration    Admin Toolbar Extra Tools         Enabled   3.4.2          
                        (admin_toolbar_tools)                                      
      Legal             Attribution (attribution)         Enabled   1.0.14         
      Other             Automated Logout (autologout)     Enabled   8.x-1.5        
      Spam control      CAPTCHA (captcha)                 Enabled   2.0.6          
      Check DNS         Check DNS (check_dns)             Enabled   8.x-1.4        
      Anti-virus        ClamAV Anti-Virus (clamav)        Enabled   2.0.2          
      Fields            Conditional Fields                Enabled   4.0.0-alpha5   
                        (conditional_fields)                                       
      Configuration     Configuration Read-only           Enabled   8.x-1.0        
                        (config_readonly)                                          
      Config            Config Split (config_split)       Enabled   2.0.1          
      Navigation        Easy Breadcrumb                   Enabled   2.0.7          
                        (easy_breadcrumb)                                          
      Encryption        Encrypt (encrypt)                 Enabled   8.x-3.1        
      Other             Entity (entity)                   Enabled   8.x-1.4        
      User interface    EU Cookie Compliance              Enabled   8.x-1.24       
                        (eu_cookie_compliance)                                     
      Logging           Events Log Track                  Enabled   3.1.9          
                        (event_log_track)                                          
      Logging           Events Log Track Group            Enabled   3.1.9          
                        (event_log_track_group)                                    
      Fields            Field Group (field_group)         Enabled   8.x-3.4        
      Fields            File (Field) Paths                Enabled   8.x-1.0-beta7  
                        (filefield_paths)                                          
      Logging           File Log (filelog)                Enabled   2.1.1          
      Other             Flexible permissions              Enabled   1.0.0          
                        (flexible_permissions)                                     
      Administration    Flood control (flood_control)     Enabled   2.3.4          
      Geofield          Geofield (geofield)               Enabled   8.x-1.59       
      Group             Subgroup (ggroup)                 Enabled   3.0.0-alpha6   
      Group             Group invite (ginvite)            Enabled   4.0.0-alpha3   
      Group             Group (group)                     Enabled   3.2.2          
      Group             Group Node (gnode)                Enabled   3.2.2          
      Group             Group Support: Revisions          Enabled   3.2.2          
                        (group_support_revisions)                                  
      San Diego         Group Content Default Menu        Enabled                  
      Supercomputer     (group_content_default_menu)                               
      Center (SDSC)                                                                
      Group             Group content menu                Enabled   3.0.3          
                        (group_content_menu)                                       
      San Diego         Group FolderShare                 Enabled                  
      Supercomputer     (group_foldershare)                                        
      Center (SDSC)                                                                
      Fields            Inline Entity Form                Enabled   8.x-1.0-rc17   
                        (inline_entity_form)                                       
      jQuery UI         jQuery UI (jquery_ui)             Enabled   8.x-1.6        
      jQuery UI         jQuery UI Button                  Enabled   2.0.0          
                        (jquery_ui_button)                                         
      jQuery UI         jQuery UI Checkboxradio           Enabled   2.0.0          
                        (jquery_ui_checkboxradio)                                  
      jQuery UI         jQuery UI Controlgroup            Enabled   2.0.0          
                        (jquery_ui_controlgroup)                                   
      jQuery UI         jQuery UI Menu (jquery_ui_menu)   Enabled   2.0.0          
      Other             JavaScript Cookie Library         Enabled   1.0.1          
                        (js_cookie)                                                
      Web services      JSON Web Token Authentication     Enabled   2.1.0          
                        (JWT) (jwt)                                                
      Security          Key (key)                         Enabled   8.x-1.18       
      Other             Login Security (login_security)   Enabled   2.0.1          
      Other             Masquerade (masquerade)           Enabled   8.x-2.0-rc4    
      Menu              Menu Item Extras                  Enabled   3.0.2          
                        (menu_item_extras)                                         
      Development       Menu items migration              Enabled   2.0.0-alpha3   
                        (menu_migration)                                           
      Performance and   Minify Source HTML (minifyhtml)   Enabled   2.0.5          
      scalability                                                                  
      Monitoring        Monitoring (monitoring)           Enabled   8.x-1.14       
      Security          Password Policy                   Enabled   4.0.1          
                        (password_policy)                                          
      Security          Password Blacklist Policy         Enabled   4.0.1          
                        (password_policy_blacklist)                                
      Security          Password Policy History           Enabled   4.0.1          
                        (password_policy_history)                                  
      Security          Password Character Length         Enabled   4.0.1          
                        Policy (password_policy_length)                            
      Security          Password Username Policy          Enabled   4.0.1          
                        (password_policy_username)                                 
      Security          Password Strength                 Enabled   8.x-2.0-beta3  
                        (password_strength)                                        
      Other             Pathauto (pathauto)               Enabled   8.x-1.12       
      Other             Drupal Perimeter Defence          Enabled   3.0.1          
                        (perimeter)                                                
      Other             DataCite DOIs (doi_datacite)      Enabled   1.0.0          
      Other             EZID (ARK) Persistent ID Minter   Enabled   1.0.0          
                        (ezid)                                                     
      Other             Handle (HDL) Persistent ID        Enabled   1.0.0          
                        Minter (hdl)                                               
      Other             Persistent Identifiers            Enabled   1.0.0          
                        (persistent_identifiers)                                   
      Other             Quick Node Clone                  Enabled   8.x-1.16       
                        (quick_node_clone)                                         
      Security          Real AES (real_aes)               Enabled   8.x-2.5        
      Spam control      reCAPTCHA (recaptcha)             Enabled   8.x-3.2        
      Security          Remove HTTP Headers               Enabled   2.1.0          
                        (remove_http_headers)                                      
      Security          Security Kit (seckit)             Enabled   2.0.1          
      Security          Security Review                   Enabled   2.0.2          
                        (security_review)                                          
      Other             Session Limit (session_limit)     Enabled   2.0.0-beta3    
      User interface    Simplify (simplify)               Enabled   2.1.0          
      Security          Sodium (sodium)                   Enabled   8.x-2.4        
      Other             Storage Entities (storage)        Enabled   1.3.1          
      Security          Two-factor Authentication (TFA)   Enabled   8.x-1.7        
                        (tfa)                                                      
      Other             Token (token)                     Enabled   8.x-1.14       
      Other             Username Enumeration Prevention   Enabled   8.x-1.3        
                        (username_enumeration_preventio                            
                        n)                                                         
      Other             VariationCache (variationcache)   Enabled   8.x-1.5        
      Webform           Webform UI (webform_ui)           Enabled   6.2.2          
      Webform           Webform (webform)                 Enabled   6.2.2          
      Other             X-Originating-IP                  Enabled   2.0.0          
                        (x_originating_ip)                                         
      general           Author Field (author_field)       Enabled                  
      general           Citation Reference Field          Enabled                  
                        (citeref_field)                                            
      San Diego         FolderShare (foldershare)         Enabled   8.x-1.7        
      Supercomputer                                                                
      Center (SDSC)                                                                
      general           Funder Field (funder_field)       Enabled                  
      Custom            Persistent Identifiers Field      Enabled                  
                        Set Module (pid_field_set)                                 
      Tapis             TAPIS Apps (tapis_app)            Enabled   1.4.0          
      Tapis             Tapis App Webform                 Enabled   1.4.0          
                        (tapis_app_webform)                                        
      Tapis             TAPIS Auth (tapis_auth)           Enabled   1.4.0          
      Tapis             TAPIS Jobs (tapis_job)            Enabled   1.4.0          
      Tapis             TAPIS Systems (tapis_system)      Enabled   1.4.0          
      Tapis             TAPIS Tenant (tapis_tenant)       Enabled   1.4.0          
     ----------------- --------------------------------- --------- --------------- 

    and a list of core modules i have enabled:
    $ ddev drush pml --core --type=module --status=enabled

     -------------- ----------------------------------------- --------- --------- 
      Package        Name                                      Status    Version  
     -------------- ----------------------------------------- --------- --------- 
      Core           Ban (ban)                                 Enabled   10.2.7   
      Core           BigPipe (big_pipe)                        Enabled   10.2.7   
      Core           Block (block)                             Enabled   10.2.7   
      Core           Block Content (block_content)             Enabled   10.2.7   
      Core           Breakpoint (breakpoint)                   Enabled   10.2.7   
      Core           CKEditor 5 (ckeditor5)                    Enabled   10.2.7   
      Core           Comment (comment)                         Enabled   10.2.7   
      Core           Configuration Manager (config)            Enabled   10.2.7   
      Core           Contact (contact)                         Enabled   10.2.7   
      Core           Content Moderation (content_moderation)   Enabled   10.2.7   
      Core           Contextual Links (contextual)             Enabled   10.2.7   
      Field types    Datetime (datetime)                       Enabled   10.2.7   
      Core           Database Logging (dblog)                  Enabled   10.2.7   
      Core           Internal Dynamic Page Cache               Enabled   10.2.7   
                     (dynamic_page_cache)                                         
      Core           Text Editor (editor)                      Enabled   10.2.7   
      Core           Field (field)                             Enabled   10.2.7   
      Core           Field UI (field_ui)                       Enabled   10.2.7   
      Field types    File (file)                               Enabled   10.2.7   
      Core           Filter (filter)                           Enabled   10.2.7   
      Core           Forum (forum)                             Enabled   10.2.7   
      Core           Help (help)                               Enabled   10.2.7   
      Core           History (history)                         Enabled   10.2.7   
      Field types    Image (image)                             Enabled   10.2.7   
      Multilingual   Language (language)                       Enabled   10.2.7   
      Field types    Link (link)                               Enabled   10.2.7   
      Core           Media (media)                             Enabled   10.2.7   
      Core           Media Library (media_library)             Enabled   10.2.7   
      Core           Custom Menu Links (menu_link_content)     Enabled   10.2.7   
      Core           Menu UI (menu_ui)                         Enabled   10.2.7   
      Core           MySQL (mysql)                             Enabled   10.2.7   
      Core           Node (node)                               Enabled   10.2.7   
      Field types    Options (options)                         Enabled   10.2.7   
      Core           Internal Page Cache (page_cache)          Enabled   10.2.7   
      Core           Path (path)                               Enabled   10.2.7   
      Core           Path alias (path_alias)                   Enabled   10.2.7   
      Core           Search (search)                           Enabled   10.2.7   
      Core           Shortcut (shortcut)                       Enabled   10.2.7   
      Core           System (system)                           Enabled   10.2.7   
      Core           Taxonomy (taxonomy)                       Enabled   10.2.7   
      Field types    Text (text)                               Enabled   10.2.7   
      Core           Toolbar (toolbar)                         Enabled   10.2.7   
      Core           Tour (tour)                               Enabled   10.2.7   
      Core           Update Manager (update)                   Enabled   10.2.7   
      Core           User (user)                               Enabled   10.2.7   
      Core           Views (views)                             Enabled   10.2.7   
      Core           Views UI (views_ui)                       Enabled   10.2.7   
      Core           Workflows (workflows)                     Enabled   10.2.7   
     -------------- ----------------------------------------- --------- --------- 
  • Assigned to sourav_paul
  • ๐Ÿ‡ฎ๐Ÿ‡ณIndia sourav_paul Kolkata
  • Pipeline finished with Failed
    2 months ago
    Total: 124s
    #281895
  • ๐Ÿ‡ฎ๐Ÿ‡ณIndia sourav_paul Kolkata

    I've tested session_limit 2.0.1 on D10.3 & it's working fine but when I tested it on D11.0.1 it threw fatal error with WSOD on the settings form page (admin/config/people/session-limit).

    I've fixed the issue..

    Please review...

    Attaching SS for reference:

    Before:

    After:

  • Issue was unassigned.
  • Status changed to Needs review 2 months ago
  • ๐Ÿ‡ฎ๐Ÿ‡ณIndia sourav_paul Kolkata
  • ๐Ÿ‡ฎ๐Ÿ‡ณIndia Raveen Kumar

    raveen_thakur51 โ†’ made their first commit to this issueโ€™s fork.

  • Pipeline finished with Success
    2 months ago
    Total: 126s
    #281973
  • ๐Ÿ‡ฎ๐Ÿ‡ณIndia Pemson18 Goa

    Note : The correct arguments passed in the services.yml in the custom or contrib module to the session limit should be 9 if you have a custom services decorator...

        arguments: ['@database', '@event_dispatcher', '@current_route_match', '@current_user', '@session_manager', '@module_handler', '@config.factory', '@messenger', '@logger.factory']
    
  • Status changed to RTBC about 13 hours ago
  • gaurav gupta Jaipur, Rajasthsan

    Hello i have tested the MR and the issue has been solved.
    Thanks.

Production build 0.71.5 2024