nextcloud / server

☁️ Nextcloud server, a safe home for all your data
https://nextcloud.com
GNU Affero General Public License v3.0
27.34k stars 4.06k forks source link

Call to a member function getUID() on null in file '/var/www/nextcloud/lib/private/Profile/ProfileManager.php' #35766

Closed pmarini-nc closed 1 year ago

pmarini-nc commented 1 year ago

Steps to reproduce

  1. Create an appointment
  2. With a new session, access the profile page of the user that created the appointment

Expected behavior

The appointment booking panel shows

Actual behaviour

Internal error

Calendar app version

4.1.0

CalDAV-clients used

Calendar app

Browser

Firefox 108

Client operating system

Ubuntu Desktop 22.04

Server operating system

Ubuntu Server 22.05

Web server

Apache

Database engine version

MariaDB

PHP engine version

PHP 8.1

Nextcloud version

25.0.2

Updated from an older installed version or fresh install

Fresh install

List of activated apps

Enabled:
  - activity: 2.17.0
  - calendar: 4.1.0
  - circles: 25.0.0
  - cloud_federation_api: 1.8.0
  - contacts: 5.0.1
  - dashboard: 7.5.0
  - dav: 1.24.0
  - deck: 1.8.2
  - federatedfilesharing: 1.15.0
  - federation: 1.15.0
  - files: 1.20.1
  - files_fulltextsearch: 24.0.1
  - files_pdfviewer: 2.6.0
  - files_rightclick: 1.4.0
  - files_sharing: 1.17.0
  - files_trashbin: 1.15.0
  - files_versions: 1.18.0
  - firstrunwizard: 2.14.0
  - fulltextsearch: 24.0.0
  - fulltextsearch_elasticsearch: 24.0.1
  - groupfolders: 13.1.0
  - logreader: 2.10.0
  - lookup_server_connector: 1.13.0
  - mail: 2.2.1
  - nextcloud_announcements: 1.14.0
  - notifications: 2.13.1
  - oauth2: 1.13.0
  - password_policy: 1.15.0
  - photos: 2.0.1
  - privacy: 1.9.0
  - provisioning_api: 1.15.0
  - recommendations: 1.4.0
  - related_resources: 1.0.3
  - richdocuments: 7.0.2
  - serverinfo: 1.15.0
  - settings: 1.7.0
  - sharebymail: 1.15.0
  - spreed: 15.0.2
  - support: 1.8.0
  - survey_client: 1.13.0
  - systemtags: 1.15.0
  - text: 3.6.0
  - theming: 2.0.1
  - twofactor_backupcodes: 1.14.0
  - updatenotification: 1.15.0
  - user_status: 1.5.0
  - viewer: 1.9.0
  - weather_status: 1.5.0
  - workflowengine: 2.7.0
Disabled:
  - admin_audit
  - bruteforcesettings
  - comments: 1.15.0
  - contactsinteraction: 1.6.0
  - encryption
  - files_external
  - suspicious_login
  - twofactor_totp
  - user_ldap

Nextcloud configuration

{
    "system": {
        "passwordsalt": "***REMOVED SENSITIVE VALUE***",
        "secret": "***REMOVED SENSITIVE VALUE***",
        "trusted_domains": [
            "localhost",
            "ncehub-it.localenv.com"
        ],
        "datadirectory": "***REMOVED SENSITIVE VALUE***",
        "dbtype": "mysql",
        "version": "25.0.2.3",
        "overwrite.cli.url": "https:\/\/ncehub-it.localenv.com",
        "dbname": "***REMOVED SENSITIVE VALUE***",
        "dbhost": "***REMOVED SENSITIVE VALUE***",
        "dbport": "",
        "dbtableprefix": "oc_",
        "mysql.utf8mb4": true,
        "dbuser": "***REMOVED SENSITIVE VALUE***",
        "dbpassword": "***REMOVED SENSITIVE VALUE***",
        "installed": true,
        "instanceid": "***REMOVED SENSITIVE VALUE***",
        "htaccess.RewriteBase": "\/",
        "redis": {
            "host": "***REMOVED SENSITIVE VALUE***",
            "port": "0",
            "timeout": "0.0"
        },
        "memcache.local": "\\OC\\Memcache\\Redis",
        "memcache.locking": "\\OC\\Memcache\\Redis",
        "filelocking.enabled": "true",
        "default_language": "it",
        "default_phone_region": "it",
        "updater.release.channel": "enterprise",
        "maintenance": false,
        "loglevel": 2,
        "app_install_overwrite": [
            "fulltextsearch",
            "files_fulltextsearch",
            "fulltextsearch_elasticsearch"
        ],
        "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***"
    }
}

Web server error log

No response

Log file

