Bug #56919 Admin Server Status incorrect, unable to start/stop service
Submitted: 22 Sep 2010 7:18 Modified: 13 Dec 2010 17:39
Reporter: Phil Freihofner Email Updates:
Status: Closed Impact on me:
None 
Category:MySQL Workbench: Administration Severity:S3 (Non-critical)
Version:5.2.28 CE rev 6722 OS:Microsoft Windows (XP Home)
Assigned to: Maksym Yehorov CPU Architecture:Any
Triage: Needs Triage: D2 (Serious)

[22 Sep 2010 7:18] Phil Freihofner
Description:
I put MySQL service on "Manual" via Windows System Services area, and rebooted the PC.

When starting MySQL Workbench, and opening the Admin for "localhost", I get a message about being unable to connect to the server, which is as it should be. But then, when the Admin screen comes up, it reports the server is running (see screen shot). On the same screen shot, you will see the XP window for the MySQL service which shows that it is in the Stopped state.

Clicking on the "Stop service" does nothing. Note also that in the top left, the info box server says "unknown" yet we still have a report that the service is running and no way to turn it on from within the Workbench.

Secondly, when I do turn the MySQL service on, via the Windows System Service area, the Admin shows that the server (via the info box on the top left) is the "5.1.50-community" server. However, the button to stop the server gives the error:
"Could not stop server--character buffer object expected" via a popup window. And nothing is changed as reported by the Windows Services window for MySQL service.

I am not running XAMPP, but I do have Tomcat (error happens when running and not running) and am planning on using this with Java/Eclipse rather than PHP.

The link in the Windows Services area is as follows:
PATH TO EXECUTABLE:
"C:\Program Files\MySQL\MySQL Server 5.1\bin\mysqld" --defaults-file="C:\Program Files\MySQL\MySQL Server 5.1\my.ini" MySQL

I'm sorry, I don't see a way to send you the jpegs I took of the error.

Any suggestions? Many thanks in advance. 

How to repeat:
Place MySQL Services (Windows XP Administrative Tools) on "Manual" and have it set to off.

When opening Workbench, open the Admin for localhost, and inspect the connection to the MySQL server. Contradictory information is presented. (Service is reported as running, info says server is "unknown", log messages say service is running.)

When Service is ON, Workbench/Admin area button <Stop Server> does not turn off the service, but give the error message reported above about expecting a character buffer object.
[22 Sep 2010 12:44] Miguel Solorzano
Could you please provide the screen-shot. I am experiencing another behavior: it shows stopped when actually the service is running. Thanks in advance.
[22 Sep 2010 17:10] Phil Freihofner
shows conflicting info concerning server status

Attachment: running or not.JPG (image/pjpeg, text), 112.82 KiB.

[24 Sep 2010 12:33] Miguel Solorzano
Thank you for the feedback.
[1 Oct 2010 14:34] Alfredo Kojima
Do you have more than one server installed? If you switch to some other tab, like Connections, does it show a message saying that is unavailable? Or does it show a list of connections?
[7 Oct 2010 17:22] Michael Frame
I'm seeing the exact same issue.  If my MySQL service is not running the server status still shows "The database server instance is running".

If my MySQL service is running the server status shows "The database server instance is running".  Clicking the "Stop Server" button will actually stop the service, but the server status in Workbench still shows "The database server instance is running" even though it generates the following message in the Startup Message Log section:

2010-10-07 12:19:37 - Server stop done.

2010-10-07 12:19:37 - Checked server status: Server is running.
[7 Oct 2010 17:24] Michael Frame
shows conflicting status

Attachment: workbench_status.png (image/x-png, text), 167.16 KiB.

[7 Oct 2010 17:27] Michael Frame
I'm running Windows 7, MySQL 5.0, Workbench 5.2.28 CE rev 6722.  My service is named MySQL and is the only instance of MySQL on my box.
[7 Oct 2010 19:51] Phil Freihofner
My apologies. I've been too busy to respond until today.

On [1 Oct 16:34] Alfredo Kojima asked: 
>>Do you have more than one server installed? If you switch to some other tab, like Connections, does it show a message saying that is unavailable? Or does it show a list of connections?<<

I've only the one MySQL server instance installed. Tomcat is also installed, but for the following test examples, Tomcat was left closed. Eclipse for Java EE has been installed, but as far as I know, it references this same MySQL Server.

With the MySQL service started (via Windows) prior to opening up the Connection tab, the Connection tab displays two instances, one marked "Query" and the other marked "Sleep". I will send a JPG. 

When I attempt to turn off the service via the "Stop Server" button in the "Startup" tab, I get the following error message: 

"2010-10-07 12:43:14 - Could not stop server: expected a character buffer object"

If I then go to the Connections tab, I still have the same two services being displayed.

When I turn off the MySQL service (via Windows Services) the Connection tab area goes blank.

When I open the "Server Administration" function with MySQL service off initially, the Connection tab displays the message: "There is no connection to the MySQL Server. This functionality requires an established connection to a running MySQL Server to work."

I hope this answers your diagnostic questions. Thank you again for your efforts!

Phil Freihofner
[7 Oct 2010 20:11] Phil Freihofner
Server Connection Tab

Attachment: ServerConnectionTab.JPG (image/pjpeg, text), 89.16 KiB.

[7 Oct 2010 20:26] Peter Laursen
The error "Could not stop server: expected a character buffer object" has been reported in more reports.  I remember I attached a screenshot to a report by another user (but sorry .. I am not able to search this bugs system a meaningful way)
[8 Oct 2010 22:55] Arthur Yeo
Why is this classified as S3 (non-critical) when it cannot Start/Stop the main service which it's supposed to manage?

