Send invite mail and non-default password rules

Support intro

Sorry to hear you’re facing problems :slightly_frowning_face:

help.nextcloud.com is for home/non-enterprise users. If you’re running a business, paid support can be accessed via portal.nextcloud.com where we can ensure your business keeps running smoothly.

In order to help you as quickly as possible, before clicking Create Topic please provide as much of the below as you can. Feel free to use a pastebin service for logs, otherwise either indent short log examples with four spaces:

example

Or for longer, use three backticks above and below the code snippet:

longer
example
here

Some or all of the below information will be requested if it isn’t supplied; for fastest response please provide as much as you can :heart:

Nextcloud version 19.0.3 (used snap)
Operating system and version: Ubuntu 20.04 / Linux 5.4.0-1018-raspi aarch64
Apache or nginx version: Apache/2.4.46
PHP version: 7.3.21

The issue you are facing:

When creating a new user via invite, if you have a password rule set different from default, there will be no email sent because the password (which is supposed to be left blank) does not meet the rules.

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

Steps to replicate it:

  1. Set password length rule to 20 (from 8)
  2. Make sure ‘send email to new user’ option is set in User menu
  3. Add new user, leaving password blank

The output of your Nextcloud log in Admin > Logging:

[ocs_api] Warning: OC\HintException: Password needs to be at least 20 characters long at <<closure>>

 0. /snap/nextcloud/23185/htdocs/apps/password_policy/lib/PasswordValidator.php line 76
    OCA\Password_Policy\Validator\LengthValidator->validate("*** sensitive parameter replaced ***")
 1. /snap/nextcloud/23185/htdocs/apps/password_policy/lib/AppInfo/Application.php line 67
    OCA\Password_Policy\PasswordValidator->validate("*** sensitive parameter replaced ***")
 2. /snap/nextcloud/23185/htdocs/3rdparty/symfony/event-dispatcher/EventDispatcher.php line 251
    OCA\Password_Policy\AppInfo\Application->OCA\Password_Policy\AppInfo\{closure}("*** sensitive parameters replaced ***")
 3. /snap/nextcloud/23185/htdocs/3rdparty/symfony/event-dispatcher/EventDispatcher.php line 73
    Symfony\Component\EventDispatcher\EventDispatcher->callListeners([Closure {}], "*** sensitive parameter replaced ***", "*** sensitive parameter replaced ***")
 4. /snap/nextcloud/23185/htdocs/lib/private/EventDispatcher/EventDispatcher.php line 86
    Symfony\Component\EventDispatcher\EventDispatcher->dispatch("*** sensitive parameter replaced ***", "*** sensitive parameter replaced ***")
 5. /snap/nextcloud/23185/htdocs/lib/private/EventDispatcher/EventDispatcher.php line 98
    OC\EventDispatcher\EventDispatcher->dispatch("*** sensitive parameter replaced ***", "*** sensitive parameter replaced ***")
 6. /snap/nextcloud/23185/htdocs/lib/private/User/Database.php line 135
    OC\EventDispatcher\EventDispatcher->dispatchTyped("*** sensitive parameter replaced ***")
 7. /snap/nextcloud/23185/htdocs/lib/private/User/Manager.php line 370
    OC\User\Database->createUser("*** sensitive parameter replaced ***", "*** sensitive parameter replaced ***")
 8. /snap/nextcloud/23185/htdocs/lib/private/User/Manager.php line 315
    OC\User\Manager->createUserFromBackend("*** sensitive parameter replaced ***", "*** sensitive parameter replaced ***", OC\User\Database {})
 9. /snap/nextcloud/23185/htdocs/apps/provisioning_api/lib/Controller/UsersController.php line 314
    OC\User\Manager->createUser("*** sensitive parameter replaced ***", "*** sensitive parameter replaced ***")
10. /snap/nextcloud/23185/htdocs/lib/private/AppFramework/Http/Dispatcher.php line 170
    OCA\Provisioning_API\Controller\UsersController->addUser("*** sensitive parameters replaced ***")
11. /snap/nextcloud/23185/htdocs/lib/private/AppFramework/Http/Dispatcher.php line 100
    OC\AppFramework\Http\Dispatcher->executeController(OCA\Provisioning ... {}, "addUser")
12. /snap/nextcloud/23185/htdocs/lib/private/AppFramework/App.php line 137
    OC\AppFramework\Http\Dispatcher->dispatch(OCA\Provisioning ... {}, "addUser")
13. /snap/nextcloud/23185/htdocs/lib/private/AppFramework/Routing/RouteActionHandler.php line 47
    OC\AppFramework\App::main("OCA\\Provisioni ... r", "addUser", OC\AppFramework\ ... {}, {_route: "ocs.pr ... "})
14. <<closure>>
    OC\AppFramework\Routing\RouteActionHandler->__invoke({_route: "ocs.pr ... "})
15. /snap/nextcloud/23185/htdocs/lib/private/Route/Router.php line 297
    call_user_func(OC\AppFramework\ ... {}, {_route: "ocs.pr ... "})
16. /snap/nextcloud/23185/htdocs/ocs/v1.php line 88
    OC\Route\Router->match("/ocsapp/cloud/users")
17. /snap/nextcloud/23185/htdocs/ocs/v2.php line 24
    require_once("/snap/nextcloud/23185/htdocs/ocs/v1.php")

POST /ocs/v2.php/cloud/users
from 127.0.0.1 by gdp at 2020-09-23T06:55:36+00:00

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

<?php
$CONFIG = array (
  'apps_paths' =>
  array (
    0 =>
    array (
      'path' => '/snap/nextcloud/current/htdocs/apps',
      'url' => '/apps',
      'writable' => false,
    ),
    1 =>
    array (
      'path' => '/var/snap/nextcloud/current/nextcloud/extra-apps',
      'url' => '/extra-apps',
      'writable' => true,
    ),
  ),
  'supportedDatabases' =>
  array (
    0 => 'mysql',
  ),
  'memcache.locking' => '\\OC\\Memcache\\Redis',
  'memcache.local' => '\\OC\\Memcache\\Redis',
  'redis' =>
  array (
    'host' => '/tmp/sockets/redis.sock',
    'port' => 0,
  ),
  'instanceid' => '<?php
$CONFIG = array (
  'apps_paths' =>
  array (
    0 =>
    array (
      'path' => '/snap/nextcloud/current/htdocs/apps',
      'url' => '/apps',
      'writable' => false,
    ),
    1 =>
    array (
      'path' => '/var/snap/nextcloud/current/nextcloud/extra-apps',
      'url' => '/extra-apps',
      'writable' => true,
    ),
  ),
  'supportedDatabases' =>
  array (
    0 => 'mysql',
  ),
  'memcache.locking' => '\\OC\\Memcache\\Redis',
  'memcache.local' => '\\OC\\Memcache\\Redis',
  'redis' =>
  array (
    'host' => '/tmp/sockets/redis.sock',
    'port' => 0,
  ),
  'instanceid' => 'oc0w4sf8ey0s',
  'passwordsalt' => '***',
  'secret' => '***',
  'trusted_domains' =>
  array (
    0 => '192.168.0.152',
    1 => '***',
  ),
  'datadirectory' => '/media/toshiba/nextcloud/data',
  'dbtype' => 'mysql',
  'version' => '19.0.3.1',
  'overwrite.cli.url' => 'http://192.168.0.152',
  'dbname' => 'nextcloud',
  'dbhost' => 'localhost:/tmp/sockets/mysql.sock',
  'dbport' => '',
  'dbtableprefix' => 'oc_',
  'mysql.utf8mb4' => true,
  'dbuser' => 'nextcloud',
  'dbpassword' => '***',
  'installed' => true,
  'mail_smtpmode' => 'smtp',
  'mail_smtpsecure' => 'tls',
  'mail_sendmailmode' => 'smtp',
  'mail_from_address' => 'nextcloud',
  'mail_domain' => '***',
  'mail_smtpauthtype' => 'LOGIN',
  'mail_smtpauth' => 1,
  'mail_smtphost' => '***',
  'mail_smtpport' => '***',
  'mail_smtpname' => '***',
  'mail_smtppassword' => '***',
  'maintenance' => false,
  'trusted_proxies' =>
  array (
    0 => 'localhost',
  ),
  'overwriteprotocol' => 'https',
);',
  'passwordsalt' => '***',
  'secret' => '***',
  'trusted_domains' =>
  array (
    0 => '192.168.0.152',
    1 => '***',
  ),
  'datadirectory' => '/media/toshiba/nextcloud/data',
  'dbtype' => 'mysql',
  'version' => '19.0.3.1',
  'overwrite.cli.url' => 'http://192.168.0.152',
  'dbname' => 'nextcloud',
  'dbhost' => 'localhost:/tmp/sockets/mysql.sock',
  'dbport' => '',
  'dbtableprefix' => 'oc_',
  'mysql.utf8mb4' => true,
  'dbuser' => 'nextcloud',
  'dbpassword' => '***',
  'installed' => true,
  'mail_smtpmode' => 'smtp',
  'mail_smtpsecure' => 'tls',
  'mail_sendmailmode' => 'smtp',
  'mail_from_address' => 'nextcloud',
  'mail_domain' => '***',
  'mail_smtpauthtype' => 'LOGIN',
  'mail_smtpauth' => 1,
  'mail_smtphost' => '***',
  'mail_smtpport' => '***',
  'mail_smtpname' => '***',
  'mail_smtppassword' => '***',
  'maintenance' => false,
  'trusted_proxies' =>
  array (
    0 => 'localhost',
  ),
  'overwriteprotocol' => 'https',
);

The output of your Apache/nginx/system log in /var/log/____:

There was nothing relevant in the /var/snap/nextcloud/current/apache/logs/error_log

Fixed for Nextcloud 20