{
  "reqId": "mjRO7CqRqp9qMiCcujCS",
  "level": 3,
  "time": "2022-12-14T09:51:34+00:00",
  "remoteAddr": "10.27.232.1",
  "user": "--",
  "app": "index",
  "method": "GET",
  "url": "/u/ettore",
  "message": "Call to a member function getUID() on null in file '/var/www/nextcloud/lib/private/Profile/ProfileManager.php' line 171",
  "userAgent": "Mozilla/5.0 (X11; Linux x86_64; rv:108.0) Gecko/20100101 Firefox/108.0",
  "version": "25.0.2.3",
  "exception": {
    "Exception": "Exception",
    "Message": "Call to a member function getUID() on null in file '/var/www/nextcloud/lib/private/Profile/ProfileManager.php' line 171",
    "Code": 0,
    "Trace": [
      {
        "file": "/var/www/nextcloud/lib/private/AppFramework/App.php",
        "line": 172,
        "function": "dispatch",
        "class": "OC\\AppFramework\\Http\\Dispatcher",
        "type": "->"
      },
      {
        "file": "/var/www/nextcloud/lib/private/Route/Router.php",
        "line": 298,
        "function": "main",
        "class": "OC\\AppFramework\\App",
        "type": "::"
      },
      {
        "file": "/var/www/nextcloud/lib/base.php",
        "line": 1047,
        "function": "match",
        "class": "OC\\Route\\Router",
        "type": "->"
      },
      {
        "file": "/var/www/nextcloud/index.php",
        "line": 36,
        "function": "handleRequest",
        "class": "OC",
        "type": "::"
      }
    ],
    "File": "/var/www/nextcloud/lib/private/AppFramework/Http/Dispatcher.php",
    "Line": 165,
    "Previous": {
      "Exception": "Error",
      "Message": "Call to a member function getUID() on null",
      "Code": 0,
      "Trace": [
        {
          "file": "/var/www/nextcloud/lib/private/Profile/ProfileManager.php",
          "line": 213,
          "function": "registerAction",
          "class": "OC\\Profile\\ProfileManager",
          "type": "->"
        },
        {
          "file": "/var/www/nextcloud/lib/private/Profile/ProfileManager.php",
          "line": 357,
          "function": "getActions",
          "class": "OC\\Profile\\ProfileManager",
          "type": "->"
        },
        {
          "file": "/var/www/nextcloud/lib/private/Profile/ProfileManager.php",
          "line": 375,
          "function": "getDefaultProfileConfig",
          "class": "OC\\Profile\\ProfileManager",
          "type": "->"
        },
        {
          "file": "/var/www/nextcloud/lib/private/Profile/ProfileManager.php",
          "line": 239,
          "function": "getProfileConfig",
          "class": "OC\\Profile\\ProfileManager",
          "type": "->"
        },
        {
          "file": "/var/www/nextcloud/lib/private/Profile/ProfileManager.php",
          "line": 299,
          "function": "isParameterVisible",
          "class": "OC\\Profile\\ProfileManager",
          "type": "->"
        },
        {
          "file": "/var/www/nextcloud/core/Controller/ProfilePageController.php",
          "line": 116,
          "function": "getProfileParams",
          "class": "OC\\Profile\\ProfileManager",
          "type": "->"
        },
        {
          "file": "/var/www/nextcloud/lib/private/AppFramework/Http/Dispatcher.php",
          "line": 225,
          "function": "index",
          "class": "OC\\Core\\Controller\\ProfilePageController",
          "type": "->"
        },
        {
          "file": "/var/www/nextcloud/lib/private/AppFramework/Http/Dispatcher.php",
          "line": 133,
          "function": "executeController",
          "class": "OC\\AppFramework\\Http\\Dispatcher",
          "type": "->"
        },
        {
          "file": "/var/www/nextcloud/lib/private/AppFramework/App.php",
          "line": 172,
          "function": "dispatch",
          "class": "OC\\AppFramework\\Http\\Dispatcher",
          "type": "->"
        },
        {
          "file": "/var/www/nextcloud/lib/private/Route/Router.php",
          "line": 298,
          "function": "main",
          "class": "OC\\AppFramework\\App",
          "type": "::"
        },
        {
          "file": "/var/www/nextcloud/lib/base.php",
          "line": 1047,
          "function": "match",
          "class": "OC\\Route\\Router",
          "type": "->"
        },
        {
          "file": "/var/www/nextcloud/index.php",
          "line": 36,
          "function": "handleRequest",
          "class": "OC",
          "type": "::"
        }
      ],
      "File": "/var/www/nextcloud/lib/private/Profile/ProfileManager.php",
      "Line": 171
    },
    "CustomMessage": "--"
  }
}

Browser log

No response

Additional info

No response

tcitworld commented 1 year ago

Transferred as it's not an appointments issue but a profile one.

joshtrichards commented 1 year ago

When you say a new session, do you mean a non-logged in browser window?

Also, do you have any non-default shareapi_* parameters active?

./occ config:list core | grep shareapi

I think there may be some weirdness around here with the instanceof IUser checking below so low:

https://github.com/nextcloud/server/blob/39a7166db7c34b6b25b5817fa0299108f4a0ffff/lib/private/Share20/Manager.php#L1976-L1992

We call the above from here:

https://github.com/nextcloud/server/blob/39a7166db7c34b6b25b5817fa0299108f4a0ffff/core/Controller/ProfilePageController.php#L98

But some further digging will be required.