Go Back   HowtoForge Forums | HowtoForge - Linux Howtos and Tutorials > ISPConfig 3 > General

Do you like HowtoForge? Please consider supporting us by becoming a subscriber.
Reply
 
Thread Tools Display Modes
  #1  
Old 27th January 2012, 11:42
snowfly snowfly is offline
Member
 
Join Date: Jul 2006
Posts: 90
Thanks: 0
Thanked 4 Times in 3 Posts
Default After upgrading to 3.0.4.2, sites_database_add() doesn't set correct password

Recently I upgraded the servers in our multi-server ISPConfig setup, from 3.0.4.1 to 3.0.4.2
And now databases created via the remote API commands are created successfully, BUT the passwords appear wrong, and MySQL users cannot login.

So all future databases created via our system (with remote API calls) no longer work.

I tested this turning on debugging in ISPConfig, and created 2 databases, one directly via ISPConfig web interface (CP), and the second the remote API.
1st database from CP worked, 2nd from remote API failed (user could not log into MySQL).
Password used in this test was: test123

Debug from standard web interface command:
Code:
Replicated from master: REPLACE INTO web_database 

(`database_id`,`sys_userid`,`sys_groupid`,`sys_perm_user`,`sys_perm_group`,`sys_perm_other`,`server_id`,`type`,`database_name`,`database_use

r`,`database_password`,`database_charset`,`remote_access`,`remote_ips`,`active`) VALUES 

('386','1','24','riud','ru','','6','mysql','db_db2','fb_restaurant2','*676243218923905CF94CB52A3C9D3EB30CE8E20D','','n','','y')
Debug from remote API command:
Code:
Replicated from master: REPLACE INTO web_database 

(`database_id`,`sys_userid`,`sys_groupid`,`sys_perm_user`,`sys_perm_group`,`sys_perm_other`,`server_id`,`type`,`database_name`,`database_use

r`,`database_password`,`database_charset`,`remote_access`,`remote_ips`,`active`) VALUES 

('387','24','24','riud','riud','','6','mysql','db_db','fb_restaurant','cc03e747a6afbbcbf8be7668acfebee5','','n','','y')
I can see the password values are completely different.
Is this a bug with 3.0.4.2 remote API, or has the remote calls/code changed?

Is this similar to the issue highlighted here:
http://www.howtoforge.com/forums/sho...d.php?p=272272
Reply With Quote
Sponsored Links
  #2  
Old 27th January 2012, 11:47
till till is online now
Super Moderator
 
Join Date: Apr 2005
Location: Lüneburg, Germany
Posts: 35,750
Thanks: 821
Thanked 5,329 Times in 4,181 Posts
Default

This has already been fixed in stable svn, please see bugtracker:

http://bugtracker.ispconfig.org/inde...s&task_id=1995
__________________
Till Brehm
--
Get ISPConfig support and the ISPConfig 3 manual from ispconfig.org.
Reply With Quote
  #3  
Old 28th January 2012, 22:46
snowfly snowfly is offline
Member
 
Join Date: Jul 2006
Posts: 90
Thanks: 0
Thanked 4 Times in 3 Posts
Default

Quote:
Originally Posted by till View Post
This has already been fixed in stable svn, please see bugtracker:

http://bugtracker.ispconfig.org/inde...s&task_id=1995
Thanks, rather than installing the full svn version, I downloaded a copy of the svn files, compared to stable, and found this file was the problem: interface/lib/classes/remoting_lib.inc.php

So I copied the svn version of this file over my stable, and now sites_database_add works

I presume when I next update ispconfig (using ispconfig_update.sh), the remoting_lib.inc.php file will be overwritten?
Reply With Quote
  #4  
Old 29th January 2012, 15:50
till till is online now
Super Moderator
 
Join Date: Apr 2005
Location: Lüneburg, Germany
Posts: 35,750
Thanks: 821
Thanked 5,329 Times in 4,181 Posts
Default

All ispconfig code files get rplaced on update.
__________________
Till Brehm
--
Get ISPConfig support and the ISPConfig 3 manual from ispconfig.org.
Reply With Quote
  #5  
Old 14th February 2012, 21:45
jesucarr jesucarr is offline
Junior Member
 
Join Date: Feb 2012
Posts: 9
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Hi, I'm using latest version 3.0.4.3, and I' facing the same problem. For some reason in my machine doesn't work even replacing the file interface/lib/classes/remoting_lib.inc.php with the latest svn trunk version. Can anyone let me know how to fix for this version? or send me the remoting_lib.inc.php that is working, perhaps? Thanks!
Reply With Quote
  #6  
Old 14th February 2012, 22:38
till till is online now
Super Moderator
 
Join Date: Apr 2005
Location: Lüneburg, Germany
Posts: 35,750
Thanks: 821
Thanked 5,329 Times in 4,181 Posts
Default

