Fatal - no app in context - Error Call to undefined method

Nextcloud version: 28.0.1
Operating system and version: Ubuntu 14.10
Apache or nginx version: Apache 2.4.52
PHP version: 8.1.2 (fpm)

The issue you are facing:

The error log is flooded with

Fatal | no app in context | Error Call to undefined method OC\Server::getEventDispatcher()

Is this the first time you’ve seen this error?: Y

Steps to replicate it: it just repeats evert few seconds

The output of your Nextcloud log in Admin > Logging:

Fatal	no app in context	
Error Call to undefined method OC\Server::getEventDispatcher()
Could not boot metadata: Call to undefined method OC\Server::getEventDispatcher()
24 Jan 2024, 08:49:37 	
Fatal	no app in context	
Error Call to undefined method OC\Server::getEventDispatcher()
Could not boot metadata: Call to undefined method OC\Server::getEventDispatcher()
24 Jan 2024, 08:49:33 	
Fatal	no app in context	
Error Call to undefined method OC\Server::getEventDispatcher()
Could not boot metadata: Call to undefined method OC\Server::getEventDispatcher()
24 Jan 2024, 08:49:26 	
Fatal	no app in context	
Error Call to undefined method OC\Server::getEventDispatcher()
Could not boot metadata: Call to undefined method OC\Server::getEventDispatcher()
24 Jan 2024, 08:49:16 

The output of your config.php file in /path/to/nextcloud (make sure you remove any identifiable information!):

<?php
$CONFIG = array (
  'instanceid' => '###',
  'passwordsalt' => '###',
  'secret' => '###',
  'trusted_domains' => 
  array (
    0 => '192.168.###.###',
    1 => '###',
  ),
  'overwrite.cli.url' => 'https://###',
  'datadirectory' => '/###',
  'dbtype' => 'pgsql',
  'version' => '28.0.1.1',
  'dbname' => '###',
  'dbhost' => '###',
  'dbport' => '',
  'dbtableprefix' => 'oc_',
  'dbuser' => '###',
  'dbpassword' => ###',
  'installed' => true,
  'twofactor_enforced' => 'false',
  'twofactor_enforced_groups' => 
  array (
  ),
  'twofactor_enforced_excluded_groups' => 
  array (
  ),
  'htaccess.RewriteBase' => '/',
  'default_language' => 'en',
  'default_locale' => 'en_gb',
  'skeletondirectory' => '',
  'trashbin_retention_obligation' => 'auto, 365',
  'versions_retention_obligation' => 'auto',
  'filelocking.enabled' => true,
  'memcache.locking' => '\\OC\\Memcache\\Redis',
  'memcache.local' => '\\OC\\Memcache\\Redis',
  'memcache.distributed' => '\\OC\\Memcache\\Redis',
  'redis' => 
  array (
    'host' => '127.0.0.1',
    'port' => 6379,
  ),
  'maintenance' => false,
  'mail_smtpmode' => 'sendmail',
  'mail_sendmailmode' => 'smtp',
  'mail_from_address' => '###',
  'mail_domain' => '###',
  'mail_smtpauthtype' => 'LOGIN',
  'mail_smtpauth' => 1,
  'mail_smtphost' => '###',
  'mail_smtpport' => '465',
  'mail_smtpname' => '###',
  'mail_smtppassword' => '###',
  'enable_previews' => true,
  'preview_max_x' => 2048,
  'preview_max_y' => 2048,
  'preview_max_scale_factor' => 10,
  'enabledPreviewProviders' => 
  array (
    0 => 'OC\\Preview\\PNG',
    1 => 'OC\\Preview\\JPEG',
    2 => 'OC\\Preview\\GIF',
    3 => 'OC\\Preview\\HEIC',
    4 => 'OC\\Preview\\BMP',
    5 => 'OC\\Preview\\XBitmap',
    6 => 'OC\\Preview\\MP3',
    7 => 'OC\\Preview\\TXT',
    8 => 'OC\\Preview\\MarkDown',
    9 => 'OC\\Preview\\Movie',
    10 => 'OC\\Preview\\OpenDocument',
    11 => 'OC\\Preview\\PDF',
    12 => 'OC\\Preview\\SVG',
  ),
  'theme' => '',
  'loglevel' => 0,
  'app_install_overwrite' => 
  array (
    0 => 'tasks',
    1 => 'camerarawpreviews',
    2 => 'checksum',
    3 => 'files_retention',
    4 => 'documentserver_community',
    5 => 'calendar',
    6 => 'metadata',
    7 => 'previewgenerator',
    8 => 'twofactor_nextcloud_notification',
    9 => 'richdocumentscode',
  ),
  'onlyoffice' => 
  array (
    'verify_peer_off' => true,
  ),
  'default_phone_region' => 'GB',
  'mail_smtpsecure' => 'ssl',
);

