镜像站点 · 本页由第三方 GitHub 只读镜像提供,非 GitHub 官方站点,不接受任何登录或凭据输入。前往 github.com
Skip to content

Update to NC 19.0.1: Internal server error after login  #21885

Closed

Description

@dh-connect

Steps to reproduce

  1. Updated from NC 19.0.0 to 19.0.1 without problem using web installer
  2. After update login screen shows up
  3. Try to login, after successful login it switches to page with internal server error

Expected behaviour

after successful login switch to files

Actual behaviour

internal server error

Server configuration

Operating system: linux debian 10 buster

Web server: Apache 2.4.38

Database: MariaDB 10.3.22

PHP version: 7.4.8

Nextcloud version: 19.0.1

Updated from an older Nextcloud/ownCloud or fresh install: update from 19.0.0

Where did you install Nextcloud from: web installer

Signing status:

Signing status
cannot get to this page due to internal server error

List of activated apps:

App list
Enabled:
  - accessibility: 1.5.0
  - activity: 2.12.0
  - admin_audit: 1.9.0
  - calendar: 2.0.3
  - cloud_federation_api: 1.2.0
  - comments: 1.9.0
  - contacts: 3.3.0
  - contactsinteraction: 1.0.0
  - dav: 1.15.0
  - encryption: 2.7.0
  - federatedfilesharing: 1.9.0
  - federation: 1.9.0
  - files: 1.14.0
  - files_external: 1.10.0
  - files_pdfviewer: 1.8.0
  - files_rightclick: 0.16.0
  - files_sharing: 1.11.0
  - files_trashbin: 1.9.0
  - files_versions: 1.12.0
  - files_videoplayer: 1.8.0
  - logreader: 2.4.0
  - lookup_server_connector: 1.7.0
  - mail: 1.4.1
  - news: 14.1.11
  - nextcloud_announcements: 1.8.0
  - notes: 3.6.0
  - notifications: 2.7.0
  - oauth2: 1.7.0
  - ocsms: 2.1.8
  - password_policy: 1.9.1
  - photos: 1.1.0
  - privacy: 1.3.0
  - provisioning_api: 1.9.0
  - qownnotesapi: 20.1.0
  - recommendations: 0.7.0
  - serverinfo: 1.9.0
  - settings: 1.1.0
  - sharebymail: 1.9.0
  - spreed: 9.0.1
  - support: 1.2.1
  - systemtags: 1.9.0
  - tasks: 0.13.2
  - text: 3.0.1
  - theming: 1.10.0
  - twofactor_backupcodes: 1.8.0
  - twofactor_totp: 4.1.3
  - updatenotification: 1.9.0
  - viewer: 1.3.0
  - workflowengine: 2.1.0
Disabled:
  - firstrunwizard
  - survey_client
  - user_ldap



Nextcloud configuration:

