Go Back   HowtoForge Forums | HowtoForge - Linux Howtos and Tutorials > ISPConfig 3 > Developers' Forum

Do you like HowtoForge? Please consider supporting us by becoming a subscriber.
Reply
 
Thread Tools Display Modes
  #1  
Old 13th February 2012, 12:57
branov branov is offline
Junior Member
 
Join Date: Aug 2009
Posts: 24
Thanks: 0
Thanked 1 Time in 1 Post
Unhappy API: Mysql Update problem

Hi there,

I have problem with API command: sites_database_update I got this error:

Wrong Version

Please, can you help me what is wrong? My code is:

Code:
$params = array(
                'server_id' => $server_id,
                'type' => 'mysql',
                'database_name' => $database_name,
                'database_user' => $database_name,
                'database_password' => $database_password,
                'database_charset' => $database_charset,
                'remote_access' => 'y',
                'remote_ips' => '%',
                'active' => 'y',
);

 try {
  $first = $client->client_get_id($session_id,$ADM_User->ispid);
  $update = $client->sites_database_update($session_id, $first, $database_id, $params);
  return $res;     
 } catch (SoapFault $e) {
 	return $e->getMessage();
 }
Reply With Quote
Sponsored Links
  #2  
Old 13th February 2012, 15:30
till till is offline
Super Moderator
 
Join Date: Apr 2005
Location: Lüneburg, Germany
Posts: 37,015
Thanks: 840
Thanked 5,652 Times in 4,461 Posts
Default

Do other remote functions work? I'am not aware that "Wrong Version" is a error message from ISPConfig and I'am not able to find these words anywhere in the ISPConfig sources, so it might be a error message e.g. from PHP / SOAP.
__________________
Till Brehm
--
Get ISPConfig support and the ISPConfig 3 manual from ispconfig.org.
Reply With Quote
  #3  
Old 22nd February 2012, 23:46
branov branov is offline
Junior Member
 
Join Date: Aug 2009
Posts: 24
Thanks: 0
Thanked 1 Time in 1 Post
Default

I found the primary problem but... I have secondary problem...

When a create a new database in api, the password has format like:

*59046E90AC274ECDD88C8983B47A0156BD2CD7BA

But when I edit a mysql from api (sites_database_update) the password is like:

78d1fe0f0064cf6654940c87d99d4456

And problem is, when I edit the password, I cannot login to database, which edit. In mysql log is that the password was changed, but I cannot login. I think, problem is in password hashing? Or..? Is this bug or its my problem?

Thanks very mich
Reply With Quote
  #4  
Old 24th February 2012, 11:02
branov branov is offline
Junior Member
 
Join Date: Aug 2009
Posts: 24
Thanks: 0
Thanked 1 Time in 1 Post
Default

any ideas please? I cant continue in my work
Reply With Quote
  #5  
Old 24th February 2012, 13:43
till till is offline
Super Moderator
 
Join Date: Apr 2005
Location: Lüneburg, Germany
Posts: 37,015
Thanks: 840
Thanked 5,652 Times in 4,461 Posts
Default

Thats a problem of your script. If you pass parameters to the sites_database_update, then the field database_password has to be empty if the password was not changed.
__________________
Till Brehm
--
Get ISPConfig support and the ISPConfig 3 manual from ispconfig.org.
Reply With Quote
  #6  
Old 24th February 2012, 22:52
branov branov is offline
Junior Member
 
Join Date: Aug 2009
Posts: 24
Thanks: 0
Thanked 1 Time in 1 Post
Default

So I dont think its my script problem... When I change the password, I send it to sites_database_update as plain text. In dbispconfig is password change in hash format, but its not the same format like had password when I add database. It looks like different hashing in sites_database_add and sites_database_update.

I hope you know what I mean

Here is output from params sent to sites_database_update:

Code:
Array ( [server_id] => 2 [type] => mysql [database_name] => d6ccc [database_user] => d6ccc [database_password] => noveheslo123 [database_charset] => utf8 [remote_access] => y [remote_ips] => % [active] => y )
Reply With Quote
  #7  
Old 26th February 2012, 02:50
branov branov is offline
Junior Member
 
Join Date: Aug 2009
Posts: 24
Thanks: 0
Thanked 1 Time in 1 Post
Default

I upgraded all from svn and now I get this error in editing:

SOAP Error: Call to undefined method db::affectedRows()

WTF? Im little bit nervous from this After every upgrade is something wrong One problem solving, another I find

Please help me when may be problem... Same function - sites_database_update.

EDIT: NOT only in this function, this error I got on every functions (
Reply With Quote
  #8  
Old 27th February 2012, 11:29
till till is offline
Super Moderator
 
Join Date: Apr 2005
Location: Lüneburg, Germany
Posts: 37,015
Thanks: 840
Thanked 5,652 Times in 4,461 Posts
Default

Quote:
WTF? Im little bit nervous from this After every upgrade is something wrong One problem solving, another I find
I guess you downloaded code from our svn trunk folder instead of using released code (the tar.gz download). Its the purpose of the svn trunk to upload code for testing, so this can be broken. SVN is not much tested development code, so dont use any svn trunk code on a production system or a server where you expect that it works after the update.

If you need a usable system, then use either the stable tar.gz version or the svn stable branch:

svn://svn.ispconfig.org/ispconfig3/branches/ispconfig-3.0.4

Dont use this branch:

svn://svn.ispconfig.org/ispconfig3/trunc

as ts the place where untested code is uploaded.
__________________
Till Brehm
--
Get ISPConfig support and the ISPConfig 3 manual from ispconfig.org.
Reply With Quote
  #9  
Old 27th February 2012, 12:12
branov branov is offline
Junior Member
 
Join Date: Aug 2009
Posts: 24
Thanks: 0
Thanked 1 Time in 1 Post
Default

Im sorry, I run update_from_svn.sh script in /usr/local/ispconfig/server/scripts and I dont check what contains. I try to svn official branch.

Thank you and sorry for my stupidity...
Reply With Quote
  #10  
Old 27th February 2012, 13:44
branov branov is offline
Junior Member
 
Join Date: Aug 2009
Posts: 24
Thanks: 0
Thanked 1 Time in 1 Post
 
Default

Everything works fine. Thanks.

The last problem still away... When I update mysql password from api, in ispconfig database has changed, but has different hash format like newly created mysql database. Because this, I cannot login in to mysql with changed password.... I really dont know where is the problem... API result is 1 affected row, looks all is fine, but password is changed in different hash or.. I dont know....I dont know where look up for errors, or how debug...
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
My Centos is terribly slow Galled Server Operation 9 7th December 2010 16:31
Virtual users... Ubuntu 8.04 spaceuser HOWTO-Related Questions 12 19th June 2008 09:04
LAMP System Fedora Core 6 MySQL start error gavino HOWTO-Related Questions 13 21st November 2007 20:13
postfix mysql on fedora core5 igongora Installation/Configuration 7 17th April 2007 05:40
Mandriva 10.2 Perfect Setup Install Problems... ctroyp Installation/Configuration 12 30th December 2005 17:04


All times are GMT +2. The time now is 12:10.


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