The output of your Apache/nginx/system log in /var/log/____:
No errors in errors.log nor in access.log

Output errors in nextcloud.log in /var/www/ or as admin user in top right menu, filtering for errors. Use a pastebin service if necessary.

{"reqId":"GBulbmcomVbaGlUwpxko","level":4,"time":"2024-01-12T21:03:28+00:00","remoteAddr":"###.###.###.###","user":"###","app":"no app in context","method":"GET","url":"/ocs/v2.php/apps/user_status/api/v1/user_status?format=json","message":"Could not boot files_retention: Call to undefined method OC\\Server::getEventDispatcher()","userAgent":"Mozilla/5.0 (Windows) mirall/3.11.0stable-Win64 (build 20231211) (Nextcloud, windows-10.0.19045 ClientArchitecture: x86_64 OsArchitecture: x86_64)","version":"28.0.1.1","exception":{"Exception":"Error","Message":"Call to undefined method OC\\Server::getEventDispatcher()","Code":0,"Trace":[{"file":"/var/www/nextcloud/lib/private/AppFramework/Bootstrap/Coordinator.php","line":200,"function":"boot","class":"OCA\\Files_Retention\\AppInfo\\Application","type":"->"},{"file":"/var/www/nextcloud/lib/private/App/AppManager.php","line":434,"function":"bootApp","class":"OC\\AppFramework\\Bootstrap\\Coordinator","type":"->"},{"file":"/var/www/nextcloud/lib/private/App/AppManager.php","line":213,"function":"loadApp","class":"OC\\App\\AppManager","type":"->"},{"file":"/var/www/nextcloud/lib/private/legacy/OC_App.php","line":125,"function":"loadApps","class":"OC\\App\\AppManager","type":"->"},{"file":"/var/www/nextcloud/ocs/v1.php","line":59,"function":"loadApps","class":"OC_App","type":"::"},{"file":"/var/www/nextcloud/ocs/v2.php","line":23,"args":["/var/www/nextcloud/ocs/v1.php"],"function":"require_once"}],"File":"/var/www/nextcloud/apps/files_retention/lib/AppInfo/Application.php","Line":58,"message":"Could not boot files_retention: Call to undefined method OC\\Server::getEventDispatcher()","exception":{},"CustomMessage":"Could not boot files_retention: Call to undefined method OC\\Server::getEventDispatcher()"}}
{"reqId":"GBulbmcomVbaGlUwpxko","level":4,"time":"2024-01-12T21:03:28+00:00","remoteAddr":"###.###.###.###","user":"###","app":"no app in context","method":"GET","url":"/ocs/v2.php/apps/user_status/api/v1/user_status?format=json","message":"Could not boot metadata: Call to undefined method OC\\Server::getEventDispatcher()","userAgent":"Mozilla/5.0 (Windows) mirall/3.11.0stable-Win64 (build 20231211) (Nextcloud, windows-10.0.19045 ClientArchitecture: x86_64 OsArchitecture: x86_64)","version":"28.0.1.1","exception":{"Exception":"Error","Message":"Call to undefined method OC\\Server::getEventDispatcher()","Code":0,"Trace":[{"file":"/var/www/nextcloud/lib/private/AppFramework/Bootstrap/Coordinator.php","line":200,"function":"boot","class":"OCA\\Metadata\\AppInfo\\Application","type":"->"},{"file":"/var/www/nextcloud/lib/private/App/AppManager.php","line":434,"function":"bootApp","class":"OC\\AppFramework\\Bootstrap\\Coordinator","type":"->"},{"file":"/var/www/nextcloud/lib/private/App/AppManager.php","line":213,"function":"loadApp","class":"OC\\App\\AppManager","type":"->"},{"file":"/var/www/nextcloud/lib/private/legacy/OC_App.php","line":125,"function":"loadApps","class":"OC\\App\\AppManager","type":"->"},{"file":"/var/www/nextcloud/ocs/v1.php","line":59,"function":"loadApps","class":"OC_App","type":"::"},{"file":"/var/www/nextcloud/ocs/v2.php","line":23,"args":["/var/www/nextcloud/ocs/v1.php"],"function":"require_once"}],"File":"/var/www/nextcloud/apps/metadata/lib/AppInfo/Application.php","Line":28,"message":"Could not boot metadata: Call to undefined method OC\\Server::getEventDispatcher()","exception":{},"CustomMessage":"Could not boot metadata: Call to undefined method OC\\Server::getEventDispatcher()"}}
{"reqId":"DLCcBT19cKeBUu1RxoPL","level":4,"time":"2024-01-12T21:03:28+00:00","remoteAddr":"###.###.###.###","user":"###","app":"no app in context","method":"GET","url":"/ocs/v2.php/apps/notifications/api/v2/notifications?format=json","message":"Could not boot files_retention: Call to undefined method OC\\Server::getEventDispatcher()","userAgent":"Mozilla/5.0 (Windows) mirall/3.11.0stable-Win64 (build 20231211) (Nextcloud, windows-10.0.19045 ClientArchitecture: x86_64 OsArchitecture: x86_64)","version":"28.0.1.1","exception":{"Exception":"Error","Message":"Call to undefined method OC\\Server::getEventDispatcher()","Code":0,"Trace":[{"file":"/var/www/nextcloud/lib/private/AppFramework/Bootstrap/Coordinator.php","line":200,"function":"boot","class":"OCA\\Files_Retention\\AppInfo\\Application","type":"->"},{"file":"/var/www/nextcloud/lib/private/App/AppManager.php","line":434,"function":"bootApp","class":"OC\\AppFramework\\Bootstrap\\Coordinator","type":"->"},{"file":"/var/www/nextcloud/lib/private/App/AppManager.php","line":213,"function":"loadApp","class":"OC\\App\\AppManager","type":"->"},{"file":"/var/www/nextcloud/lib/private/legacy/OC_App.php","line":125,"function":"loadApps","class":"OC\\App\\AppManager","type":"->"},{"file":"/var/www/nextcloud/ocs/v1.php","line":59,"function":"loadApps","class":"OC_App","type":"::"},{"file":"/var/www/nextcloud/ocs/v2.php","line":23,"args":["/var/www/nextcloud/ocs/v1.php"],"function":"require_once"}],"File":"/var/www/nextcloud/apps/files_retention/lib/AppInfo/Application.php","Line":58,"message":"Could not boot files_retention: Call to undefined method OC\\Server::getEventDispatcher()","exception":{},"CustomMessage":"Could not boot files_retention: Call to undefined method OC\\Server::getEventDispatcher()"}}
{"reqId":"DLCcBT19cKeBUu1RxoPL","level":4,"time":"2024-01-12T21:03:28+00:00","remoteAddr":"###.###.###.###","user":"###","app":"no app in context","method":"GET","url":"/ocs/v2.php/apps/notifications/api/v2/notifications?format=json","message":"Could not boot metadata: Call to undefined method OC\\Server::getEventDispatcher()","userAgent":"Mozilla/5.0 (Windows) mirall/3.11.0stable-Win64 (build 20231211) (Nextcloud, windows-10.0.19045 ClientArchitecture: x86_64 OsArchitecture: x86_64)","version":"28.0.1.1","exception":{"Exception":"Error","Message":"Call to undefined method OC\\Server::getEventDispatcher()","Code":0,"Trace":[{"file":"/var/www/nextcloud/lib/private/AppFramework/Bootstrap/Coordinator.php","line":200,"function":"boot","class":"OCA\\Metadata\\AppInfo\\Application","type":"->"},{"file":"/var/www/nextcloud/lib/private/App/AppManager.php","line":434,"function":"bootApp","class":"OC\\AppFramework\\Bootstrap\\Coordinator","type":"->"},{"file":"/var/www/nextcloud/lib/private/App/AppManager.php","line":213,"function":"loadApp","class":"OC\\App\\AppManager","type":"->"},{"file":"/var/www/nextcloud/lib/private/legacy/OC_App.php","line":125,"function":"loadApps","class":"OC\\App\\AppManager","type":"->"},{"file":"/var/www/nextcloud/ocs/v1.php","line":59,"function":"loadApps","class":"OC_App","type":"::"},{"file":"/var/www/nextcloud/ocs/v2.php","line":23,"args":["/var/www/nextcloud/ocs/v1.php"],"function":"require_once"}],"File":"/var/www/nextcloud/apps/metadata/lib/AppInfo/Application.php","Line":28,"message":"Could not boot metadata: Call to undefined method OC\\Server::getEventDispatcher()","exception":{},"CustomMessage":"Could not boot metadata: Call to undefined method OC\\Server::getEventDispatcher()"}}
{"reqId":"8gzKVTYbGNQHyqBwQNHV","level":4,"time":"2024-01-12T21:03:39+00:00","remoteAddr":"127.0.0.1","user":"--","app":"no app in context","method":"GET","url":"/apps/richdocuments/settings/fonts.json","message":"Could not boot files_retention: Call to undefined method OC\\Server::getEventDispatcher()","userAgent":"COOLWSD HTTP Agent 23.05.6.4","version":"28.0.1.1","exception":{"Exception":"Error","Message":"Call to undefined method OC\\Server::getEventDispatcher()","Code":0,"Trace":[{"file":"/var/www/nextcloud/lib/private/AppFramework/Bootstrap/Coordinator.php","line":200,"function":"boot","class":"OCA\\Files_Retention\\AppInfo\\Application","type":"->"},{"file":"/var/www/nextcloud/lib/private/App/AppManager.php","line":434,"function":"bootApp","class":"OC\\AppFramework\\Bootstrap\\Coordinator","type":"->"},{"file":"/var/www/nextcloud/lib/private/App/AppManager.php","line":213,"function":"loadApp","class":"OC\\App\\AppManager","type":"->"},{"file":"/var/www/nextcloud/lib/private/legacy/OC_App.php","line":125,"function":"loadApps","class":"OC\\App\\AppManager","type":"->"},{"file":"/var/www/nextcloud/lib/base.php","line":1067,"function":"loadApps","class":"OC_App","type":"::"},{"file":"/var/www/nextcloud/index.php","line":39,"function":"handleRequest","class":"OC","type":"::"}],"File":"/var/www/nextcloud/apps/files_retention/lib/AppInfo/Application.php","Line":58,"message":"Could not boot files_retention: Call to undefined method OC\\Server::getEventDispatcher()","exception":{},"CustomMessage":"Could not boot files_retention: Call to undefined method OC\\Server::getEventDispatcher()"}}
{"reqId":"8gzKVTYbGNQHyqBwQNHV","level":4,"time":"2024-01-12T21:03:39+00:00","remoteAddr":"127.0.0.1","user":"--","app":"no app in context","method":"GET","url":"/apps/richdocuments/settings/fonts.json","message":"Could not boot metadata: Call to undefined method OC\\Server::getEventDispatcher()","userAgent":"COOLWSD HTTP Agent 23.05.6.4","version":"28.0.1.1","exception":{"Exception":"Error","Message":"Call to undefined method OC\\Server::getEventDispatcher()","Code":0,"Trace":[{"file":"/var/www/nextcloud/lib/private/AppFramework/Bootstrap/Coordinator.php","line":200,"function":"boot","class":"OCA\\Metadata\\AppInfo\\Application","type":"->"},{"file":"/var/www/nextcloud/lib/private/App/AppManager.php","line":434,"function":"bootApp","class":"OC\\AppFramework\\Bootstrap\\Coordinator","type":"->"},{"file":"/var/www/nextcloud/lib/private/App/AppManager.php","line":213,"function":"loadApp","class":"OC\\App\\AppManager","type":"->"},{"file":"/var/www/nextcloud/lib/private/legacy/OC_App.php","line":125,"function":"loadApps","class":"OC\\App\\AppManager","type":"->"},{"file":"/var/www/nextcloud/lib/base.php","line":1067,"function":"loadApps","class":"OC_App","type":"::"},{"file":"/var/www/nextcloud/index.php","line":39,"function":"handleRequest","class":"OC","type":"::"}],"File":"/var/www/nextcloud/apps/metadata/lib/AppInfo/Application.php","Line":28,"message":"Could not boot metadata: Call to undefined method OC\\Server::getEventDispatcher()","exception":{},"CustomMessage":"Could not boot metadata: Call to undefined method OC\\Server::getEventDispatcher()"}}

This error basicaly repeats itself continously.

I tried nc-apps install_overwrite from 177586 but doesn’t seem that it made any difference

You need to disable incompatible apps. Based on the logs it appears, at a minimum, you need to disable metadata and files_retention. Also might be checking the version you actually have installed of the latter, since it appears to have an update last week that was for NC28.

Thanks @jtr . It looks that disabling only metadata did the trick, no new entries of this type any more in the log. I’ll keep my eye on it. I never realized that Could not boot metadata is actually referring to the app :wink:

1 Like

A quick troubleshooting shortcut for anyone - even if they’re not comfortable with stack traces - is to look for references like the above in the stack trace/log entry.

Any class that starts with OCA is going to be an app. What comes after that will give you a clue as to what app is involved.