I am also getting the same problem in Windows7 using the same 5.2.28 CE r. 6722 against the MySQL 5.5.51 server running in the same host (localhost).
[8 Oct 2010 22:57] Arthur Yeo
If it non-critical, can we have the previous version back that has no such problems?
I do not see a link to a previous Workbench version.
[9 Oct 2010 0:26] Phil Freihofner
>>Why is this classified as S3 (non-critical) when it cannot Start/Stop the main service which it's supposed to manage?<<

Good point. My original thought when I set the Severity in my first post was that since there is a relatively easy, if annoying, work-around, and the rest of the functionality seems to be intact, then it would make sense to call it non-critical. One CAN go to the Control Panel>Administrative Tools>Services and manually start/stop the service. Or one can leave the MySQL Server in a state where it automatically comes on when one boots. Inconvenient, but not fatal.
[29 Oct 2010 22:29] Frank Fauerbach
I've installed now the Version mysql-workbench-gpl-5.2.29-win32.msi and get the same error concerning the start / stop service.
one the one hand, the view cannot detect the rasl state of the servcie MxSQL, at the other hand, the stop service crashed with "expected a character buffer object". The logfile says:
2010-10-30 00:26:24 - Checked server status: Server is running.
2010-10-30 00:26:25 - Server is running
2010-10-30 00:26:28 - Checked server status: Server is running.
2010-10-30 00:26:28 - Stopping server...
2010-10-30 00:26:28 -  0
2010-10-30 00:26:28 - Checked server status: Server is running.
2010-10-30 00:26:28 - Could not stop server: expected a character buffer object
2010-10-30 00:27:06 - Checked server status: Server is running.

When can we expect, that the issue is solved? Or had i any errors in the configuration. I think the only entry concerning the start / Stop service can be the windows service name.

Thanks
Frank
[10 Nov 2010 8:35] Adam Conway
I'm running workbench 5.2.29CE with mysql server 5.1.50-community on a Windows Server 2008 R2 machine.  I'm getting the same "expected a character buffer object" when trying to stop the server.  However, the mysql server is set to "automatic" startup in the services list, so while that may be related to the incorrect status showing, it appears not to be connected to the error trying to stop the service.
[12 Nov 2010 13:16] Joan Puig Pijuan
I'm working on Windows 7 (x64) and I had the same problem.

I "solved" it by deleting the old server instance, creating a new one and in the part of the wizard titled "Review MySQL Management Parameters", check the checkbox "Change Parameters" at the bottom and then click Next.

As someone suggested, I used my.ini at the install path as config file and the section mysqld. Click Next.

And I think that here's the key! Enter "net start MySQL" and "net stop MySQL" in their corresponding textbox and you're done! (I also left the checkbock checked because I work with a non-administrator account, so it asks me every time for an admin's password.

BUT, I have another problem now: It doesn't work at all. It works when I execute those commands on a privileged cmd.exe, but not when I click the "Stop Server" button.

Here's the message log: 

2010-11-12 14:07:14 - Checked server status: Server is running.
2010-11-12 14:07:15 - Server is running
2010-11-12 14:07:20 - Checked server status: Server is running.
2010-11-12 14:07:20 - Stopping server...
2010-11-12 14:07:20 - net stop MySQL (with sudo)
2010-11-12 14:07:26 - Checked server status: Server is running.
2010-11-12 14:07:27 - Server stop done.
2010-11-12 14:07:27 - Checked server status: Server is running.

After it says "net stop MySQL (with sudo)" a "Enter your Password" window pops up so you can enter your system admin's password.

Does anyone know how to solve this problem? To be honest I haven't searched very much for it, so I'll keep looking for an answer on the net.

Meanwhile, I have created two .bat files in my desktop with the commands to start and stop the service and I "run (them) as administrator" to do the job.
[12 Nov 2010 13:28] Joan Puig Pijuan
Oh! and I forgot to mention this in my last post: 

Now I think that the error message we all were getting "makes sense", because the program is probably expecting a string (which could also be called "character buffer") representing the command needed to stop the server, and receives "nothing" or NULL.
[12 Nov 2010 14:18] Adam Conway
I did as Joan Puig Pijuan suggested (I also checked the "run with elevate privilges box" at the same time).  I can now stop the server via workbench.  I assume that I could also start the service except that I am unable to convince workbench that the server is not running!

Tried a variety of custom commands and mysqladmin ping as status commands when creating a new server instance, but no luck.

(Incidently, why can't these properties be edited when editing a server instance?  Why do I need to remove/recreate each time?)
[12 Nov 2010 14:33] Joan Puig Pijuan
Maybe that has something to do with the fact that I (and I guess you too) left the "Check" command textbox blank. I haven't found a command for that yet, but I'll keep searching.
[12 Nov 2010 17:32] Joan Puig Pijuan
SOLVED!!!!!

use "sc query MySQL | wba_filter(RUNNING)" as check status command.

That made it for me.
[7 Dec 2010 20:00] Johannes Taxacher
fix confirmed in repository
[13 Dec 2010 17:39] Tony Bedford
An entry has been added to the 5.2.31 changelog:

When the MySQL service was set to manual in MySQL Workbench, the service was displayed as running in the server status panel, even though the service had not yet been started.
[18 Dec 2010 6:54] Shahriyar Imanov
What "wba_filter"? Windows 7 x64 doesn't recognize the command.
[18 Dec 2010 9:51] Joan Puig Pijuan
@Shahriyar Imanov

I'm also using Windows 7 x64, and the command above worked for me.

In case you're a lazy reader: "sc query MySQL | wba_filter(RUNNING)"