Owncloud10.4.1 share folder with users not support Chinese character

Steps to reproduce

Expected behaviour

Tell us what should happen

Actual behaviour

Tell us what happens instead

Server configuration

Operating system:
CentOS Linux release 7.8.2003 (Core)
Web server:
httpd 2.4.43
Database:
mariadb 10.5.4
PHP version:
php7.2
ownCloud version: (see ownCloud admin page)
owncloud 10.4.1
Updated from an older ownCloud or fresh install:
fresh install
Where did you install ownCloud from:
wget https://download.owncloud.org/community/owncloud-10.4.1.zip
Signing status (ownCloud 9.0 and above):

Login as admin user into your ownCloud and access 
http://example.com/index.php/settings/integrity/failed 
paste the results into https://gist.github.com/ and puth the link here.

The content of config/config.php:

Log in to the web-UI with an administrator account and click on
'admin' -> 'Generate Config Report' -> 'Download ownCloud config report'
This report includes the config.php settings, the list of activated apps
and other details in a well sanitized form.

or 

If you have access to your command line run e.g.:
sudo -u www-data php occ config:list system
from within your ownCloud installation folder

*ATTENTION:* Do not post your config.php file in public as is. Please use one of the above
methods whenever possible. Both, the generated reports from the web-ui and from occ config:list
consistently remove sensitive data. You still may want to review the report before sending.
If done manually then it is critical for your own privacy to dilligently
remove *all* host names, passwords, usernames, salts and other credentials before posting.
You should assume that attackers find such information and will use them against your systems.

List of activated apps:

If you have access to your command line run e.g.:
sudo -u www-data php occ app:list
from within your ownCloud installation folder.

Are you using external storage, if yes which one: local/smb/sftp/…
/var/www/html/owncloud/data
Are you using encryption: yes/no
no
Are you using an external user-backend, if yes which one: LDAP/ActiveDirectory/Webdav/…
no

LDAP configuration (delete this part if not used)

With access to your command line run e.g.:
sudo -u www-data php occ ldap:show-config
from within your ownCloud installation folder

Without access to your command line download the data/owncloud.db to your local
computer or access your SQL server remotely and run the select query:
SELECT * FROM `oc_appconfig` WHERE `appid` = 'user_ldap';


Eventually replace sensitive data as the name/IP-address of your LDAP server or groups.

Client configuration

Browser:

Operating system:

Logs

Web server error log

Insert your webserver log here

ownCloud log (data/owncloud.log)

Insert your ownCloud log here

Browser log

Insert your browser log here, this could for example include:

a) The javascript console log
b) The network log 
c) ...

I create a chinese folder ,called 舍棉衣外套采购申请单青年美科技,and share with vechiea,and it works well .so I login as vechie,first time it works well ,
when I refresh the browser some times,the folder changed as follows :

I tried several times and sevreal fresh server and database, but the same wrong problem 。
so , the character_set about utf8mb4 not support Chinese characters?


this is the folder

{“reqId”:“XwV2gK8pTqCY-JWcg57b8wAAAEE”,“level”:3,“time”:“2020-07-08T07:32:17+00:00”,“remoteAddr”:"",“user”:“root”,“app”:“index”,“method”:“GET”,“url”:"/owncloud/index.php/settings/users/users?offset=0&limit=200&gid=&pattern=",“message”:“Exception: {“Exception”:“Doctrine\\DBAL\\Exception\\DriverException”,“Message”:“An exception occurred while executing ‘SELECT DISTINCT a.id AS id, user_id, lower_user_id, display_name, email, last_login, backend, state, quota, home FROM oc_accounts a LEFT JOIN oc_account_terms t ON a.id = t.account_id WHERE (lower_user_id LIKE ?) OR (display_name COLLATE utf8_general_ci LIKE ?) OR (email COLLATE utf8_general_ci LIKE ?) OR (t.term LIKE ?) ORDER BY display_name ASC LIMIT 200’ with params [\”%%\”, \"%%\", \"%%\", \"%%\"]:\n\nSQLSTATE[42000]: Syntax error or access violation: 1253 COLLATION ‘utf8_general_ci’ is not valid for CHARACTER SET ‘utf8mb4’",“Code”:0,“Trace”:"#0 \/var\/www\/html\/owncloud\/lib\/composer\/doctrine\/dbal\/lib\/Doctrine\/DBAL\/DBALException.php(169): Doctrine\\DBAL\\Driver\\AbstractMySQLDriver->convertException(‘An exception oc…’, Object(Doctrine\\DBAL\\Driver\\PDOException))\n#1 \/var\/www\/html\/owncloud\/lib\/composer\/doctrine\/dbal\/lib\/Doctrine\/DBAL\/DBALException.php(145): Doctrine\\DBAL\\DBALException::wrapException(Object(Doctrine\\DBAL\\Driver\\PDOMySql\\Driver), Object(Doctrine\\DBAL\\Driver\\PDOException), ‘An exception oc…’)\n#2 \/var\/www\/html\/owncloud\/lib\/composer\/doctrine\/dbal\/lib\/Doctrine\/DBAL\/Statement.php(162): Doctrine\\DBAL\\DBALException::driverExceptionDuringQuery(Object(Doctrine\\DBAL\\Driver\\PDOMySql\\Driver), Object(Doctrine\\DBAL\\Driver\\PDOException), ‘SELECT DISTINCT…’, Array)\n#3 \/var\/www\/html\/owncloud\/lib\/public\/AppFramework\/Db\/Mapper.php(241): Doctrine\\DBAL\\Statement->execute()\n#4 \/var\/www\/html\/owncloud\/lib\/public\/AppFramework\/Db\/Mapper.php(337): OCP\\AppFramework\\Db\\Mapper->execute(‘SELECT DISTINCT…’, Array, 200, 0)\n#5 \/var\/www\/html\/owncloud\/lib\/private\/User\/AccountMapper.php(176): OCP\\AppFramework\\Db\\Mapper->findEntities(‘SELECT DISTINCT…’, Array, 200, 0)\n#6 \/var\/www\/html\/owncloud\/lib\/private\/User\/Manager.php(295): OC\\User\\AccountMapper->find(’’, 200, 0)\n#7 \/var\/www\/html\/owncloud\/settings\/Controller\/UsersController.php(302): OC\\User\\Manager->find(’’, 200, 0)\n#8 \/var\/www\/html\/owncloud\/lib\/private\/AppFramework\/Http\/Dispatcher.php(153): OC\\Settings\\Controller\\UsersController->index(0, 200, ‘’, ‘’, ‘’)\n#9 \/var\/www\/html\/owncloud\/lib\/private\/AppFramework\/Http\/Dispatcher.php(85): OC\\AppFramework\\Http\\Dispatcher->executeController(Object(OC\\Settings\\Controller\\UsersController), ‘index’)\n#10 \/var\/www\/html\/owncloud\/lib\/private\/AppFramework\/App.php(100): OC\\AppFramework\\Http\\Dispatcher->dispatch(Object(OC\\Settings\\Controller\\UsersController), ‘index’)\n#11 \/var\/www\/html\/owncloud\/lib\/private\/AppFramework\/Routing\/RouteActionHandler.php(47): OC\\AppFramework\\App::main(‘UsersController’, ‘index’, Object(OC\\AppFramework\\DependencyInjection\\DIContainer), Array)\n#12 \/var\/www\/html\/owncloud\/lib\/private\/Route\/Router.php(342): OC\\AppFramework\\Routing\\RouteActionHandler->__invoke(Array)\n#13 \/var\/www\/html\/owncloud\/lib\/base.php(916): OC\\Route\\Router->match(’\/settings\/users…’)\n#14 \/var\/www\/html\/owncloud\/index.php(54): OC::handleRequest()\n#15 {main}",“File”:"\/var\/www\/html\/owncloud\/lib\/composer\/doctrine\/dbal\/lib\/Doctrine\/DBAL\/Driver\/AbstractMySQLDriver.php",“Line”:106}"}
{“reqId”:“XwV2gK8pTqCY-JWcg57b8wAAAEE”,“level”:3,“time”:“2020-07-08T07:32:17+00:00”,“remoteAddr”:"",“user”:“root”,“app”:“index”,“method”:“GET”,“url”:"/owncloud/index.php/settings/users/users?offset=0&limit=200&gid=&pattern=",“message”:“Caused by: {“Exception”:“PDOException”,“Message”:“SQLSTATE[42000]: Syntax error or access violation: 1253 COLLATION ‘utf8_general_ci’ is not valid for CHARACTER SET ‘utf8mb4’”,“Code”:“42000”,“Trace”:”#0 \/var\/www\/html\/owncloud\/lib\/composer\/doctrine\/dbal\/lib\/Doctrine\/DBAL\/Driver\/PDOStatement.php(117): PDOStatement->execute(NULL)\n#1 \/var\/www\/html\/owncloud\/lib\/composer\/doctrine\/dbal\/lib\/Doctrine\/DBAL\/Statement.php(153): Doctrine\\DBAL\\Driver\\PDOStatement->execute(NULL)\n#2 \/var\/www\/html\/owncloud\/lib\/public\/AppFramework\/Db\/Mapper.php(241): Doctrine\\DBAL\\Statement->execute()\n#3 \/var\/www\/html\/owncloud\/lib\/public\/AppFramework\/Db\/Mapper.php(337): OCP\\AppFramework\\Db\\Mapper->execute(‘SELECT DISTINCT…’, Array, 200, 0)\n#4 \/var\/www\/html\/owncloud\/lib\/private\/User\/AccountMapper.php(176): OCP\\AppFramework\\Db\\Mapper->findEntities(‘SELECT DISTINCT…’, Array, 200, 0)\n#5 \/var\/www\/html\/owncloud\/lib\/private\/User\/Manager.php(295): OC\\User\\AccountMapper->find(’’, 200, 0)\n#6 \/var\/www\/html\/owncloud\/settings\/Controller\/UsersController.php(302): OC\\User\\Manager->find(’’, 200, 0)\n#7 \/var\/www\/html\/owncloud\/lib\/private\/AppFramework\/Http\/Dispatcher.php(153): OC\\Settings\\Controller\\UsersController->index(0, 200, ‘’, ‘’, ‘’)\n#8 \/var\/www\/html\/owncloud\/lib\/private\/AppFramework\/Http\/Dispatcher.php(85): OC\\AppFramework\\Http\\Dispatcher->executeController(Object(OC\\Settings\\Controller\\UsersController), ‘index’)\n#9 \/var\/www\/html\/owncloud\/lib\/private\/AppFramework\/App.php(100): OC\\AppFramework\\Http\\Dispatcher->dispatch(Object(OC\\Settings\\Controller\\UsersController), ‘index’)\n#10 \/var\/www\/html\/owncloud\/lib\/private\/AppFramework\/Routing\/RouteActionHandler.php(47): OC\\AppFramework\\App::main(‘UsersController’, ‘index’, Object(OC\\AppFramework\\DependencyInjection\\DIContainer), Array)\n#11 \/var\/www\/html\/owncloud\/lib\/private\/Route\/Router.php(342): OC\\AppFramework\\Routing\\RouteActionHandler->__invoke(Array)\n#12 \/var\/www\/html\/owncloud\/lib\/base.php(916): OC\\Route\\Router->match(’\/settings\/users…’)\n#13 \/var\/www\/html\/owncloud\/index.php(54): OC::handleRequest()\n#14 {main}",“File”:"\/var\/www\/html\/owncloud\/lib\/composer\/doctrine\/dbal\/lib\/Doctrine\/DBAL\/Driver\/PDOStatement.php",“Line”:117}"}

I’m pretty sure your database setup is not correct. I just successfully shared a folder with the very same name with another user on my ownCloud 10.4.1 - it worked as expected.

So revise your settings, the error must be somewhere there. For your convenience the manual:

https://doc.owncloud.com/server/admin_manual/configuration/database/db_conversion.html#introduction

2 Likes

Thank you very much for your reply.I tried your suggestion,and the same error .
And I use a new machine, install mariadb5.5.65,create a new database,(latin1 ,latin1_swedish_ci)
and in the config.php of owncloud, the line about :‘mysql.utf8mb4’ => true, missiong , but the owncloud works well.
But I must use the new version of mariadb10+, the error occurs every time :joy: :joy: :joy:

https://doc.owncloud.com/server/admin_manual/release_notes.html#mariadb-10-4-and-postgresql-10-support

It doesn’t look like mariadb 10.5 is supported yet.

Perhaps you can open a github issue asking what the plans for supporting it are?

1 Like

thank you for your reply.
Maybe I found the solution of this problem, I update apache version 2.4.6 to 2.4.43 using following step:
1、 yum install yum-changelog
2、yum changelog httpd
3、yum install -y epel-release
4、cd /etc/yum.repos.d && wget https://repo.codeit.guru/codeit.elrpm -q --qf "%{VERSION}" $(rpm -q --whatprovides redhat-release).repo
5、yum info httpd
6、yum install httpd
and I delete the .repo file , remove httpd2.4.43, and install default version 2.4.6. the chinese character problem didn’t arise.
It’s a strange phenomenon :sweat_smile: :sweat_smile: :sweat_smile: