froxlor / Froxlor

The server administration software for your needs - The official Froxlor development Git repository
http://www.froxlor.org
GNU General Public License v2.0
1.62k stars 455 forks source link

custom_suffix of database too long #1258

Closed DZotya closed 1 month ago

DZotya commented 1 month ago

Describe the bug The custom suffix (of database name) is too long in case of database creation via api. There is no information about this data in documentation. The database creates but it is no available for customer just for admin. This action is not found in sys log.

System information

To Reproduce Steps to reproduce the behavior:

  1. Try to create a database via api
  2. Command: Mysqls.add
  3. custom_suffix param is testloremipsum222hghh
  4. The response error is We are sorry, but a MySQL - error occurred. The administrator may find more information in syslog.

Expected behavior Error message about the suffix length is greater than x characters. And information about it in documentation.

Logfiles This action is not found in sys log.

d00p commented 1 month ago

And what is the corresponding error in said syslog? Either syslog, mysql-error log or webserver error log?

DZotya commented 1 month ago

No error in syslog.

d00p commented 1 month ago

Can you please provide corresponding settings mainly the mysqlprefix setting and the exact API call you ran? I cannot reproduce this on the demo, the database with a custom name like testloremipsum222hghh gets added just fine

d00p commented 1 month ago

Please provide exact mysql or mariadb version as they have very different username/database name limits

DZotya commented 1 month ago

main API calling params are:

$command = 'Mysqls.add';

$commandParams = [ 'mysql_password' => 'ghjk4g5jhg34j#fG', 'custom_suffix' => "testloremipsum222hghh", 'description' => 'fdsgdfgdsfg' ];

$payload = [ 'command' => $command, 'params' => $params ];

The database is created but no available for customer. It looks like the froxlor cannot handle db with this length

d00p commented 1 month ago

what is your setting for mysql-prefix in Settings -> Account settings -> SQL Prefix?

d00p commented 1 month ago

also your statement

The database is created but no available for customer.

only makes sense if there was some error after creating the database because the entry for froxlor to display the database to the customer is made after the database was created and as you posted you got the message We are sorry, but a MySQL - error occurred. The administrator may find more information in syslog. so there must be something.

And still need to know the exact dbms and version to be able to reproduce if you cant find any logged messages

DZotya commented 1 month ago

Mysql version number: 8.0.37

I have already asked my boss about the setting because I'm a customer not administrator so I have no permission for settings.

d00p commented 1 month ago

So you also won't be able to test any patch provided?

DZotya commented 1 month ago

image

DZotya commented 1 month ago

The customer name length is 12 chars.

d00p commented 1 month ago

yeah, mysql 8 has a limit of 32, your 12 characters from the customer-name + "_" + your custom database name.

I've implemented a check for this, it will be available in froxlor-2.2