Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ERROR: failed to create user 'opensips' #93

Closed
johanlantz opened this issue Mar 31, 2022 · 8 comments
Closed

ERROR: failed to create user 'opensips' #93

johanlantz opened this issue Mar 31, 2022 · 8 comments
Assignees

Comments

@johanlantz
Copy link

Hi,

I am trying to setup my first opensips 3.2 installation on a Digitalocean droplet using Centos 7.
I have installed mysql as:
mysql Ver 15.1 Distrib 5.5.68-MariaDB, for Linux (x86_64) using readline 5.1

When I call opensips-cli -x database create I get the error below:
DEBUG: Loaded module 'database' DEBUG: running in non-interactive mode database create [] DEBUG: running command 'create' '[]' DEBUG: db_name: 'opensips' Password for admin MySQL user (root): DEBUG: read password: '' DEBUG: admin DB URL: 'mysql://root:@localhost' DEBUG: DB URL: 'mysql://opensips:opensipsrw@localhost' DEBUG: connecting to mysql://root:@localhost DEBUG: check database URL 'mysql://root:@localhost/opensips' DEBUG: DB does not exist DEBUG: Create Database 'opensips' for dialect 'mysql' ... DEBUG: success DEBUG: connecting to mysql://opensips:opensipsrw@localhost/opensips INFO: creating access user for opensips ... ERROR: failed to create user 'opensips' ERROR: failed to create user on opensips DB

I found this: #77

But I am too noob to understand how to see if that is the cause or how to apply the suggested solution.

Any advice would be welcome

@liviuchircu liviuchircu self-assigned this Mar 31, 2022
@liviuchircu
Copy link
Member

Hey, @johanlantz! To test if that root user of yours has the GRANT OPTION privilege, log into MySQL using the root account and try the following:

mysql> CREATE USER 'test_user';
Query OK, 0 rows affected (0,00 sec)
mysql> GRANT ALL ON opensips.* to 'test_user'@'%';
Query OK, 0 rows affected (0,00 sec)
mysql> DROP USER 'test_user';
Query OK, 0 rows affected (0,00 sec)

If the GRANT doesn't work, then you need the ... WITH GRANT OPTION extra privilege, which isn't included in the GRANT ALL PRIVILEGES TO ... statement (source), and we can close this issue as "Invalid".

Otherwise, if the commands work, you may have run into a bug of some sorts!

@johanlantz
Copy link
Author

Thanks for the super fast reply. I see this:
Screenshot 2022-03-31 at 16 01 13

@liviuchircu
Copy link
Member

Could it be a syntax issue? The code is basically running:

CREATE USER IF NOT EXISTS 'opensips' IDENTIFIED BY 'opensipsrw';

Nothing fancy. Do you get any errors if trying to run this? I suspect MySQL 5.5 might be a bit old and could error on that query...

@johanlantz
Copy link
Author

I get this:
MariaDB [(none)]> CREATE USER IF NOT EXISTS 'opensips' IDENTIFIED BY 'opensipsrw';
ERROR 1064 (42000): You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near 'IF NOT EXISTS 'opensips' IDENTIFIED BY 'opensipsrw'' at line 1

@johanlantz
Copy link
Author

To be honest, I do not know why I picked CentOS 7, I probably just read it somewhere. I can restart everything and try with CentOS 8 or 9 instead to get a newer mysql server version?

@liviuchircu
Copy link
Member

Yes, please! :D Let's see if behavior improves!

@johanlantz
Copy link
Author

Yep, trying with Centos 8 and the opensips-cli installs ok but for opensips I just get this:
nothing provides libm.so.6(GLIBC_2.29)(64bit) needed by opensips-3.2.5-1.el8.x86_64

and not able to solve it, the version that installs with yum install lim6.so.6 is 2.28 but I have no idea if that is the issue. I know this is not cli related but wont be able to see if it works if I fail on the initial installation 😓

@liviuchircu
Copy link
Member

Unfortunately, that's a Red Hat packaging issue that's being tracked in OpenSIPS/opensips#2763. In short: as RPM-based distributions are diverging, a single RPM build is less and less compatible with all of them at the same time.
We just have to wait until it's addressed in some way, perhaps with a dedicated RPM repo for CentOS.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants