On upgrade: string too long on PostgreSQL DB call

On last upgrade on command line:

sudo -u www-data php occ upgrade -vv

Nextcloud or one of the apps require upgrade - only a limited number of commands are available
You may use your browser or the occ upgrade command to do the upgrade

2021-03-14T10:38:01+00:00 Repair step: Insert background jobs for all accounts
2021-03-14T10:38:01+00:00 Insert background jobs for all accounts

2021-03-14T10:38:01+00:00 Repair step: Create or update provisioned Mail accounts
2021-03-14T10:38:04+00:00 Doctrine\DBAL\Exception\DriverException: An exception occurred while executing a query: SQLSTATE[22001]: String data, right truncated: 7 ERREUR: valeur trop longue pour le type character varying(64)
2021-03-14T10:38:04+00:00 Update failed

My configuration:

  • OS : Debian 10
  • Nextcloud version: 21.0.0
  • Apache : 2.4.38-3+deb10u4
  • php: 7.3.27-1~deb10u1
  • DB: PostgreSQL 11.10-0+deb10u1
  • Users connected via OpenLDAP DB (about 200 logins)

The issue you are facing:
Nextcloud blocked

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

Steps to replicate it:

  1. sudo -u www-data php occ upgrade

The output of your Nextcloud log in Admin > Logging:

output of nextcloud.log:
. . .
{"reqId":"QDnC4d7gvIGWRlT6ReDS","level":0,"time":"2021-03-14T10:55:08+00:00","remoteAddr":"","user":"--","app":"user_ldap","method":"","url":"--","message":"readAttribute: cn=annie.huguet@teledetection.fr,ou=mails,dc=auth,dc=teledetection,dc=fr found","userAgent":"--","version":"21.0.0.18"}
{"reqId":"QDnC4d7gvIGWRlT6ReDS","level":0,"time":"2021-03-14T10:55:08+00:00","remoteAddr":"","user":"--","app":"user_ldap","method":"","url":"--","message":"initializing paged search for filter (&(objectClass=qmailUser)(|(accountStatus=active)(accountStatus=externe)(accountStatus=noaccess))), base cn=frederic.huynh@teledetection.fr,ou=mails,dc=auth,dc=teledetection,dc=fr, attr [\"\"], limit 500, offset 0","userAgent":"--","version":"21.0.0.18"}
{"reqId":"QDnC4d7gvIGWRlT6ReDS","level":0,"time":"2021-03-14T10:55:08+00:00","remoteAddr":"","user":"--","app":"user_ldap","method":"","url":"--","message":"Ready for a paged search","userAgent":"--","version":"21.0.0.18"}
{"reqId":"QDnC4d7gvIGWRlT6ReDS","level":0,"time":"2021-03-14T10:55:08+00:00","remoteAddr":"","user":"--","app":"user_ldap","method":"","url":"--","message":"readAttribute: cn=frederic.huynh@teledetection.fr,ou=mails,dc=auth,dc=teledetection,dc=fr found","userAgent":"--","version":"21.0.0.18"}
{"reqId":"QDnC4d7gvIGWRlT6ReDS","level":0,"time":"2021-03-14T10:55:08+00:00","remoteAddr":"","user":"--","app":"user_ldap","method":"","url":"--","message":"initializing paged search for filter (&(objectClass=qmailUser)(|(accountStatus=active)(accountStatus=externe)(accountStatus=noaccess))), base cn=jacques.iltis@teledetection.fr,ou=mails,dc=auth,dc=teledetection,dc=fr, attr [\"\"], limit 500, offset 0","userAgent":"--","version":"21.0.0.18"}
{"reqId":"QDnC4d7gvIGWRlT6ReDS","level":0,"time":"2021-03-14T10:55:08+00:00","remoteAddr":"","user":"--","app":"user_ldap","method":"","url":"--","message":"Ready for a paged search","userAgent":"--","version":"21.0.0.18"}
{"reqId":"QDnC4d7gvIGWRlT6ReDS","level":0,"time":"2021-03-14T10:55:08+00:00","remoteAddr":"","user":"--","app":"user_ldap","method":"","url":"--","message":"readAttribute: cn=jacques.iltis@teledetection.fr,ou=mails,dc=auth,dc=teledetection,dc=fr found","userAgent":"--","version":"21.0.0.18"}
{"reqId":"QDnC4d7gvIGWRlT6ReDS","level":0,"time":"2021-03-14T10:55:08+00:00","remoteAddr":"","user":"--","app":"user_ldap","method":"","url":"--","message":"initializing paged search for filter (&(objectClass=qmailUser)(|(accountStatus=active)(accountStatus=externe)(accountStatus=noaccess))), base cn=isabelle.altier@teledetection.fr,ou=mails,dc=auth,dc=teledetection,dc=fr, attr [\"\"], limit 500, offset 0","userAgent":"--","version":"21.0.0.18"}
{"reqId":"QDnC4d7gvIGWRlT6ReDS","level":0,"time":"2021-03-14T10:55:08+00:00","remoteAddr":"","user":"--","app":"user_ldap","method":"","url":"--","message":"Ready for a paged search","userAgent":"--","version":"21.0.0.18"}
{"reqId":"QDnC4d7gvIGWRlT6ReDS","level":0,"time":"2021-03-14T10:55:08+00:00","remoteAddr":"","user":"--","app":"user_ldap","method":"","url":"--","message":"readAttribute: cn=isabelle.altier@teledetection.fr,ou=mails,dc=auth,dc=teledetection,dc=fr found","userAgent":"--","version":"21.0.0.18"}
{"reqId":"QDnC4d7gvIGWRlT6ReDS","level":0,"time":"2021-03-14T10:55:08+00:00","remoteAddr":"","user":"--","app":"user_ldap","method":"","url":"--","message":"initializing paged search for filter (&(objectClass=qmailUser)(|(accountStatus=active)(accountStatus=externe)(accountStatus=noaccess))), base cn=jean-christophe.desconnets@teledetection.fr,ou=mails,dc=auth,dc=teledetection,dc=fr, attr [\"\"], limit 500, offset 0","userAgent":"--","version":"21.0.0.18"}
{"reqId":"QDnC4d7gvIGWRlT6ReDS","level":0,"time":"2021-03-14T10:55:08+00:00","remoteAddr":"","user":"--","app":"user_ldap","method":"","url":"--","message":"Ready for a paged search","userAgent":"--","version":"21.0.0.18"}
{"reqId":"QDnC4d7gvIGWRlT6ReDS","level":0,"time":"2021-03-14T10:55:08+00:00","remoteAddr":"","user":"--","app":"user_ldap","method":"","url":"--","message":"readAttribute: cn=jean-christophe.desconnets@teledetection.fr,ou=mails,dc=auth,dc=teledetection,dc=fr found","userAgent":"--","version":"21.0.0.18"}
{"reqId":"QDnC4d7gvIGWRlT6ReDS","level":3,"time":"2021-03-14T10:55:08+00:00","remoteAddr":"","user":"--","app":"core","method":"","url":"--","message":{"Exception":"Doctrine\\DBAL\\Exception\\DriverException","Message":"An exception occurred while executing a query: SQLSTATE[22001]: String data, right truncated: 7 ERREUR:  valeur trop longue pour le type character varying(64)","Code":7,"Trace":[{"file":"/var/www/nextcloud/3rdparty/doctrine/dbal/src/Connection.php","line":1728,"function":"convert","class":"Doctrine\\DBAL\\Driver\\API\\PostgreSQL\\ExceptionConverter","type":"->","args":[{"__class__":"Doctrine\\DBAL\\Driver\\PDO\\Exception"},{"__class__":"Doctrine\\DBAL\\Query"}]},{"file":"/var/www/nextcloud/3rdparty/doctrine/dbal/src/Connection.php","line":1667,"function":"handleDriverException","class":"Doctrine\\DBAL\\Connection","type":"->","args":[{"__class__":"Doctrine\\DBAL\\Driver\\PDO\\Exception"},{"__class__":"Doctrine\\DBAL\\Query"}]},{"file":"/var/www/nextcloud/3rdparty/doctrine/dbal/src/Connection.php","line":1146,"function":"convertExceptionDuringQuery","class":"Doctrine\\DBAL\\Connection","type":"->","args":[{"__class__":"Doctrine\\DBAL\\Driver\\PDO\\Exception"},"INSERT INTO \"oc_mail_accounts\" (\"user_id\", \"provisioned\", \"email\", \"name\", \"inbound_user\", \"inbound_host\", \"inbound_port\", \"inbound_ssl_mode\", \"outbound_user\", \"outbound_host\", \"outbound_port\", \"outbound_ssl_mode\") VALUES(?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?)",["ccee5600-f1b3-1039-81ac-71301b83afbe",true,"jean-christophe.desconnets@teledetection.fr","jean-christophe.desconnets@teledetection.fr (Jean-Christophe Desconnets)","jean-christophe.desconnets@teledetection.fr","imap.teledetection.fr",143,"none","jean-christophe.desconnets@teledetection.fr","smtp.teledetection.fr",465,"ssl"],[2,5,2,2,2,2,1,2,2,2,1,2]]},{"file":"/var/www/nextcloud/lib/private/DB/Connection.php","line":257,"function":"executeStatement","class":"Doctrine\\DBAL\\Connection","type":"->","args":["INSERT INTO \"oc_mail_accounts\" (\"user_id\", \"provisioned\", \"email\", \"name\", \"inbound_user\", \"inbound_host\", \"inbound_port\", \"inbound_ssl_mode\", \"outbound_user\", \"outbound_host\", \"outbound_port\", \"outbound_ssl_mode\") VALUES(?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?)",["ccee5600-f1b3-1039-81ac-71301b83afbe",true,"jean-christophe.desconnets@teledetection.fr","jean-christophe.desconnets@teledetection.fr (Jean-Christophe Desconnets)","jean-christophe.desconnets@teledetection.fr","imap.teledetection.fr",143,"none","jean-christophe.desconnets@teledetection.fr","smtp.teledetection.fr",465,"ssl"],[2,5,2,2,2,2,1,2,2,2,1,2]]},{"file":"/var/www/nextcloud/3rdparty/doctrine/dbal/src/Query/QueryBuilder.php","line":213,"function":"executeStatement","class":"OC\\DB\\Connection","type":"->","args":["INSERT INTO \"oc_mail_accounts\" (\"user_id\", \"provisioned\", \"email\", \"name\", \"inbound_user\", \"inbound_host\", \"inbound_port\", \"inbound_ssl_mode\", \"outbound_user\", \"outbound_host\", \"outbound_port\", \"outbound_ssl_mode\") VALUES(:dcValue1, :dcValue2, :dcValue3, :dcValue4, :dcValue5, :dcValue6, :dcValue7, :dcValue8, :dcValue9, :dcValue10, :dcValue11, :dcValue12)",{"dcValue1":"ccee5600-f1b3-1039-81ac-71301b83afbe","dcValue2":true,"dcValue3":"jean-christophe.desconnets@teledetection.fr","dcValue4":"jean-christophe.desconnets@teledetection.fr (Jean-Christophe Desconnets)","dcValue5":"jean-christophe.desconnets@teledetection.fr","dcValue6":"imap.teledetection.fr","dcValue7":143,"dcValue8":"none","dcValue9":"jean-christophe.desconnets@teledetection.fr","dcValue10":"smtp.teledetection.fr","dcValue11":465,"dcValue12":"ssl"},{"dcValue1":2,"dcValue2":5,"dcValue3":2,"dcValue4":2,"dcValue5":2,"dcValue6":2,"dcValue7":1,"dcValue8":2,"dcValue9":2,"dcValue10":2,"dcValue11":1,"dcValue12":2}]},{"file":"/var/www/nextcloud/lib/private/DB/QueryBuilder/QueryBuilder.php","line":286,"function":"execute","class":"Doctrine\\DBAL\\Query\\QueryBuilder","type":"->","args":[]},{"file":"/var/www/nextcloud/lib/public/AppFramework/Db/QBMapper.php","line":135,"function":"execute","class":"OC\\DB\\QueryBuilder\\QueryBuilder","type":"->","args":[]},{"file":"/var/www/nextcloud/apps/mail/lib/Service/Provisioning/Manager.php","line":90,"function":"insert","class":"OCP\\AppFramework\\Db\\QBMapper","type":"->","args":[{"id":null,"__class__":"OCA\\Mail\\Db\\MailAccount"}]},{"file":"/var/www/nextcloud/apps/mail/lib/Service/Provisioning/Manager.php","line":70,"function":"provisionSingleUser","class":"OCA\\Mail\\Service\\Provisioning\\Manager","type":"->","args":[{"__class__":"OCA\\Mail\\Service\\Provisioning\\Config"},"*** sensitive parameter replaced ***"]},{"file":"/var/www/nextcloud/lib/private/User/Manager.php","line":504,"function":"OCA\\Mail\\Service\\Provisioning\\{closure}","class":"OCA\\Mail\\Service\\Provisioning\\Manager","type":"->","args":["*** sensitive parameters replaced ***"]},{"file":"/var/www/nextcloud/apps/mail/lib/Service/Provisioning/Manager.php","line":72,"function":"callForAllUsers","class":"OC\\User\\Manager","type":"->","args":[{"__class__":"Closure"}]},{"file":"/var/www/nextcloud/apps/mail/lib/Migration/ProvisionAccounts.php","line":56,"function":"provision","class":"OCA\\Mail\\Service\\Provisioning\\Manager","type":"->","args":[{"__class__":"OCA\\Mail\\Service\\Provisioning\\Config"}]},{"file":"/var/www/nextcloud/lib/private/Repair.php","line":117,"function":"run","class":"OCA\\Mail\\Migration\\ProvisionAccounts","type":"->","args":[{"__class__":"OC\\Repair"}]},{"file":"/var/www/nextcloud/lib/private/legacy/OC_App.php","line":1054,"function":"run","class":"OC\\Repair","type":"->","args":[]},{"file":"/var/www/nextcloud/lib/private/legacy/OC_App.php","line":996,"function":"executeRepairSteps","class":"OC_App","type":"::","args":["*** sensitive parameter replaced ***",["OCA\\Mail\\Migration\\AddMissingMessageIds","OCA\\Mail\\Migration\\FixCollectedAddresses","OCA\\Mail\\Migration\\FixBackgroundJobs","OCA\\Mail\\Migration\\MakeItineraryExtractorExecutable","OCA\\Mail\\Migration\\MigrateProvisioningConfig","OCA\\Mail\\Migration\\AddSieveToProvisioningConfig","OCA\\Mail\\Migration\\ProvisionAccounts"]]},{"file":"/var/www/nextcloud/lib/private/Updater.php","line":340,"function":"updateApp","class":"OC_App","type":"::","args":["*** sensitive parameters replaced ***"]},{"file":"/var/www/nextcloud/lib/private/Updater.php","line":260,"function":"doAppUpgrade","class":"OC\\Updater","type":"->","args":[]},{"file":"/var/www/nextcloud/lib/private/Updater.php","line":132,"function":"doUpgrade","class":"OC\\Updater","type":"->","args":["21.0.0.18","21.0.0.18"]},{"file":"/var/www/nextcloud/core/Command/Upgrade.php","line":255,"function":"upgrade","class":"OC\\Updater","type":"->","args":[]},{"file":"/var/www/nextcloud/3rdparty/symfony/console/Command/Command.php","line":255,"function":"execute","class":"OC\\Core\\Command\\Upgrade","type":"->","args":[{"__class__":"Symfony\\Component\\Console\\Input\\ArgvInput"},{"__class__":"Symfony\\Component\\Console\\Output\\ConsoleOutput"}]},{"file":"/var/www/nextcloud/3rdparty/symfony/console/Application.php","line":1009,"function":"run","class":"Symfony\\Component\\Console\\Command\\Command","type":"->","args":[{"__class__":"Symfony\\Component\\Console\\Input\\ArgvInput"},{"__class__":"Symfony\\Component\\Console\\Output\\ConsoleOutput"}]},{"file":"/var/www/nextcloud/3rdparty/symfony/console/Application.php","line":273,"function":"doRunCommand","class":"Symfony\\Component\\Console\\Application","type":"->","args":[{"installer":{"__class__":"OC\\Installer"},"__class__":"OC\\Core\\Command\\Upgrade"},{"__class__":"Symfony\\Component\\Console\\Input\\ArgvInput"},{"__class__":"Symfony\\Component\\Console\\Output\\ConsoleOutput"}]},{"file":"/var/www/nextcloud/3rdparty/symfony/console/Application.php","line":149,"function":"doRun","class":"Symfony\\Component\\Console\\Application","type":"->","args":[{"__class__":"Symfony\\Component\\Console\\Input\\ArgvInput"},{"__class__":"Symfony\\Component\\Console\\Output\\ConsoleOutput"}]},{"file":"/var/www/nextcloud/lib/private/Console/Application.php","line":215,"function":"run","class":"Symfony\\Component\\Console\\Application","type":"->","args":[{"__class__":"Symfony\\Component\\Console\\Input\\ArgvInput"},{"__class__":"Symfony\\Component\\Console\\Output\\ConsoleOutput"}]},{"file":"/var/www/nextcloud/console.php","line":100,"function":"run","class":"OC\\Console\\Application","type":"->","args":[]},{"file":"/var/www/nextcloud/occ","line":11,"args":["/var/www/nextcloud/console.php"],"function":"require_once"}],"File":"/var/www/nextcloud/3rdparty/doctrine/dbal/src/Driver/API/PostgreSQL/ExceptionConverter.php","Line":83,"Previous":{"Exception":"Doctrine\\DBAL\\Driver\\PDO\\Exception","Message":"SQLSTATE[22001]: String data, right truncated: 7 ERREUR:  valeur trop longue pour le type character varying(64)","Code":7,"Trace":[{"file":"/var/www/nextcloud/3rdparty/doctrine/dbal/src/Driver/PDO/Statement.php","line":84,"function":"new","class":"Doctrine\\DBAL\\Driver\\PDO\\Exception","type":"::","args":[{"errorInfo":["22001",7,"ERREUR:  valeur trop longue pour le type character varying(64)"],"__class__":"PDOException"}]},{"file":"/var/www/nextcloud/3rdparty/doctrine/dbal/src/Connection.php","line":1136,"function":"execute","class":"Doctrine\\DBAL\\Driver\\PDO\\Statement","type":"->","args":[]},{"file":"/var/www/nextcloud/lib/private/DB/Connection.php","line":257,"function":"executeStatement","class":"Doctrine\\DBAL\\Connection","type":"->","args":["INSERT INTO \"oc_mail_accounts\" (\"user_id\", \"provisioned\", \"email\", \"name\", \"inbound_user\", \"inbound_host\", \"inbound_port\", \"inbound_ssl_mode\", \"outbound_user\", \"outbound_host\", \"outbound_port\", \"outbound_ssl_mode\") VALUES(?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?)",["ccee5600-f1b3-1039-81ac-71301b83afbe",true,"jean-christophe.desconnets@teledetection.fr","jean-christophe.desconnets@teledetection.fr (Jean-Christophe Desconnets)","jean-christophe.desconnets@teledetection.fr","imap.teledetection.fr",143,"none","jean-christophe.desconnets@teledetection.fr","smtp.teledetection.fr",465,"ssl"],[2,5,2,2,2,2,1,2,2,2,1,2]]},{"file":"/var/www/nextcloud/3rdparty/doctrine/dbal/src/Query/QueryBuilder.php","line":213,"function":"executeStatement","class":"OC\\DB\\Connection","type":"->","args":["INSERT INTO \"oc_mail_accounts\" (\"user_id\", \"provisioned\", \"email\", \"name\", \"inbound_user\", \"inbound_host\", \"inbound_port\", \"inbound_ssl_mode\", \"outbound_user\", \"outbound_host\", \"outbound_port\", \"outbound_ssl_mode\") VALUES(:dcValue1, :dcValue2, :dcValue3, :dcValue4, :dcValue5, :dcValue6, :dcValue7, :dcValue8, :dcValue9, :dcValue10, :dcValue11, :dcValue12)",{"dcValue1":"ccee5600-f1b3-1039-81ac-71301b83afbe","dcValue2":true,"dcValue3":"jean-christophe.desconnets@teledetection.fr","dcValue4":"jean-christophe.desconnets@teledetection.fr (Jean-Christophe Desconnets)","dcValue5":"jean-christophe.desconnets@teledetection.fr","dcValue6":"imap.teledetection.fr","dcValue7":143,"dcValue8":"none","dcValue9":"jean-christophe.desconnets@teledetection.fr","dcValue10":"smtp.teledetection.fr","dcValue11":465,"dcValue12":"ssl"},{"dcValue1":2,"dcValue2":5,"dcValue3":2,"dcValue4":2,"dcValue5":2,"dcValue6":2,"dcValue7":1,"dcValue8":2,"dcValue9":2,"dcValue10":2,"dcValue11":1,"dcValue12":2}]},{"file":"/var/www/nextcloud/lib/private/DB/QueryBuilder/QueryBuilder.php","line":286,"function":"execute","class":"Doctrine\\DBAL\\Query\\QueryBuilder","type":"->","args":[]},{"file":"/var/www/nextcloud/lib/public/AppFramework/Db/QBMapper.php","line":135,"function":"execute","class":"OC\\DB\\QueryBuilder\\QueryBuilder","type":"->","args":[]},{"file":"/var/www/nextcloud/apps/mail/lib/Service/Provisioning/Manager.php","line":90,"function":"insert","class":"OCP\\AppFramework\\Db\\QBMapper","type":"->","args":[{"id":null,"__class__":"OCA\\Mail\\Db\\MailAccount"}]},{"file":"/var/www/nextcloud/apps/mail/lib/Service/Provisioning/Manager.php","line":70,"function":"provisionSingleUser","class":"OCA\\Mail\\Service\\Provisioning\\Manager","type":"->","args":[{"__class__":"OCA\\Mail\\Service\\Provisioning\\Config"},"*** sensitive parameter replaced ***"]},{"file":"/var/www/nextcloud/lib/private/User/Manager.php","line":504,"function":"OCA\\Mail\\Service\\Provisioning\\{closure}","class":"OCA\\Mail\\Service\\Provisioning\\Manager","type":"->","args":["*** sensitive parameters replaced ***"]},{"file":"/var/www/nextcloud/apps/mail/lib/Service/Provisioning/Manager.php","line":72,"function":"callForAllUsers","class":"OC\\User\\Manager","type":"->","args":[{"__class__":"Closure"}]},{"file":"/var/www/nextcloud/apps/mail/lib/Migration/ProvisionAccounts.php","line":56,"function":"provision","class":"OCA\\Mail\\Service\\Provisioning\\Manager","type":"->","args":[{"__class__":"OCA\\Mail\\Service\\Provisioning\\Config"}]},{"file":"/var/www/nextcloud/lib/private/Repair.php","line":117,"function":"run","class":"OCA\\Mail\\Migration\\ProvisionAccounts","type":"->","args":[{"__class__":"OC\\Repair"}]},{"file":"/var/www/nextcloud/lib/private/legacy/OC_App.php","line":1054,"function":"run","class":"OC\\Repair","type":"->","args":[]},{"file":"/var/www/nextcloud/lib/private/legacy/OC_App.php","line":996,"function":"executeRepairSteps","class":"OC_App","type":"::","args":["*** sensitive parameter replaced ***",["OCA\\Mail\\Migration\\AddMissingMessageIds","OCA\\Mail\\Migration\\FixCollectedAddresses","OCA\\Mail\\Migration\\FixBackgroundJobs","OCA\\Mail\\Migration\\MakeItineraryExtractorExecutable","OCA\\Mail\\Migration\\MigrateProvisioningConfig","OCA\\Mail\\Migration\\AddSieveToProvisioningConfig","OCA\\Mail\\Migration\\ProvisionAccounts"]]},{"file":"/var/www/nextcloud/lib/private/Updater.php","line":340,"function":"updateApp","class":"OC_App","type":"::","args":["*** sensitive parameters replaced ***"]},{"file":"/var/www/nextcloud/lib/private/Updater.php","line":260,"function":"doAppUpgrade","class":"OC\\Updater","type":"->","args":[]},{"file":"/var/www/nextcloud/lib/private/Updater.php","line":132,"function":"doUpgrade","class":"OC\\Updater","type":"->","args":["21.0.0.18","21.0.0.18"]},{"file":"/var/www/nextcloud/core/Command/Upgrade.php","line":255,"function":"upgrade","class":"OC\\Updater","type":"->","args":[]},{"file":"/var/www/nextcloud/3rdparty/symfony/console/Command/Command.php","line":255,"function":"execute","class":"OC\\Core\\Command\\Upgrade","type":"->","args":[{"__class__":"Symfony\\Component\\Console\\Input\\ArgvInput"},{"__class__":"Symfony\\Component\\Console\\Output\\ConsoleOutput"}]},{"file":"/var/www/nextcloud/3rdparty/symfony/console/Application.php","line":1009,"function":"run","class":"Symfony\\Component\\Console\\Command\\Command","type":"->","args":[{"__class__":"Symfony\\Component\\Console\\Input\\ArgvInput"},{"__class__":"Symfony\\Component\\Console\\Output\\ConsoleOutput"}]},{"file":"/var/www/nextcloud/3rdparty/symfony/console/Application.php","line":273,"function":"doRunCommand","class":"Symfony\\Component\\Console\\Application","type":"->","args":[{"installer":{"__class__":"OC\\Installer"},"__class__":"OC\\Core\\Command\\Upgrade"},{"__class__":"Symfony\\Component\\Console\\Input\\ArgvInput"},{"__class__":"Symfony\\Component\\Console\\Output\\ConsoleOutput"}]},{"file":"/var/www/nextcloud/3rdparty/symfony/console/Application.php","line":149,"function":"doRun","class":"Symfony\\Component\\Console\\Application","type":"->","args":[{"__class__":"Symfony\\Component\\Console\\Input\\ArgvInput"},{"__class__":"Symfony\\Component\\Console\\Output\\ConsoleOutput"}]},{"file":"/var/www/nextcloud/lib/private/Console/Application.php","line":215,"function":"run","class":"Symfony\\Component\\Console\\Application","type":"->","args":[{"__class__":"Symfony\\Component\\Console\\Input\\ArgvInput"},{"__class__":"Symfony\\Component\\Console\\Output\\ConsoleOutput"}]},{"file":"/var/www/nextcloud/console.php","line":100,"function":"run","class":"OC\\Console\\Application","type":"->","args":[]},{"file":"/var/www/nextcloud/occ","line":11,"args":["/var/www/nextcloud/console.php"],"function":"require_once"}],"File":"/var/www/nextcloud/3rdparty/doctrine/dbal/src/Driver/PDO/Exception.php","Line":26,"Previous":{"Exception":"PDOException","Message":"SQLSTATE[22001]: String data, right truncated: 7 ERREUR:  valeur trop longue pour le type character varying(64)","Code":"22001","Trace":[{"file":"/var/www/nextcloud/3rdparty/doctrine/dbal/src/Driver/PDO/Statement.php","line":82,"function":"execute","class":"PDOStatement","type":"->","args":[null]},{"file":"/var/www/nextcloud/3rdparty/doctrine/dbal/src/Connection.php","line":1136,"function":"execute","class":"Doctrine\\DBAL\\Driver\\PDO\\Statement","type":"->","args":[]},{"file":"/var/www/nextcloud/lib/private/DB/Connection.php","line":257,"function":"executeStatement","class":"Doctrine\\DBAL\\Connection","type":"->","args":["INSERT INTO \"oc_mail_accounts\" (\"user_id\", \"provisioned\", \"email\", \"name\", \"inbound_user\", \"inbound_host\", \"inbound_port\", \"inbound_ssl_mode\", \"outbound_user\", \"outbound_host\", \"outbound_port\", \"outbound_ssl_mode\") VALUES(?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?)",["ccee5600-f1b3-1039-81ac-71301b83afbe",true,"jean-christophe.desconnets@teledetection.fr","jean-christophe.desconnets@teledetection.fr (Jean-Christophe Desconnets)","jean-christophe.desconnets@teledetection.fr","imap.teledetection.fr",143,"none","jean-christophe.desconnets@teledetection.fr","smtp.teledetection.fr",465,"ssl"],[2,5,2,2,2,2,1,2,2,2,1,2]]},{"file":"/var/www/nextcloud/3rdparty/doctrine/dbal/src/Query/QueryBuilder.php","line":213,"function":"executeStatement","class":"OC\\DB\\Connection","type":"->","args":["INSERT INTO \"oc_mail_accounts\" (\"user_id\", \"provisioned\", \"email\", \"name\", \"inbound_user\", \"inbound_host\", \"inbound_port\", \"inbound_ssl_mode\", \"outbound_user\", \"outbound_host\", \"outbound_port\", \"outbound_ssl_mode\") VALUES(:dcValue1, :dcValue2, :dcValue3, :dcValue4, :dcValue5, :dcValue6, :dcValue7, :dcValue8, :dcValue9, :dcValue10, :dcValue11, :dcValue12)",{"dcValue1":"ccee5600-f1b3-1039-81ac-71301b83afbe","dcValue2":true,"dcValue3":"jean-christophe.desconnets@teledetection.fr","dcValue4":"jean-christophe.desconnets@teledetection.fr (Jean-Christophe Desconnets)","dcValue5":"jean-christophe.desconnets@teledetection.fr","dcValue6":"imap.teledetection.fr","dcValue7":143,"dcValue8":"none","dcValue9":"jean-christophe.desconnets@teledetection.fr","dcValue10":"smtp.teledetection.fr","dcValue11":465,"dcValue12":"ssl"},{"dcValue1":2,"dcValue2":5,"dcValue3":2,"dcValue4":2,"dcValue5":2,"dcValue6":2,"dcValue7":1,"dcValue8":2,"dcValue9":2,"dcValue10":2,"dcValue11":1,"dcValue12":2}]},{"file":"/var/www/nextcloud/lib/private/DB/QueryBuilder/QueryBuilder.php","line":286,"function":"execute","class":"Doctrine\\DBAL\\Query\\QueryBuilder","type":"->","args":[]},{"file":"/var/www/nextcloud/lib/public/AppFramework/Db/QBMapper.php","line":135,"function":"execute","class":"OC\\DB\\QueryBuilder\\QueryBuilder","type":"->","args":[]},{"file":"/var/www/nextcloud/apps/mail/lib/Service/Provisioning/Manager.php","line":90,"function":"insert","class":"OCP\\AppFramework\\Db\\QBMapper","type":"->","args":[{"id":null,"__class__":"OCA\\Mail\\Db\\MailAccount"}]},{"file":"/var/www/nextcloud/apps/mail/lib/Service/Provisioning/Manager.php","line":70,"function":"provisionSingleUser","class":"OCA\\Mail\\Service\\Provisioning\\Manager","type":"->","args":[{"__class__":"OCA\\Mail\\Service\\Provisioning\\Config"},"*** sensitive parameter replaced ***"]},{"file":"/var/www/nextcloud/lib/private/User/Manager.php","line":504,"function":"OCA\\Mail\\Service\\Provisioning\\{closure}","class":"OCA\\Mail\\Service\\Provisioning\\Manager","type":"->","args":["*** sensitive parameters replaced ***"]},{"file":"/var/www/nextcloud/apps/mail/lib/Service/Provisioning/Manager.php","line":72,"function":"callForAllUsers","class":"OC\\User\\Manager","type":"->","args":[{"__class__":"Closure"}]},{"file":"/var/www/nextcloud/apps/mail/lib/Migration/ProvisionAccounts.php","line":56,"function":"provision","class":"OCA\\Mail\\Service\\Provisioning\\Manager","type":"->","args":[{"__class__":"OCA\\Mail\\Service\\Provisioning\\Config"}]},{"file":"/var/www/nextcloud/lib/private/Repair.php","line":117,"function":"run","class":"OCA\\Mail\\Migration\\ProvisionAccounts","type":"->","args":[{"__class__":"OC\\Repair"}]},{"file":"/var/www/nextcloud/lib/private/legacy/OC_App.php","line":1054,"function":"run","class":"OC\\Repair","type":"->","args":[]},{"file":"/var/www/nextcloud/lib/private/legacy/OC_App.php","line":996,"function":"executeRepairSteps","class":"OC_App","type":"::","args":["*** sensitive parameter replaced ***",["OCA\\Mail\\Migration\\AddMissingMessageIds","OCA\\Mail\\Migration\\FixCollectedAddresses","OCA\\Mail\\Migration\\FixBackgroundJobs","OCA\\Mail\\Migration\\MakeItineraryExtractorExecutable","OCA\\Mail\\Migration\\MigrateProvisioningConfig","OCA\\Mail\\Migration\\AddSieveToProvisioningConfig","OCA\\Mail\\Migration\\ProvisionAccounts"]]},{"file":"/var/www/nextcloud/lib/private/Updater.php","line":340,"function":"updateApp","class":"OC_App","type":"::","args":["*** sensitive parameters replaced ***"]},{"file":"/var/www/nextcloud/lib/private/Updater.php","line":260,"function":"doAppUpgrade","class":"OC\\Updater","type":"->","args":[]},{"file":"/var/www/nextcloud/lib/private/Updater.php","line":132,"function":"doUpgrade","class":"OC\\Updater","type":"->","args":["21.0.0.18","21.0.0.18"]},{"file":"/var/www/nextcloud/core/Command/Upgrade.php","line":255,"function":"upgrade","class":"OC\\Updater","type":"->","args":[]},{"file":"/var/www/nextcloud/3rdparty/symfony/console/Command/Command.php","line":255,"function":"execute","class":"OC\\Core\\Command\\Upgrade","type":"->","args":[{"__class__":"Symfony\\Component\\Console\\Input\\ArgvInput"},{"__class__":"Symfony\\Component\\Console\\Output\\ConsoleOutput"}]},{"file":"/var/www/nextcloud/3rdparty/symfony/console/Application.php","line":1009,"function":"run","class":"Symfony\\Component\\Console\\Command\\Command","type":"->","args":[{"__class__":"Symfony\\Component\\Console\\Input\\ArgvInput"},{"__class__":"Symfony\\Component\\Console\\Output\\ConsoleOutput"}]},{"file":"/var/www/nextcloud/3rdparty/symfony/console/Application.php","line":273,"function":"doRunCommand","class":"Symfony\\Component\\Console\\Application","type":"->","args":[{"installer":{"__class__":"OC\\Installer"},"__class__":"OC\\Core\\Command\\Upgrade"},{"__class__":"Symfony\\Component\\Console\\Input\\ArgvInput"},{"__class__":"Symfony\\Component\\Console\\Output\\ConsoleOutput"}]},{"file":"/var/www/nextcloud/3rdparty/symfony/console/Application.php","line":149,"function":"doRun","class":"Symfony\\Component\\Console\\Application","type":"->","args":[{"__class__":"Symfony\\Component\\Console\\Input\\ArgvInput"},{"__class__":"Symfony\\Component\\Console\\Output\\ConsoleOutput"}]},{"file":"/var/www/nextcloud/lib/private/Console/Application.php","line":215,"function":"run","class":"Symfony\\Component\\Console\\Application","type":"->","args":[{"__class__":"Symfony\\Component\\Console\\Input\\ArgvInput"},{"__class__":"Symfony\\Component\\Console\\Output\\ConsoleOutput"}]},{"file":"/var/www/nextcloud/console.php","line":100,"function":"run","class":"OC\\Console\\Application","type":"->","args":[]},{"file":"/var/www/nextcloud/occ","line":11,"args":["/var/www/nextcloud/console.php"],"function":"require_once"}],"File":"/var/www/nextcloud/3rdparty/doctrine/dbal/src/Driver/PDO/Statement.php","Line":82}},"CustomMessage":"--"},"userAgent":"--","version":"21.0.0.18"}
{"reqId":"QDnC4d7gvIGWRlT6ReDS","level":3,"time":"2021-03-14T10:55:08+00:00","remoteAddr":"","user":"--","app":"updater","method":"","url":"--","message":"\\OC\\Updater::failure: Doctrine\\DBAL\\Exception\\DriverException: An exception occurred while executing a query: SQLSTATE[22001]: String data, right truncated: 7 ERREUR:  valeur trop longue pour le type character varying(64)","userAgent":"--","version":"21.0.0.18"}
{"reqId":"QDnC4d7gvIGWRlT6ReDS","level":3,"time":"2021-03-14T10:55:08+00:00","remoteAddr":"","user":"--","app":"updater","method":"","url":"--","message":"\\OC\\Updater::updateEnd: Update failed","userAgent":"--","version":"21.0.0.18"}
{"reqId":"QDnC4d7gvIGWRlT6ReDS","level":1,"time":"2021-03-14T10:55:08+00:00","remoteAddr":"","user":"--","app":"updater","method":"","url":"--","message":"\\OC\\Updater::maintenanceActive: Maintenance mode is kept active","userAgent":"--","version":"21.0.0.18"}
{"reqId":"QDnC4d7gvIGWRlT6ReDS","level":1,"time":"2021-03-14T10:55:08+00:00","remoteAddr":"","user":"--","app":"updater","method":"","url":"--","message":"\\OC\\Updater::resetLogLevel: Reset log level to Warning(2)","userAgent":"--","version":"21.0.0.18"}

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

<?php
$CONFIG = array (
  'instanceid' => 'ocu658p3qi16',
  'passwordsalt' => 'XXXXXXXXX',
  'secret' => 'YYYYYYYYY',
  'trusted_domains' => 
  array (
    0 => 'nubes.teledetection.fr',
  ),
  'datadirectory' => '/NextCloud_Donnees',
  'dbtype' => 'pgsql',
  'version' => '21.0.0.18',
  'overwrite.cli.url' => 'https://nubes.teledetection.fr',
  'dbname' => 'nextcloud',
  'dbhost' => 'localhost:5432',
  'dbport' => '',
  'dbtableprefix' => 'oc_',
  'dbuser' => 'nextcloud',
  'dbpassword' => 'ZZZZZZZZZZZZZZZ',
  'installed' => true,
  'memcache.local' => '\\OC\\Memcache\\Redis',
  'memcache.locking' => '\\OC\\Memcache\\Redis',
  'redis' => 
  array (
    'host' => 'localhost',
    'port' => 6379,
  ),
  'default_phone_region' => 'FX',
  'ldapProviderFactory' => 'OCA\\User_LDAP\\LDAPProviderFactory',
  'mail_smtpmode' => 'sendmail',
  'mail_sendmailmode' => 'smtp',
  'mail_from_address' => 'admin_nubes',
  'mail_domain' => 'teledetection.fr',
  'maintenance' => true,
  'loglevel' => 2,
);

Thanks for your help