Config report
{
    "system": {
        "instanceid": "***REMOVED SENSITIVE VALUE***",
        "passwordsalt": "***REMOVED SENSITIVE VALUE***",
        "secret": "***REMOVED SENSITIVE VALUE***",
        "trusted_domains": [
            "10.0.0.10"
        ],
        "trusted_proxies": "***REMOVED SENSITIVE VALUE***",
        "datadirectory": "***REMOVED SENSITIVE VALUE***",
        "overwrite.cli.url": "***REMOVED SENSITIVE VALUE***",
        "log_type": "owncloud",
        "logfile": "\/var\/log\/nextcloud.log",
        "loglevel": 2,
        "log_rotate_size": 104857600,
        "dbtype": "mysql",
        "version": "19.0.1.1",
        "dbname": "***REMOVED SENSITIVE VALUE***",
        "dbhost": "***REMOVED SENSITIVE VALUE***",
        "dbtableprefix": "oc_",
        "dbuser": "***REMOVED SENSITIVE VALUE***",
        "dbpassword": "***REMOVED SENSITIVE VALUE***",
        "logtimezone": "UTC",
        "installed": true,
        "mail_smtpmode": "smtp",
        "mail_from_address": "***REMOVED SENSITIVE VALUE***",
        "mail_domain": "***REMOVED SENSITIVE VALUE***",
        "mail_smtpauthtype": "LOGIN",
        "mail_smtpauth": 1,
        "mail_smtpsecure": "tls",
        "mail_smtphost": "***REMOVED SENSITIVE VALUE***",
        "mail_smtpname": "***REMOVED SENSITIVE VALUE***",
        "mail_smtppassword": "***REMOVED SENSITIVE VALUE***",
        "appstoreenabled": true,
        "appstore.experimental.enabled": true,
        "theme": "",
        "maintenance": false,
        "memcache.local": "\\OC\\Memcache\\APCu",
        "cache_path": "\/data\/ownclouddata\/ocd\/cache",
        "mail_smtpport": "587",
        "app.mail.server-side-cache.enabled": true,
        "htaccess.RewriteBase": "\/owncloud",
        "updater.release.channel": "stable",
        "mysql.utf8mb4": true,
        "memcache.locking": "\\OC\\Memcache\\Redis",
        "redis": {
            "host": "***REMOVED SENSITIVE VALUE***",
            "port": 0,
            "timeout": 0
        },
        "filelocking.enabled": true,
        "activity_expire_days": 14,
        "auth.bruteforce.protection.enabled": true,
        "blacklisted_files": [
            ".htaccess",
            "Thumbs.db",
            "thumbs.db",
            "DS_Store"
        ],
        "cron_log": true,
        "enable_previews": true,
        "enabledPreviewProviders": [
            "OC\\Preview\\PNG",
            "OC\\Preview\\JPEG",
            "OC\\Preview\\GIF",
            "OC\\Preview\\BMP",
            "OC\\Preview\\XBitmap",
            "OC\\Preview\\Movie",
            "OC\\Preview\\PDF",
            "OC\\Preview\\MP3",
            "OC\\Preview\\TXT",
            "OC\\Preview\\MarkDown"
        ],
        "preview_max_x": 1024,
        "preview_max_y": 768,
        "preview_max_scale_factor": 1,
        "filesystem_check_changes": 0,
        "integrity.check.disabled": false,
        "knowledgebaseenabled": false,
        "overwriteprotocol": "https",
        "quota_include_external_storage": false,
        "trashbin_retention_obligation": "auto, 7",
        "app_install_overwrite": [
            "ocsms",
            "contacts",
            "qownnotesapi"
        ],
        "updater.secret": "***REMOVED SENSITIVE VALUE***"
    }
}

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

Are you using encryption: no

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

LDAP configuration (delete this part if not used)

LDAP config
no LDAP

Client configuration

Browser:

Operating system:

Logs

Web server error log

Web server error log
no error in apache2/error.log

Nextcloud log (data/nextcloud.log)

Nextcloud log
same error over and over again

"Exception":"TypeError: Return value of OC\\Group\\Database::getDisplayName() must be of the type string, null returned at /data/ownclouddata/www/owncloud/lib/private/Group/Database.php#444"

Browser log

Browser log
no browser log

