FreshInstall on Debian9.3 fail on Dovecot

yes I read these posts before
no I don’t have gedit on my server but use hostnamectl set-hostname to be sure it is fine
no bind9 is not installed by default on debian9

the yunohost log is almost useless by saying to look inside himself

[FAIL] Installation of Yunohost packages failed
[INFO] Installation logs are available in /var/log/yunohost-installation_20180905_145432.log

but when I try to for the install and/or upgrade it point dovecot

apt upgrade
Reading package lists... Done
Building dependency tree
Reading state information... Done
Calculating upgrade... Done
0 upgraded, 0 newly installed, 0 to remove and 0 not upgraded.
9 not fully installed or removed.
After this operation, 0 B of additional disk space will be used.
Do you want to continue? [Y/n] y
Setting up dovecot-core (1:2.2.27-3+deb9u2) ...
Failed to allocate directory watch: Too many open files
Job for dovecot.service failed because of unavailable resources or another system error.
See "systemctl status dovecot.service" and "journalctl -xe" for details.
invoke-rc.d: initscript dovecot, action "start" failed.
* dovecot.service - Dovecot IMAP/POP3 email server
   Loaded: loaded (/lib/systemd/system/dovecot.service; enabled; vendor preset: enabled)
   Active: failed (Result: resources) since Wed 2018-09-05 15:03:20 UTC; 5ms ago
     Docs: man:dovecot(1)
           http://wiki2.dovecot.org/
  Process: 16081 ExecStart=/usr/sbin/dovecot (code=exited, status=0/SUCCESS)

Sep 05 15:03:20 yunohost systemd[1]: dovecot.service: Failed to set invocation ID on control group /system.slice/dovecot.service, ignoring: Operation not permitted
Sep 05 15:03:20 yunohost systemd[1]: Starting Dovecot IMAP/POP3 email server...
Sep 05 15:03:20 yunohost systemd[1]: dovecot.service: PID file /var/run/dovecot/master.pid not readable (yet?) after start: No such file or directory
Sep 05 15:03:20 yunohost systemd[1]: dovecot.service: Failed to set a watch for PID file /var/run/dovecot/master.pid: Too many open files
Sep 05 15:03:20 yunohost systemd[1]: Failed to start Dovecot IMAP/POP3 email server.
Sep 05 15:03:20 yunohost systemd[1]: dovecot.service: Unit entered failed state.
Sep 05 15:03:20 yunohost systemd[1]: dovecot.service: Failed with result 'resources'.
dpkg: error processing package dovecot-core (--configure):
 subprocess installed post-installation script returned error exit status 1
dpkg: dependency problems prevent configuration of dovecot-managesieved:
 dovecot-managesieved depends on dovecot-core (= 1:2.2.27-3+deb9u2); however:
  Package dovecot-core is not configured yet.

dpkg: error processing package dovecot-managesieved (--configure):
 dependency problems - leaving unconfigured
dpkg: dependency problems prevent configuration of dovecot-lmtpd:
 dovecot-lmtpd depends on dovecot-core (= 1:2.2.27-3+deb9u2); however:
  Package dovecot-core is not configured yet.

dpkg: error processing package dovecot-lmtpd (--configure):
 dependency problems - leaving unconfigured
dpkg: dependency problems prevent configuration of dovecot-ldap:
 dovecot-ldap depends on dovecot-core (= 1:2.2.27-3+deb9u2); however:
  Package dovecot-core is not configured yet.

dpkg: error processing package dovecot-ldap (--configure):
 dependency problems - leaving unconfigured
dpkg: dependency problems prevent configuration of dovecot-antispam:
 dovecot-antispam depends on dovecot-abi-2.2.abiv27; however:
  Package dovecot-abi-2.2.abiv27 is not installed.
  Package dovecot-core which provides dovecot-abi-2.2.abiv27 is not configured yet.

dpkg: error processing package dovecot-antispam (--configure):
 dependency problems - leaving unconfigured
dpkg: dependency problems prevent configuration of dovecot-sieve:
 dovecot-sieve depends on dovecot-core (= 1:2.2.27-3+deb9u2); however:
  Package dovecot-core is not configured yet.

dpkg: error processing package dovecot-sieve (--configure):
 dependency problems - leaving unconfigured
dpkg: dependency problems prevent configuration of dovecot-imapd:
 dovecot-imapd depends on dovecot-core (= 1:2.2.27-3+deb9u2); however:
  Package dovecot-core is not configured yet.

dpkg: error processing package dovecot-imapd (--configure):
 dependency problems - leaving unconfigured
dpkg: dependency problems prevent configuration of yunohost:
 yunohost depends on dovecot-ldap; however:
  Package dovecot-ldap is not configured yet.
 yunohost depends on dovecot-lmtpd; however:
  Package dovecot-lmtpd is not configured yet.
 yunohost depends on dovecot-managesieved; however:
  Package dovecot-managesieved is not configured yet.
 yunohost depends on dovecot-antispam; however:
  Package dovecot-antispam is not configured yet.

dpkg: error processing package yunohost (--configure):
 dependency problems - leaving unconfigured
dpkg: dependency problems prevent configuration of yunohost-admin:
 yunohost-admin depends on yunohost (>= 2.7.6); however:
  Package yunohost is not configured yet.

dpkg: error processing package yunohost-admin (--configure):
 dependency problems - leaving unconfigured
Errors were encountered while processing:
 dovecot-core
 dovecot-managesieved
 dovecot-lmtpd
 dovecot-ldap
 dovecot-antispam
 dovecot-sieve
 dovecot-imapd
 yunohost
 yunohost-admin
E: Sub-process /usr/bin/dpkg returned an error code (1)

Somebody experience this before and if yes, how I could fix it
thx

Jonathan

The relevant part is : Failed to set invocation ID on control group /system.slice/dovecot.service, ignoring: Operation not permitted
and has to do with the virtualization / container technology of your VPS or machine.

Do you know which technology is used by your machine ? (e.g. use the command systemd-detect-virt)

the yunohost log is almost useless by saying to look inside himself

Not sure what you mean … what’s the issue with having to look inside the log ?

systemd-detect-virt say lxc
i’m pretty sure you nail it
I found this : https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=843537