nextcloud / server

ā˜ļø Nextcloud server, a safe home for all your data
https://nextcloud.com
GNU Affero General Public License v3.0
27.46k stars 4.08k forks source link

TypeError: Argument 3 passed to OCA\UserStatus\Controller\UserStatusController::__construct() must be of the type string, null given #25071

Closed netsrotr closed 3 years ago

netsrotr commented 3 years ago

How to use GitHub

Steps to reproduce

  1. Try to establish synchronization (add account) on Android

Expected behaviour

successful synchronization of files

Actual behaviour

Warning and Error reported at NC server

Server configuration

Operating system: Ubuntu 20.04.1 LTSā€¬

Web server: Apache2

Database: mysql

PHP version: 7.4

Nextcloud version: 20.0.4

Updated from an older Nextcloud/ownCloud or fresh install: fresh install (web installer)

Where did you install Nextcloud from: https://nextcloud.com/

Signing status:

Signing status ``` No errors have been found. ```

List of activated apps:

App list ``` Enabled: - accessibility: 1.6.0 - activity: 2.13.4 - bruteforcesettings: 2.0.1 - calendar: 2.1.3 - cloud_federation_api: 1.3.0 - comments: 1.10.0 - contacts: 3.4.3 - contactsinteraction: 1.1.0 - dashboard: 7.0.0 - dav: 1.16.2 - federatedfilesharing: 1.10.2 - federation: 1.10.1 - files: 1.15.0 - files_pdfviewer: 2.0.1 - files_rightclick: 0.17.0 - files_sharing: 1.12.1 - files_trashbin: 1.10.1 - files_versions: 1.13.0 - files_videoplayer: 1.9.0 - firstrunwizard: 2.9.0 - logreader: 2.5.0 - lookup_server_connector: 1.8.0 - mail: 1.7.2 - nextcloud_announcements: 1.9.0 - notifications: 2.8.0 - oauth2: 1.8.0 - password_policy: 1.10.1 - photos: 1.2.1 - privacy: 1.4.0 - provisioning_api: 1.10.0 - recommendations: 0.8.0 - richdocuments: 3.7.11 - richdocumentscode: 6.4.301 - serverinfo: 1.10.0 - settings: 1.2.0 - sharebymail: 1.10.0 - spreed: 10.0.5 - support: 1.3.0 - survey_client: 1.8.0 - systemtags: 1.10.0 - text: 3.1.0 - theming: 1.11.0 - twofactor_backupcodes: 1.9.0 - updatenotification: 1.10.0 - user_status: 1.0.1 - viewer: 1.4.0 - weather_status: 1.0.0 - workflowengine: 2.2.0 Disabled: - admin_audit - encryption - files_external - user_ldap ```

Nextcloud configuration:

Config report ``` php occ config:list system { "system": { "instanceid": "***REMOVED SENSITIVE VALUE***", "passwordsalt": "***REMOVED SENSITIVE VALUE***", "secret": "***REMOVED SENSITIVE VALUE***", "trusted_domains": [ "cloud.mydomain.de" ], "datadirectory": "***REMOVED SENSITIVE VALUE***", "dbtype": "mysql", "version": "20.0.4.0", "overwrite.cli.url": "https:\/\/cloud.mydomain.de", "dbname": "***REMOVED SENSITIVE VALUE***", "dbhost": "***REMOVED SENSITIVE VALUE***", "dbport": "", "dbtableprefix": "oc_", "mysql.utf8mb4": true, "dbuser": "***REMOVED SENSITIVE VALUE***", "dbpassword": "***REMOVED SENSITIVE VALUE***", "installed": true, "mail_smtpmode": "smtp", "mail_smtpsecure": "tls", "mail_sendmailmode": "smtp", "mail_from_address": "***REMOVED SENSITIVE VALUE***", "mail_domain": "***REMOVED SENSITIVE VALUE***", "mail_smtpauthtype": "LOGIN", "mail_smtpauth": 1, "mail_smtphost": "***REMOVED SENSITIVE VALUE***", "mail_smtpport": "587", "mail_smtpname": "***REMOVED SENSITIVE VALUE***", "mail_smtppassword": "***REMOVED SENSITIVE VALUE***", "default_language": "de", "default_locale": "de_DE" } } ```

Are you using external storage, if yes which one: no

Are you using encryption: no

Are you using an external user-backend, if yes which one: no

Client configuration

Browser: (Chrome / Android) Nextcloud Android Client Version: 3.14.1

Operating system: Android 7.1.1 / Galaxy JS (2016)

Logs

Web server error log

Web server error log ``` [Apache error_log.txt](https://github.com/nextcloud/server/files/5795385/Apache.error_log.txt) [ngnix proxy_error_log.txt](https://github.com/nextcloud/server/files/5795375/ngnix.proxy_error_log.txt) ```

Nextcloud log (data/nextcloud.log)

Nextcloud log ``` [nextcloud.log](https://github.com/nextcloud/server/files/5795411/nextcloud.log) ```

Browser log

Browser log ``` none... failed in nextcloud android client ```
Obi-Wahn commented 3 years ago

Same problem with Nextcloud 20.0.4, Ubuntu 18.04 and PHP 7.4. Android 11 and App Version 3.14.1.

Error   PHP TypeError: Argument 3 passed to OCA\UserStatus\Controller\UserStatusController::__construct() must be of the type string, null given at /var/www/vhosts/nextcloud/apps/user_status/lib/Controller/UserStatusController.php#62       2021-01-12T07:43:15+0100
Error   index   TypeError: Argument 7 passed to OCA\Mail\Controller\MessagesController::__construct() must be of the type string, null given
<<closure>>

OCA\Mail\Controller\MessagesController->__construct()

