[MXS-1872] maxctrl utility is not working and getting "Access denied" error Created: 2018-05-17  Updated: 2018-06-02  Resolved: 2018-06-02

Status: Closed
Project: MariaDB MaxScale
Component/s: maxctrl
Affects Version/s: 1.0.0
Fix Version/s: N/A

Type: Task Priority: Major
Reporter: Venkatarao Beru Assignee: markus makela
Resolution: Not a Bug Votes: 0
Labels: None
Environment:

Development



 Description   

Hi,

When we try to invoke maxctrl utility we are getting the following error/warning

[maxscale@dbcct3vmyd01006 ~]$ maxctrl --version
1.0.0
[maxscale@dbcct3vmyd01006 ~]$ maxctrl list servers
{
"errors": [

{ "detail": "Access denied" }

]
}

Maxscale log file warnings:
=====================

2018-05-17 05:23:03 warning: Authentication failed for 'maxscale', using password. Request: GET /v1/
2018-05-17 05:23:10 warning: Authentication failed for 'maxscale', using password. Request: GET /v1/
2018-05-17 05:23:14 warning: Authentication failed for 'maxscale', using password. Request: GET /v1/
2018-05-17 05:23:27 warning: Authentication failed for 'maxscale-admin', using password. Request: GET /v1/
2018-05-17 05:27:53 warning: Authentication failed for 'admin', using password. Request: GET /v1/
2018-05-17 05:27:59 warning: Authentication failed for 'admin', using password. Request: GET /v1/

Find out output of all users at maxadmin

[maxscale@dbcct3vmyd01006 ~]$ maxadmin
MaxScale> show users
Enabled Linux accounts (secure) : root, maxscale, admin
Created network accounts (insecure):
MaxScale> exit

Also would like to know how to create an admin account under Created network accounts (insecure):

Thanks,
Venkat Beru



 Comments   
Comment by markus makela [ 2018-05-17 ]

To create a network account in an existing MaxScale installation, execute maxadmin add user <user> <password>.

Comment by Venkatarao Beru [ 2018-05-17 ]

Thank you Makela. Now the admin user has been created.

MaxScale> show users
Enabled Linux accounts (secure) : root, maxscale
Created network accounts (insecure): admin

But i have not get any update regarding my query that "maxctrl" is not working but got the following error

[maxscale@dbcct3vmyd01006 ~]$ maxctrl
{
"errors": [

{ "detail": "Access denied" }

]
}

maxscale.cnf file configuration as follows

[MaxScale]
threads=auto
admin_auth=http
 
[SplitterService]
type=service
router=readwritesplit
servers=dbserv1,dbserv2
user=maxscale
passwd=*************
 
[SplitterListener]
type=listener
service=SplitterService
protocol=MariaDBClient
port=3301
#socket=/tmp/ClusterMaster
 
[dbserv1]
type=server
address=SERVER1
port=3307
protocol=MariaDBBackend
 
[dbserv2]
type=server
address=SERVER2
port=3307
protocol=MariaDBBackend
 
[ReplicationMonitor]
###For manual failover/fallback
type=monitor
module=mariadbmon
servers=dbserv1,dbserv2
user=maxscale
passwd=*************
replication_user=mysql_repl
replication_password=***********
#monitor_interval=1000
monitor_interval=60
#auto_failover=1
#failover_timeout=5
auto_rejoin=true
failcount=5
master_failure_timeout=2
verify_master_failure=true
switchover_timeout=90
#detect_standalone_master=true
#events=master_down
 
[MaxAdmin]
type=service
router=cli
 
[MaxAdminUNIXListener]
type=listener
service=MaxAdmin
protocol=maxscaled
#address=localhost
#port=6600
socket=default
 
[MaxAdminInetListener]
type=listener
service=MaxAdmin
protocol=maxscaled
address=localhost
port=6600

Thanks,
Venkat Beru

Comment by markus makela [ 2018-05-17 ]

You have to define the user and password with maxctrl -u <user> -p <password> to use a specific user.

Comment by Venkatarao Beru [ 2018-05-17 ]

I tried as you suggested but still i could not able to get maxctrl prompt

[maxscale@dbcct3vmyd01006 ~]$ maxadmin
MaxScale> show users
Enabled Linux accounts (secure) : root, maxscale
Created network accounts (insecure): admin
MaxScale> exit

[maxscale@dbcct3vmyd01006 ~]$ maxctrl -u root -p
Enter password: **********
{
"errors": [

{ "detail": "Access denied" }

]
}

[maxscale@dbcct3vmyd01006 ~]$ maxctrl -u maxscale -p
Enter password: **************

{ "code": "ENOTFOUND", "errno": "ENOTFOUND", "syscall": "getaddrinfo", "hostname": "maxscale", "host": "maxscale", "port": 80 }

[maxscale@dbcct3vmyd01006 ~]$ maxctrl -u maxscale -p
Enter password: *******
{
"errors": [

{ "detail": "Access denied" }

]
}

Please suggest how can we fix this issue!

Thanks,
Venkat Beru

Comment by markus makela [ 2018-05-17 ]

You must use the network accounts, not the MaxAdmin UNIX accounts: Created network accounts (insecure): admin

Comment by Venkatarao Beru [ 2018-05-17 ]

Tried with "admin" user but not allowing

$ maxctrl -u admin -p
Enter password: *******
{
"errors": [

{ "detail": "Access denied" }

]
}

Thanks,
Venkat Beru

Comment by Venkatarao Beru [ 2018-05-17 ]

$ maxctrl --user=admin --password='mariadb'
{
"errors": [

{ "detail": "Access denied" }

]
}

$ maxctrl --user=admin --password='*****' --hosts=localhost:6600

{ "bytesParsed": 0, "code": "HPE_INVALID_CONSTANT" }

$ maxctrl --user=admin --password='*****' --hosts=SERVER3:6600

{ "code": "ECONNREFUSED", "errno": "ECONNREFUSED", "syscall": "connect", "address": "XX.XX.XX.XXX", "port": 6600 }
Comment by markus makela [ 2018-05-21 ]

If you reset the admin users by removing the /var/lib/maxscale/passwd file, does it work? Remember to take a backup of the file before removing it if it contains actual users that work.

Comment by markus makela [ 2018-06-02 ]

Closing this as Not a Bug. If you can create a repeatable test case that reproduces the problem, please reopen this issue.

Generated at Thu Feb 08 04:10:01 UTC 2024 using Jira 8.20.16#820016-sha1:9d11dbea5f4be3d4cc21f03a88dd11d8c8687422.