Cells: Error 1062: Duplicate entry 'rest-apis-default-accesses-shares-default-policy' for key 'idm_policy_u1'


after a new installation I have this error message in the Serverlog: Duplicate entry ‘rest-apis-default-accesses-shares-default-policy’ for key ‘idm_policy_u1’

I am not able to login with the admin account I have created during the installation.

Server: CentOS 7
Pydio: Pydio Cells Home Edition 1.0.3

is it a fresh install or did you try before it?

Yes it is a fresh installation (I did it twice just to make sure I haven’t done anything wrong during the first time), on an empty system. I let pydio create the database schema and needed permissions (mySQL).

did you remove the pydio folder under rm -rf ~/.config/pydio and then cleaned the database ( you can just drop the old cells database ).

Could you give me your Mysql version and OS version.

That’s exactly what I did.

Cells is running on: CentOS Linux release 7.4.1708 (Core)
MySQL is running on: 5.7.22-0ubuntu0.16.04.1


I’ve been able to reproduce the problem and solve it on a similar environment. The following might help you.

If you are on CentOs and have followed the step by step tutorial, can you please check if the php-fpm service is correctly started, typically, with your usual user (that is part of wheel group):

sudo systemctl status -l rh-php71-php-fpm
# or more generally 
sudo systemctl status -l *php*

If the php-fpm service is not started, you cannot get any UI – and for the record you usually see a blank page with a 502 bad Gateway message when you connect to the UI.

In such case, and once again if you really have followed all steps of the install guide, you should add the pydio user to the apache group:

sudo usermod -a -G apache pydio

Then log out any pydio account that is open and back in before trying to start the app again. (group membership necessitate a logout to be taken into account).

Let us know if it solves your problem.


I am not quite sure whether this reply belongs to my question.

My issue is that during the installation of pydio cells I get the error message that its trying to create an entry inside the mysql database which fails because of an entry that already has the same primary key:

Duplicate entry ‘rest-apis-default-accesses-shares-default-policy’ for key ‘idm_policy_u1’

I think the installation stops here, I am not even able to login (maybe the admin user has not been created after this error).

I am not quite sure whether this reply belongs to my question.

As I said, from the information you gave, I’ve tried to reproduce the error.
I’ve installed a Cells 1.0.3 on a fresh CentOs7.4 strictly following the step by step guide, the installation succeed, but when I started the App, I got the same error.
I’ve then analysed the system, found the misconfiguration described above, fixed it, restarted the system.
Error was gone and I could log in the system. I must admit, I did not look further.

If this does not fit with your problem (but please double check that your php-fpm service is correctly started), could you please, provide more info, typically full install and start log?


After re-reading, I must also admit that I might not have been clear enough, so let me please rephrase:

You most probably have 2 issues that are not related :

  • This error, that should not be blocking: the message is displayed but the rest of the application should work.
    Duplicate entry 'rest-apis-default-accesses-shares-default-policy' for key 'idm_policy_u1'
    We do our best to reproduce the issue, find the bug and fix it.

  • A logging issue that I was trying to help you to solve.