Problem with sharing when groupname = username

Nextcloud version (eg, 12.0.2): 18.0.3
Operating system and version (eg, Ubuntu 17.04): Debian stretch
Apache or nginx version (eg, Apache 2.4.25): Apache 2.4.25
PHP version (eg, 7.1): 7.3

The issue you are facing: When I have a user und a group named alike, I cannot share with that group anymore when logged in with same user.

Is this the first time you’ve seen this error? (Y/N): Y

Steps to replicate it:

  1. Create user demo1
  2. Create group demo1 and put user demo1 and admin in it
  3. Log in with user demo1
  4. create folder and try to share with demo1 (group)

-> as admin I can share another folder with demo1 and demo1 (group)

The output of your Nextcloud log in Admin > Logging:

Unfortunately there is no output, since there is no group shown.

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

<?php
$CONFIG = array (
  'instanceid' => 'xxx',
  'passwordsalt' => 'xxxxxxxx',
  'secret' => 'xxxxxxxxxx',
  'trusted_domains' => 
  array (
    0 => 'one.de',
    1 => 'yoyo.de',
  ),
  'datadirectory' => '/srv/ocdata',
  'tempdirectory' => '/srv/ocdata/tmp/',
  'skeletondirectory' => '',
  'overwrite.cli.url' => 'https://some.de/nextcloud',
  'htaccess.RewriteBase' => '/nextcloud',
  'dbtype' => 'mysql',
  'version' => '18.0.3.0',
  'dbname' => 'dbname',
  'dbhost' => 'localhost',
  'dbtableprefix' => 'some_',
  'dbuser' => 'dbuser',
  'dbpassword' => 'xxxx',
  'installed' => true,
  'forcessl' => true,
  'forceSSLforSubdomains' => true,
  'mail_smtpmode' => 'smtp',
  'mail_from_address' => 'nextcloud',
  'mail_domain' => 'some.de',
  'mail_smtpauthtype' => 'LOGIN',
  'mail_smtpauth' => 1,
  'enable_previews' => true,
  'mail_smtphost' => 'localhost',
  'mail_smtpport' => '25',
  'mail_smtpname' => 'nextcloud@some.de',
  'mail_smtppassword' => 'xxxxx',
  'theme' => '',
  'log_type' => 'file',
  'logfile' => '/var/log/nextcloud/nextcloud.log',
  'loglevel' => 1,
  'default_language' => 'de',
  'appstore.experimental.enabled' => true,
  'maintenance' => false,
  'trashbin_retention_obligation' => 'auto',
  'updatechecker' => false,
  'memcache.local' => '\OC\Memcache\APCu',
  'memcache.locking' => '\OC\Memcache\Redis',
  'memcache.distributed' => '\OC\Memcache\Redis',
  'redis' => [
     'host'     => '/run/redis/redis.sock',
     'port'     => 0,
     'dbindex'  => 0,
#     'password' => 'secret',
     'timeout'  => 1.5,
  ],
  'updater.release.channel' => 'stable',
  'log_rotate_size' => 52428800,
  'simpleSignUpLink.shown' => false,
  'mysql.utf8mb4' => true,
  'app_install_overwrite' => 
  array (
    0 => 'calendar',
    1 => 'sharerenamer',
  ),
);