nextcloud / nextcloud/bookmarks
TypeError: Argument 3 passed to MiddlewareDispatcher::beforeOutput() must be of the type string, null given, called in ....Http/Dispatcher.php on line 123
Nobody has claimed this yet.
- Dominant language
- JavaScript
- Stars
- 1.2k
- Forks
- 189
- Avg merge
- 5d 11h
- Merged PRs (30d)
- 10
Description
Describe the bug
When visiting the bookmarks section, the following error is reported in Nextcloud.log:
TypeError: Argument 3 passed to OC\AppFramework\Middleware\MiddlewareDispatcher::beforeOutput() must be of the type string, null given, called in ....nextcloud-18.0.7/lib/private/AppFramework/Http/Dispatcher.php on line 123
To Reproduce
Steps to reproduce the behavior:
- Go to 'settings/admin/logging' in one tab (Firefox)
- Go to 'apps/bookmarks' in another tab (Chrome)
- See error in the logging
Expected behavior
No error in the log file
Screenshots
Not applicable
Desktop (please complete the following information):
- OS: Linux openSUSE_Leap_15.2
- Browser Chrome, Version 84.0
- Browser Firefox, Version 78
Server (please complete the following information):
- OS: openSUSE_Leap_15.2
- HTTP server: apache 2.4.43
- Database sqlite3
- PHP version: 7.4
- Nextcloud version: 18.0.7
- Bookmarks app version: [e.g. 1.1.0 (see Nextcloud apps page)]
- Activated Nextcloud Apps: [the output of running
$ sudo -u www-data php occ app:listin your command line]
Enabled:
- accessibility: 1.4.0
- activity: 2.11.0
- admin_audit: 1.8.0
- apporder: 0.10.0
- bookmarks: 3.3.3
- bruteforcesettings: 1.6.0
- calendar: 2.0.3
- circles: 0.18.9
- cloud_federation_api: 1.1.0
- comments: 1.8.0
- contacts: 3.3.0
- cookbook: 0.7.6
- cospend: 1.0.5
- data_request: 1.5.0
- dav: 1.14.0
- deck: 1.0.5
- drop_account: 0.2.1
- external: 3.5.0
- federatedfilesharing: 1.8.0
- federation: 1.8.0
- files: 1.13.1
- files_external: 1.9.0
- files_pdfviewer: 1.7.0
- files_rightclick: 0.15.2
- files_sharing: 1.10.1
- files_trashbin: 1.8.0
- files_videoplayer: 1.7.0
- firstrunwizard: 2.7.0
- logreader: 2.3.0
- lookup_server_connector: 1.6.0
- nextcloud_announcements: 1.7.0
- notes: 3.6.1
- notifications: 2.6.0
- oauth2: 1.6.0
- password_policy: 1.8.0
- photos: 1.0.0
- polls: 1.4.3
- previewgenerator: 2.3.0
- privacy: 1.2.0
- provisioning_api: 1.8.0
- qownnotesapi: 20.1.0
- quota_warning: 1.7.0
- recommendations: 0.6.0
- serverinfo: 1.8.0
- settings: 1.0.0
- sharebymail: 1.8.0
- support: 1.1.1
- survey_client: 1.6.0
- systemtags: 1.8.0
- text: 2.0.0
- theming: 1.9.0
- twofactor_backupcodes: 1.7.0
- updatenotification: 1.8.0
- viewer: 1.2.0
- workflowengine: 2.0.0
Additional context
- Watching the logfile and going to the other apps does not result in an error.
The only app showing the error is bookmarks
The error is shown 4 times in a row (always 4 times)
Web server error log
Insert your webserver log here
Nextcloud log (nextcloud/data/nextcloud.log)
TypeError: Argument 3 passed to OC\AppFramework\Middleware\MiddlewareDispatcher::beforeOutput() must be of the type string, null given, called in /srv/www/vhosts/owncloud.radoeka.nl/nextcloud-18.0.7/lib/private/AppFramework/Http/Dispatcher.php on line 123
/srv/www/vhosts/owncloud.radoeka.nl/nextcloud-18.0.7/lib/private/AppFramework/Http/Dispatcher.php - line 123:
OC\AppFramework\Middleware\MiddlewareDispatcher->beforeOutput()
/srv/www/vhosts/owncloud.radoeka.nl/nextcloud-18.0.7/lib/private/AppFramework/App.php - line 125:
OC\AppFramework\Http\Dispatcher->dispatch()
/srv/www/vhosts/owncloud.radoeka.nl/nextcloud-18.0.7/lib/private/AppFramework/Routing/RouteActionHandler.php - line 47:
OC\AppFramework\App::main()
<<closure>>
OC\AppFramework\Routing\RouteActionHandler->__invoke()
/srv/www/vhosts/owncloud.radoeka.nl/nextcloud-18.0.7/lib/private/Route/Router.php - line 299:
call_user_func()
/srv/www/vhosts/owncloud.radoeka.nl/nextcloud-18.0.7/lib/base.php - line 1008:
OC\Route\Router->match()
/srv/www/vhosts/owncloud.radoeka.nl/nextcloud-18.0.7/index.php - line 38:
OC::handleRequest()```
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start with lib/private/AppFramework/Http/Dispatcher.php line 123 and the MiddlewareDispatcher::beforeOutput() call shown in the trace, then compare the bookmarks request with the other apps that do not log the error. Reproduce by opening apps/bookmarks while watching the Nextcloud log. Done means the bookmarks page no longer produces the TypeError.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- php
- Domain
- backend
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 25/100