Activity

  1. dh-connect commented on Jul 18, 2020

    @dh-connect
    Author

    Info: downgraded back to NC 19.0.0.12, and NC works again without internal server error.

  2. especially-relative commented on Jul 20, 2020

    @especially-relative

    Same issue;

    "Exception":"TypeError: Return value of OC\Group\Database::getDisplayName() must be of the type string, null returned at /data/ownclouddata/www/owncloud/lib/private/Group/Database.php#444"

    That code block was added in 5ebb535; commenting it out seems to be a workaround. I am able to browse groups, in the admin UI once I've logged in, so I am not sure why the error is thrown on login.

  3. dh-connect commented on Jul 20, 2020

    @dh-connect
    Author

    thank you so much, workaround worked.

  4. rolandixor commented on Jul 21, 2020

    @rolandixor

    Is it specifically line 444 that you commented out? I tried this and it didn't seem to work for me.

    It would be helpful if you could be more specific about what you commented out, as there are multiple things listed in the commit.

  5. especially-relative commented on Jul 21, 2020

    @especially-relative
  6. robinelfrink commented on Sep 7, 2020

    @robinelfrink

    Same issue here, upgrading from 18.0.8 to 19.0.2. Commenting the three lines in getDisplayName as a workaround does the trick.

  7. dh-connect commented on Sep 8, 2020

    @dh-connect
    Author

    instead of commenting it out, you can also handle the null value of displayname like this:

          public function getDisplayName(string $gid): string {
    
                if (isset($this->groupCache[$gid])) {
    
                        $displayName = $this->groupCache[$gid]['displayname'];
    
                            if (!isset($displayName) || trim($displayName) === '') {
                         $displayName = '';
    
                        return $displayName;
                }
          }
    
  8. cnaumer commented on Sep 8, 2020

    @cnaumer

    We have the same Problem. NC 19.0.2 and LDAP backend. However, until now I only got one user not working the rest (~100) have not complained. As we are using an AD as LDAP backend and there are no displaynames set on any groups I am not sure what makes this user different.
    I am waiting for feedback if the comment from dh-connect works as a fix.

  9. kbzowski commented on Sep 10, 2020

    @kbzowski

    I can confirm that problem still exists in 19.0.2 (pure local user storage).
    My solution: comment lines 455-457 (if condition) in /var/www/html/lib/private/Group/Database.php. Browse list of users in nextcloud (this will populate cache), and uncommnent previously commented code. After that operation it works fine. I believed something is wrong with not populated properly cache.

  10. cnaumer commented on Sep 11, 2020

    @cnaumer

    I can also confirm that the Problem still exists in 19.0.3 and the comment from dh-connect works as a fix with that version also.

  11. vascowhite commented on Sep 13, 2020

    @vascowhite

    I have three instances of NC running, all on Debian/Apache. This is happening on just one of the instances. I'm trying to upgrade to 19.03 from 18.9. Success on two instances, but failed with this error on one.

    I have noticed that error message below gives the args as onboard, but the group name is actually Onboard. So maybe the issue is elsewhere?

    Here's the error formatted for easier reading.

    {
      "reqId": "j786idl9YWVSr1YOvjUR",
      "level": 3,
      "time": "2020-09-13T11:15:39+00:00",
      "remoteAddr": "172.18.74.176",
      "user": "paul",
      "app": "index",
      "method": "GET",
      "url": "/",
      "message": {
        "Exception": "TypeError",
        "Message": "Return value of OC\\Group\\Database::getDisplayName() must be of the type string, null returned",
        "Code": 0,
        "Trace": [
          {
            "file": "/var/www/nextcloud/lib/private/Group/Database.php",
            "line": 474,
            "function": "getDisplayName",
            "class": "OC\\Group\\Database",
            "type": "->",
            "args": [
              "onboard"
            ]
          },
          {
            "file": "/var/www/nextcloud/lib/private/Group/Manager.php",
            "line": 187,
            "function": "getGroupDetails",
            "class": "OC\\Group\\Database",
            "type": "->",
            "args": [
              "onboard"
            ]
          },
          {
            "file": "/var/www/nextcloud/lib/private/Group/Manager.php",
            "line": 175,
            "function": "getGroupObject",
            "class": "OC\\Group\\Manager",
            "type": "->",
            "args": [
              "onboard"
            ]
          },
          {
            "file": "/var/www/nextcloud/lib/private/Group/Manager.php",
            "line": 287,
            "function": "get",
            "class": "OC\\Group\\Manager",
            "type": "->",
            "args": [
              "onboard"
            ]
          },
          {
            "file": "/var/www/nextcloud/lib/private/Group/Manager.php",
            "line": 271,
            "function": "getUserIdGroups",
            "class": "OC\\Group\\Manager",
            "type": "->",
            "args": [
              "paul"
            ]
          },
          {
            "file": "/var/www/nextcloud/lib/private/Group/Manager.php",
            "line": 335,
            "function": "getUserGroups",
            "class": "OC\\Group\\Manager",
            "type": "->",
            "args": [
              {
                "__class__": "OC\\User\\User"
              }
            ]
          },
          {
            "file": "/var/www/nextcloud/apps/groupfolders/lib/Folder/FolderManager.php",
            "line": 442,
            "function": "getUserGroupIds",
            "class": "OC\\Group\\Manager",
            "type": "->",
            "args": [
              {
                "__class__": "OC\\User\\User"
              }
            ]
          },
          {
            "file": "/var/www/nextcloud/apps/groupfolders/lib/Mount/MountProvider.php",
            "line": 80,
            "function": "getFoldersForUser",
            "class": "OCA\\GroupFolders\\Folder\\FolderManager",
            "type": "->",
            "args": [
              {
                "__class__": "OC\\User\\User"
              },
              62
            ]
          },
          {
            "file": "/var/www/nextcloud/apps/groupfolders/lib/Mount/MountProvider.php",
            "line": 84,
            "function": "getFoldersForUser",
            "class": "OCA\\GroupFolders\\Mount\\MountProvider",
            "type": "->",
            "args": [
              {
                "__class__": "OC\\User\\User"
              }
            ]
          },
          {
            "file": "/var/www/nextcloud/lib/private/Files/Config/MountProviderCollection.php",
            "line": 105,
            "function": "getMountsForUser",
            "class": "OCA\\GroupFolders\\Mount\\MountProvider",
            "type": "->",
            "args": [
              {
                "__class__": "OC\\User\\User"
              },
              {
                "__class__": "OC\\Files\\Storage\\StorageFactory"
              }
            ]
          },
          {
            "file": "/var/www/nextcloud/lib/private/Files/Filesystem.php",
            "line": 451,
            "function": "addMountForUser",
            "class": "OC\\Files\\Config\\MountProviderCollection",
            "type": "->",
            "args": [
              {
                "__class__": "OC\\User\\User"
              },
              {
                "__class__": "OC\\Files\\Mount\\Manager"
              }
            ]
          },
          {
            "file": "/var/www/nextcloud/lib/private/Files/Filesystem.php",
            "line": 376,
            "function": "initMountPoints",
            "class": "OC\\Files\\Filesystem",
            "type": "::",
            "args": [
              "paul"
            ]
          },
          {
            "file": "/var/www/nextcloud/lib/private/legacy/OC_Util.php",
            "line": 308,
            "function": "init",
            "class": "OC\\Files\\Filesystem",
            "type": "::",
            "args": [
              "paul",
              "/paul/files"
            ]
          },
          {
            "file": "/var/www/nextcloud/lib/base.php",
            "line": 1011,
            "function": "setupFS",
            "class": "OC_Util",
            "type": "::",
            "args": []
          },
          {
            "file": "/var/www/nextcloud/index.php",
            "line": 37,
            "function": "handleRequest",
            "class": "OC",
            "type": "::",
            "args": []
          }
        ],
        "File": "/var/www/nextcloud/lib/private/Group/Database.php",
        "Line": 456,
        "CustomMessage": "--"
      },
      "userAgent": "Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101 Firefox/78.0",
      "version": "19.0.3.1"
    }
    {
      "reqId": "j786idl9YWVSr1YOvjUR",
      "level": 3,
      "time": "2020-09-13T11:15:40+00:00",
      "remoteAddr": "172.18.74.176",
      "user": "paul",
      "app": "PHP",
      "method": "GET",
      "url": "/",
      "message": "TypeError: Return value of OC\\Group\\Database::getDisplayName() must be of the type string, null returned at /var/www/nextcloud/lib/private/Group/Database.php#456",
      "userAgent": "Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101 Firefox/78.0",
      "version": "19.0.3.1"
    }
    
  12. vascowhite commented on Sep 22, 2020

    @vascowhite

    No further movement on fixing this?

  13. 7 remaining items

  14. antondollmaier commented on Jan 11, 2021

    @antondollmaier

    Issue is still present in 20.0.4. Haven't yet searched how the groupcache is wrongly populated.

  15. thoro commented on Jan 21, 2021

    @thoro

    Also with 20.0.5 ... maybe someone cares about checking that?

    the oc_ldap_group_mapping table has the owncloud_name the same as the CN, but cn is all lower case, and owncloud_name is correctly typed (i.e. mixed case)

    For me it seems to always affect only a single user at a time so far.

  16. soerpoers commented on Feb 1, 2021

    @soerpoers

    Seems that it's also the same with 20.0.6
    I don't use ldap so there isn't a table of that there.
    All users except admins have this problem.

  17. soerpoers commented on Feb 1, 2021

    @soerpoers

    So I just solved the problem for me by deleting some records of users in the oc_group_user table, whose groups I had actually deleted in the frontend some time ago. But the records of the users associated with the groups were still there in the database and thus probably triggered the problem after each update.

  18. dh-connect commented on Feb 2, 2021

    @dh-connect
    Author

    thank you for the hint, I did the same, had users assigned to a group GID "users", but in table oc_groups is no GID "users", tried it out without the fix and it works now, so guess the issue was a GID used that's not in the oc_groups table

  19. robinelfrink commented on Feb 8, 2021

    @robinelfrink

    List user/group combinations with non-existing group:

    SELECT oc_group_user.* FROM oc_group_user LEFT JOIN oc_groups ON oc_group_user.gid=oc_groups.gid WHERE oc_groups.gid IS NULL;

    Remove user/group combinations with non-existing group:

    DELETE oc_group_user FROM oc_group_user LEFT JOIN oc_groups ON oc_group_user.gid=oc_groups.gid WHERE oc_groups.gid IS NULL;
  20. vascowhite commented on Feb 8, 2021

    @vascowhite

    @robinelfrink @soerpoers
    Thank you, that worked perfectly.

  21. added 2 commits that reference this issue on May 25, 2021
  22. szaimen commented on Jun 23, 2021

    @szaimen
    Contributor

    Looks like this was fixed with #23065

  23. added 2 commits that reference this issue on Sep 23, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    0. Needs triagePending check for reproducibility or if it fits our roadmapbug

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions