Can't create admin user: Error happened during creating seafile admin

Hi all,

I’m trying to install seafile server (version 7.1.3 CE) in an Ubuntu 20.04 LXD container (also running on Ubuntu 20.04). I am following this guide: seafile-on-ubuntu-with-nginx
The only difference (besides the username :-)) is that the mysql server is running in a separate container, which is running my LEMP stack. I can run the setup of seafile using “setup-seafile-mysql.sh”, which doesn’t throw any errors. Starting seafile with “./seafile.sh start” also seems to work fine. When I want to start seahub through the associated scrript, I have to create an admin user, which seems that it doesn’t work:

LC_ALL is not set in ENV, set to en_US.UTF-8
Starting seahub at port 8000 …


It’s the first time you start the seafile server. Now let’s create the admin account

What is the email for the admin account?
[ admin email ] admin@seafile-test.lxd

What is the password for the admin account?
[ admin password ]

Enter the password again:
[ admin password again ]

Error happened during creating seafile admin.

Seahub is started

Done.

So seahub seems to start, but I am not able to create an admin user. When I try to run ‘check_init_admin.py’, it seems like there are some modules missing:

seafile@seafile-test:~/seafile-server-latest$ python3 check_init_admin.py
Traceback (most recent call last):
File “check_init_admin.py”, line 351, in
rpc = RPC()
File “check_init_admin.py”, line 284, in init
import ccnet
ModuleNotFoundError: No module named ‘ccnet’

Can anybody give me some advice what I could do?

Thanks in advance!

Meanwhile I have tried different things (e.g. setting the symbolic link ‘ln -s python3.6 python3.7’ in /seafile/lib…), but without much progress.
In parallel I have also created a debian/10 container, and installed seafile 8.0.3. Quite strange, but the error is exaclty the same. I have gone through the seahub.sh script, executing it manually step by step, to be sure all the path variables are set-up correctly. Running then ‘python3 check_init_admin.py’, lets do the setup for the admin user but still with no success. I tracked the ‘check_init_admin.py’ script untill the call of ccnet_api.add_emailuser(email, passwd, 1, 1), which for some reason doesn’t seem to be successful…

Is there any chance to get this running?

Additional Info: I have set up another Debian 10 container and again installed seafile 8.0.3, but this time using sqlite instead of mysql. Surprise: Setup including creating admin user works flawlessly :slight_smile:
BUT: I would prefer to use mysql, because my “old” server running seafile is already using mysql and I think that migrating from mysql to sqlite would cause a lot of pain if even possible.
Can anybody give me a hint on where to look for the issue in my setup with mysql?
The creation of the mysql user for seafile for example was also working without any issues and also the tables have been created. So it seems like the connection to the mysql server can be established.
Although the databases and tables have been created, might there be an issue with permissions?

BR, sandman

Hi,

I experienced something similar using MySQL 8, check if you have something like this in your seafile.log:

../common/seaf-db.c(709): Failed to connect to MySQL: Plugin caching_sha2_password could not be loaded: /usr/lib/x86_64-linux-gnu/mariadb19/plugin/caching_sha2_password.so: cannot open shared object file: No such file or directory

If yes, you can change the authentication plugin and everything should return to normal:

$ mysql -u root -p
mysql>  ALTER USER 'seafile'@'%.%.%.%' IDENTIFIED WITH mysql_native_password BY 'secret';

Thanks @Barolo! I had exactly the same error in my seafile.log and the change of the authentication plugin solved my issues!
Thanks again,
sandman

Thanks a lot @Barolo for the answer.

I must have the same issue, but I am struggling to run the command.

After
mysql> ALTER USER ‘seafile’ IDENTIFIED WITH mysql_native_password BY ‘my-seafile-mysql-user-password’;

I get the error message:

ERROR 1396 (HY000): Operation ALTER USER failed for ‘seafile’@’%’

I can’t find a fix for this.

Can anyone help me with this?

Ubuntu 20.04 fresh installation. There seems to be some bug with installaing mysql in the first place…

Indeed, looks like seafile user doesn’t exist.

You should probably clean things and run setup-seafile-mysql.sh script again.

Hi Barolo

Thanks for your help.
The seafile user exists in MYSQL and within Ubuntu user environment.
But it seems that somehow the new Ubuntu version changed the MYSQL settings and now the seafile setup doesn’t work anymore.

Hi all - long time Seafile Windows Server here trying to finally make the jump to Linux!

I’ve managed to get MySQL 8.0.31 installed and configured on Ubuntu 22.04.1, installed Seafile, and am this close to getting it to launch. I am running into the exact same issue as @sandman85 and @GITchristoph and can’t seem to get around it. I’ve tried the check_init_admin.py and in my case, it comes up with No module named ‘seaserv’. Every time I login to MySQL to try and change the authentication plugin, I get the same error:

ERROR 1396 (HY000): Operation ALTER USER failed for ‘seafile’@’%’

I do have a ‘seafile’ user in Ubuntu and MySQL, and also tried doing the ALTER USER command both with no host listed as well as ‘seafile’@‘127.0.0.1’ to no avail.

Anyone ever able to get this running? I’m assuming I’m missing a trick and am not finding anything in searches.

Thanks!

Jason

If it can still help, host is now %.%.%.% for whatever reason, thus:

ALTER USER 'seafile'@'%.%.%.%' IDENTIFIED WITH mysql_native_password BY 'seafile-user-password';

Edited my answer too.

1 Like

百分号有一个就够了,另外8.0版本后基本root是没有这个权限的,需要增加权限。
1、grant system_user on . to ‘root’; #赋予root账户权限
2、ALTER USER ‘seafile’@‘%’ IDENTIFIED WITH mysql_native_password BY ‘password’; #seafile和password换成你自己的