Invalid byte sequence for encoding "UTF8": 0xd1 0x5f (don't open Administration privileges, Users and groups))

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:

Hello everyone. A disaster has happened I can’t understand what the reason is they don’t open
Administration privileges, Users and groups are not added, there is also no option to select. I’ve been suffering for 3 days, I can’t figure out what the problem is.

Nextcloud version Nextcloud Hub 3 (25.0.3)
Operating system and version (eg, Ubuntu 20.04.5) : Ubuntu 20.04.5
Apache or nginx version (eg, Apache 2.4.25): Apache 2.4.41
PHP version (eg, 7.4): PHP 7.4.3

The issue you are facing:

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

Steps to replicate it:

When open Users internal server error

The output of your Nextcloud log in Admin > Logging:

[no app in context] Error: Doctrine\DBAL\Exception\DriverException: An exception occurred while executing a query: SQLSTATE[22021]: Character not in repertoire: 7 ERROR:  invalid byte sequence for encoding "UTF8": 0xd1 0x5f at <<closure>>

 0. /var/www/nextcloud/3rdparty/doctrine/dbal/src/Connection.php line 1780
    Doctrine\DBAL\Driver\API\PostgreSQL\ExceptionConverter->convert()
 1. /var/www/nextcloud/3rdparty/doctrine/dbal/src/Connection.php line 1719
    Doctrine\DBAL\Connection->handleDriverException()
 2. /var/www/nextcloud/3rdparty/doctrine/dbal/src/Connection.php line 1067
    Doctrine\DBAL\Connection->convertExceptionDuringQuery()
 3. /var/www/nextcloud/lib/private/DB/Connection.php line 261
    Doctrine\DBAL\Connection->executeQuery()
 4. /var/www/nextcloud/3rdparty/doctrine/dbal/src/Query/QueryBuilder.php line 345
    OC\DB\Connection->executeQuery()
 5. /var/www/nextcloud/lib/private/DB/QueryBuilder/QueryBuilder.php line 281
    Doctrine\DBAL\Query\QueryBuilder->execute()
 6. /var/www/nextcloud/lib/private/Group/Database.php line 461
    OC\DB\QueryBuilder\QueryBuilder->execute()
 7. /var/www/nextcloud/lib/private/Group/Database.php line 469
    OC\Group\Database->getDisplayName()
 8. /var/www/nextcloud/lib/private/Group/Manager.php line 181
    OC\Group\Database->getGroupDetails()
 9. /var/www/nextcloud/lib/private/Group/Manager.php line 169
    OC\Group\Manager->getGroupObject()
10. /var/www/nextcloud/lib/private/Group/Manager.php line 205
    OC\Group\Manager->get()
11. /var/www/nextcloud/apps/user_ldap/lib/Access.php line 810
    OC\Group\Manager->groupExists()
12. /var/www/nextcloud/apps/user_ldap/lib/Access.php line 837
    OCA\User_LDAP\Access->_createAltInternalOwnCloudNameForGroups()
13. /var/www/nextcloud/apps/user_ldap/lib/Access.php line 601
    OCA\User_LDAP\Access->createAltInternalOwnCloudName()
14. /var/www/nextcloud/apps/user_ldap/lib/Access.php line 944
    OCA\User_LDAP\Access->dn2ocname()
15. <<closure>>
    OCA\User_LDAP\Access->OCA\User_LDAP\{closure}("*** sensitive parameters replaced ***")
16. /var/www/nextcloud/apps/user_ldap/lib/Access.php line 949
    array_walk()
17. /var/www/nextcloud/apps/user_ldap/lib/Group_LDAP.php line 1132
    OCA\User_LDAP\Access->fetchListOfGroups()
18. /var/www/nextcloud/apps/user_ldap/lib/Group_Proxy.php line 265
    OCA\User_LDAP\Group_LDAP->getGroups()
19. /var/www/nextcloud/lib/private/Group/Manager.php line 241
    OCA\User_LDAP\Group_Proxy->getGroups()
20. /var/www/nextcloud/apps/provisioning_api/lib/Controller/GroupsController.php line 110
    OC\Group\Manager->search()
21. /var/www/nextcloud/lib/private/AppFramework/Http/Dispatcher.php line 225
    OCA\Provisioning_API\Controller\GroupsController->getGroupsDetails()
22. /var/www/nextcloud/lib/private/AppFramework/Http/Dispatcher.php line 133
    OC\AppFramework\Http\Dispatcher->executeController()
23. /var/www/nextcloud/lib/private/AppFramework/App.php line 172
    OC\AppFramework\Http\Dispatcher->dispatch()
24. /var/www/nextcloud/lib/private/Route/Router.php line 298
    OC\AppFramework\App::main()
25. /var/www/nextcloud/ocs/v1.php line 63
    OC\Route\Router->match()
26. /var/www/nextcloud/ocs/v2.php line 23
    require_once("/var/www/nextcloud/ocs/v1.php")

GET /ocs/v2.php/cloud/groups/details
from 10.89.21.45 by webadmin at 2023-02-23T18:24:17+03:00

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

Exception":">{"reqId":"YyILdJZ1v103ud2dj2sr","level":3,"time":"2023-02-23T16:05:09+03:00","remoteAddr":"","user":"--","app":"core","method":"","url":"--","message":"
 Error while running background job (class: OCA\\User_LDAP\\Jobs\\UpdateGroups, arguments: )","userAgent":"--","version":"25.0.3.2","
 Exception":{"
 Exception":">{"reqId":"dXukC1wRBNaXM6ELm3GL","level":3,"time":"2023-02-23T16:32:42+03:00","remoteAddr":"10.89.21.45","user":"webadmin","app":"no app in context","method":"GET","url":"/ocs/v2.php/cloud/groups/details","message":"An exception occurred while executing a query: SQLSTATE[22021]: Character not in repertoire: 7>{"reqId":"4n7CmX2LwFvnoOtseJbz","level":3,"time":"2023-02-23T16:32:58+03:00","remoteAddr":"10.89.21.45","user":"webadmin","app":"PHP","method":"GET","url":"/apps/groupfolders/delegation/groups","message":"Undefined offset: 7 at /var/www/nextcloud/lib/private/AppFramework/Http.php#128","userAgent":"Mozilla/5.>{"reqId":"o9PO7OfLa1heQN6BQxUV","level":3,"time":"2023-02-23T16:32:59+03:00","remoteAddr":"10.89.21.45","user":"webadmin","app":"PHP","method":"GET","url":"/apps/groupfolders/delegation/groups","message":"Undefined offset: 7 at /var/www/nextcloud/lib/private/AppFramework/Http.php#128","userAgent":"Mozilla/5.>{"reqId":"vQKqynVwXxTsFhXHpvi3","level":3,"time":"2023-02-23T16:33:00+03:00","remoteAddr":"10.89.21.45","user":"webadmin","app":"PHP","method":"GET","url":"/apps/groupfolders/delegation/groups","message":"Undefined offset: 7 at /var/www/nextcloud/lib/private/AppFramework/Http.php#128","userAgent":"Mozilla/5.>{"reqId":"bwYqQvPruuoWMhV3nIga","level":3,"time":"2023-02-23T16:33:21+03:00","remoteAddr":"10.89.21.45","user":"webadmin","app":"index","method":"GET","url":"/settings/users","message":"An exception occurred while executing a query: SQLSTATE[22021]: Character not in repertoire: 7 ERROR:  invalid byte sequenc>{"reqId":"IHfqezRAQaXXW7v5mtmv","level":3,"time":"2023-02-23T17:10:10+03:00","remoteAddr":"","user":"--","app":"core","method":"","url":"--","message":"
 Error while running background job (class: OCA\\User_LDAP\\Jobs\\UpdateGroups, arguments: )","userAgent":"--","version":"25.0.3.2","
 Exception":{"
 Exception":">

postgre sql log

2023-02-22 11:22:28.600 UTC [1325047] ncadmin@nextcloud_db DETAIL:  parameters: $1 = 'E6E919A7-B0C4-4235-9980-17FA67E1E053'

2023-02-22 11:22:28.600 UTC [1325047] ncadmin@nextcloud_db LOG:  duration: 0.076 ms  execute <unnamed>:

                                SELECT "owncloud_name"

                                FROM "oc_ldap_group_mapping"

                                WHERE "directory_uuid" = $1

 

2023-02-22 11:22:28.600 UTC [1325047] ncadmin@nextcloud_db DETAIL:  parameters: $1 = 'E6E919A7-B0C4-4235-9980-17FA67E1E053'

2023-02-22 11:22:28.601 UTC [1325047] ncadmin@nextcloud_db LOG:  duration: 0.052 ms  parse <unnamed>: SELECT "displayname" FROM "oc_groups" WHERE "gid" = $1

2023-02-22 11:22:28.601 UTC [1325047] ncadmin@nextcloud_db LOG:  duration: 0.099 ms  bind <unnamed>: SELECT "displayname" FROM "oc_groups" WHERE "gid" = $1

2023-02-22 11:22:28.601 UTC [1325047] ncadmin@nextcloud_db DETAIL:  parameters: $1 = 'Пользователи системного монитора'

2023-02-22 11:22:28.601 UTC [1325047] ncadmin@nextcloud_db LOG:  duration: 0.060 ms  execute <unnamed>: SELECT "displayname" FROM "oc_groups" WHERE "gid" = $1

2023-02-22 11:22:28.601 UTC [1325047] ncadmin@nextcloud_db DETAIL:  parameters: $1 = 'Пользователи системного монитора'

2023-02-22 11:22:28.602 UTC [1325047] ncadmin@nextcloud_db LOG:  duration: 0.053 ms  parse <unnamed>:

                                SELECT "owncloud_name"

                                FROM "oc_ldap_group_mapping"

                                WHERE "owncloud_name" LIKE $1

 

2023-02-22 11:22:28.602 UTC [1325047] ncadmin@nextcloud_db ERROR:  invalid byte sequence for encoding "UTF8": 0xd1 0x5f

2023-02-22 11:22:28.602 UTC [1325047] ncadmin@nextcloud_db STATEMENT:

                                SELECT "owncloud_name"

                                FROM "oc_ldap_group_mapping"

                                WHERE "owncloud_name" LIKE $1

PASTE HERE


Output errors in nextcloud.log in /var/www/ or as admin user in top right menu, filtering for errors. Use a pastebin service if necessary.

PASTE HERE

Please tell me at least where to look for the problem?

pls anyone can tell you what to do?

hello @Kirill1 welcome to the forum :handshake:

Please fill the support form update your post. At least this will show potentially affected other users which versions and config is affected.

I’m sorry no good idea. the error is not common, likely some update happened…

there are two reports regarding mail app on github

from your logs it looks like your are using LDAP and groupfolders. there was a thread related to admin group issue with LDAP and groupfolders…

hope this helps.

Thanks for the reply, I’ve added the info. I tried to add again everyone from ldap. Create new administrators but nothing helped. I don’t even know where to look or what to do.

If you know when the disaster started try to review what happened short before… DB update, some system change etc…

For me the error looks like the DB doesn’t like Cyrillic group name. As $1 parameter to the DB query looks good (not malformed/bad encoded) most promising strategy in my eyes is to double check if there is something wrong with the DB server - maybe UTF8 support is lost somehow…

Maybe this helps: U137: Invalid byte sequence for encoding · pganalyze

thanks for the answer.
I found more such problems, maybe because of this, the groups do not work

{“reqId”:“vqXVL5ccBrTYSVRqB8pz”,“level”:3,“time”:“2023-02-27T12:10:10+03:00”,“remoteAddr”:“”,“user”:“–”,“app”:“core”,“method”:“”,“url”:“–”,“message”:“Error while running background job (class: OCA\User_LDAP\Jobs\UpdateGroups, arguments: )”,“userAgent”:“–”,“version”:“25.0.3.2”,“exception”:{“Exception”:“Doctrine\DBAL\Exception\DriverException”,“Message”:“>{”