/var/www/vhosts/nextcloud/lib/private/AppFramework/Utility/SimpleContainer.php - line 101:

ReflectionClass->newInstanceArgs()

/var/www/vhosts/nextcloud/lib/private/AppFramework/Utility/SimpleContainer.php - line 109:

OC\AppFramework\Utility\SimpleContainer->buildClass()

/var/www/vhosts/nextcloud/lib/private/AppFramework/Utility/SimpleContainer.php - line 126:

OC\AppFramework\Utility\SimpleContainer->resolve()

/var/www/vhosts/nextcloud/lib/private/AppFramework/DependencyInjection/DIContainer.php - line 455:

OC\AppFramework\Utility\SimpleContainer->query()

/var/www/vhosts/nextcloud/lib/private/AppFramework/DependencyInjection/DIContainer.php - line 427:

OC\AppFramework\DependencyInjection\DIContainer->queryNoFallback()

/var/www/vhosts/nextcloud/lib/private/AppFramework/App.php - line 139:

OC\AppFramework\DependencyInjection\DIContainer->query()

/var/www/vhosts/nextcloud/lib/private/Route/Router.php - line 308:

OC\AppFramework\App::main()

/var/www/vhosts/nextcloud/lib/base.php - line 1008:

OC\Route\Router->match()

/var/www/vhosts/nextcloud/index.php - line 37:

OC::handleRequest()

    2021-01-12T07:43:10+0100
Error   PHP TypeError: Argument 3 passed to OCA\UserStatus\Controller\UserStatusController::__construct() must be of the type string, null given at /var/www/vhosts/nextcloud/apps/user_status/lib/Controller/UserStatusController.php#62       2021-01-12T07:43:07+0100
stavros-k commented 3 years ago

Having this error too on 20.0.9

JohnyBeGood commented 3 years ago

Same error here Nextcloud 21.0.1

AndyXheli commented 3 years ago

Same error on Nextcloud 21.0.1

zcyph commented 3 years ago

Same error with Nextcloud Snap (Nextcloud 20.0.9).

AndyXheli commented 3 years ago

@simonspa @MorrisJobke would this be related to https://github.com/nextcloud/server/pull/23842 ?

simonspa commented 3 years ago

@simonspa @MorrisJobke would this be related to #23842 ?

I don't think so because it references L62 of that file, the third argument of the class constructor:

https://github.com/nextcloud/server/pull/23842/files#diff-e7ec91ce9e59539885bfd3698cc8af4193ea5ea3e23e2873c9b6cfd2aa491739R62

public function __construct(string $appName,
            IRequest $request,
            string $userId,
            ILogger $logger) {

so it seems it is called with an empty $userId by the Android client.

AndyXheli commented 3 years ago

@simonspa @MorrisJobke would this be related to #23842 ?

I don't think so because it references L62 of that file, the third argument of the class constructor:

https://github.com/nextcloud/server/pull/23842/files#diff-e7ec91ce9e59539885bfd3698cc8af4193ea5ea3e23e2873c9b6cfd2aa491739R62


public function __construct(string $appName,

              IRequest $request,

              string $userId,

              ILogger $logger) {

so it seems it is called with an empty $userId by the Android client.

Thank you for the feedback just wanted to make sure.

szaimen commented 3 years ago

Is this Issue still valid in NC21.0.3? If not, please close this issue. Thanks! :)

ghost commented 3 years ago

This issue has been automatically marked as stale because it has not had recent activity and seems to be missing some essential information. It will be closed if no further activity occurs. Thank you for your contributions.

ghost commented 3 years ago

This issue has been automatically marked as stale because it has not had recent activity and seems to be missing some essential information. It will be closed if no further activity occurs. Thank you for your contributions.

petob77 commented 2 years ago

@szaimen Hi, now in Nextloud version 23.0.1.1, Ubuntu 20.04 and PHP 7.4 valid {"reqId":"","level":3,"time":"2022-02-05T21:15:51+01:00","remoteAddr":"","user":"--","app":"PHP","method":"GET","url":"/nextcloud/ocs/v2.php/apps/user_status/api/v1/user_status?format=json","message":"TypeError: Argument 3 passed to OCA\UserStatus\Controller\UserStatusController::__construct() must be of the type string, null given at /var/www/***/nextcloud/apps/user_status/lib/Controller/UserStatusController.php#65","userAgent":"Mozilla/5.0 (Android) Nextcloud-android/3.19.0","version":"23.0.1.1"}

informaticavera commented 1 year ago

In Nextcloud 25.0.3, Ubuntu 20.04 and PHP 7.4.33 when run cron jobs php -f /var/www/nextcloud/cron.php

TypeError: Argument 3 passed to OCA\User_LDAP\Access::fetchListOfUsers() must be of the type int or null, string given, called in /var/www/nextcloud/apps/user_ldap/lib/Jobs/Sync.php on line 178 and defined in /var/www/nextcloud/apps/user_ldap/lib/Access.php:870 Stack trace:

0 /var/www/nextcloud/apps/user_ldap/lib/Jobs/Sync.php(178): OCA\User_LDAP\Access->fetchListOfUsers()

1 /var/www/nextcloud/apps/user_ldap/lib/Jobs/Sync.php(147): OCA\User_LDAP\Jobs\Sync->runCycle()

2 /var/www/nextcloud/lib/public/BackgroundJob/Job.php(78): OCA\User_LDAP\Jobs\Sync->run()

3 /var/www/nextcloud/lib/public/BackgroundJob/TimedJob.php(103): OCP\BackgroundJob\Job->start()

4 /var/www/nextcloud/lib/public/BackgroundJob/TimedJob.php(93): OCP\BackgroundJob\TimedJob->start()

5 /var/www/nextcloud/cron.php(152): OCP\BackgroundJob\TimedJob->execute()

6 {main}