Adding databases with the api works fine in 3.0.4.3, so yourproblm must be something else. Please see ispconfig faq for debugging instructions.
__________________
Till Brehm
--
Get ISPConfig support and the ISPConfig 3 manual from ispconfig.org.
Reply With Quote
  #7  
Old 15th February 2012, 11:43
jesucarr jesucarr is offline
Junior Member
 
Join Date: Feb 2012
Posts: 9
Thanks: 0
Thanked 0 Times in 0 Posts
Default

I don't think it works as expected. When creating a db from the API it should grant permissions for the cli as well, right? If I create a database from the web interface, then I can log in from command line. If I create a database from the remote api, then I cannot log in from the command line (Access denied).

BUT, if I create a database from the web interface, then delete it, and then create the same database from the remote api, then I can log in from the command line.

It looks to me that is a grant permissions issue, or it is that a manual step when using the remote api?
Reply With Quote
  #8  
Old 15th February 2012, 11:59
till till is online now
Super Moderator
 
Join Date: Apr 2005
Location: Lüneburg, Germany
Posts: 35,750
Thanks: 821
Thanked 5,329 Times in 4,181 Posts
Default

Quote:
When creating a db from the API it should grant permissions for the cli as well, right?
The permissions depend on the parameters atht you pass to the sites_database_add function, so if access is granted or not depends on the parameters that your script passes to the function.

Which exat paramaters and parameter array do you pass to the sites_database_add function of the remote api?

You might also want to try the example script for the sites_database_add on your server and compare it with your own script.
__________________
Till Brehm
--
Get ISPConfig support and the ISPConfig 3 manual from ispconfig.org.
Reply With Quote
  #9  
Old 15th February 2012, 12:49
jesucarr jesucarr is offline
Junior Member
 
Join Date: Feb 2012
Posts: 9
Thanks: 0
Thanked 0 Times in 0 Posts
Default

PHP Code:
$params = array(
            
'server_id' => 1,
            
'type' => 'mysql',
            
'database_name' => $database_name,
            
'database_user' => $database_username,
            
'database_password' => $database_password,
            
'database_charset' => '',
            
'remote_access' => 'y',
            
'remote_ips' => '',
            
'active' => 'y'
            
);
    
    
$database_id $remote_user->sites_database_add($session_id$client_id$params); 
Am I missing something?
Reply With Quote
  #10  
Old 15th February 2012, 13:04
till till is online now
Super Moderator
 
Join Date: Apr 2005
Location: Lüneburg, Germany
Posts: 35,750
Thanks: 821
Thanked 5,329 Times in 4,181 Posts
 
Default

I've just tested the remote api on afresh ispconfig 3.0.4.3 server again with the example scripts that ship with ispconfig and creating a database works fine and login to this database works too as well, so there is no problem with the api. I used this example script:

Code:
$client = new SoapClient(null, array('location' => $soap_location,
                                     'uri'      => $soap_uri,
									 'trace' => 1,
									 'exceptions' => 1));


try {
	if($session_id = $client->login($username,$password)) {
		echo 'Logged successfull. Session ID:'.$session_id.'<br />';
	}
	
	//* Set the function parameters.
	$client_id = 1;
	$params = array(
			'server_id' => 1,
			'type' => 'mysql',
			'database_name' => 'db_name2',
			'database_user' => 'db_name2',
			'database_password' => 'db_name2',
			'database_charset' => 'UTF8',
			'remote_access' => 'y',
			'remote_ips' => '',
			'active' => 'y'
			);
	
	$database_id = $client->sites_database_add($session_id, $client_id, $params);

	echo "Database ID: ".$database_id."<br>";
	
	if($client->logout($session_id)) {
		echo 'Logged out.<br />';
	}
	
	
} catch (SoapFault $e) {
	echo $client->__getLastResponse();
	die('SOAP Error: '.$e->getMessage());
}

?>
__________________
Till Brehm
--
Get ISPConfig support and the ISPConfig 3 manual from ispconfig.org.
Reply With Quote
Reply

Bookmarks

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Grub2 om Ubuntu 10.04 newfield_no1 HOWTO-Related Questions 7 15th November 2011 14:39
Xen amd64 kernel on Debian is i386??? computer_freak_8 Installation/Configuration 8 8th November 2009 17:00
Need help with fail2ban on centos 5.3 rlischer Installation/Configuration 3 14th August 2009 11:47
Can't set up root password on MySQL server for Ubuntu 6.06 simianstyle Installation/Configuration 15 19th June 2006 16:44
How to install BFD (Brute Force Detection) domino Tips/Tricks/Mods 9 31st March 2006 22:40


All times are GMT +2. The time now is 13:15.


Powered by vBulletin® Version 3.8.7
Copyright ©2000 - 2014, vBulletin Solutions, Inc.