Bug #52846 Uninstall services fails with error / Uninstall fails if services were removed
Submitted: 15 Apr 2010 1:45 Modified: 24 May 2010 14:39
Reporter: Roel Van de Paar Email Updates:
Status: Closed Impact on me:
Category:MySQL Enterprise Monitor: Installing Severity:S2 (Serious)
Version: OS:Windows (7)
Assigned to: BitRock Merlin CPU Architecture:Any

[15 Apr 2010 1:45] Roel Van de Paar
Application System Error
Access is denied.

Unable to delete MySQLEnterpriseTomcat service

This error is shown when clicking "Uninstall MySQL Enterprise Monitor services" which points to:

"C:\Program Files\MySQL\Enterprise\Monitor\mysqlmonitorctl.bat" uninstall

How to repeat:
Install MEM2.2 on Windows 7, uninstall by using the:

Start > All Programs > MySQL > MySQL Enterprise Monitor > Services > Uninstall MySQL Enterprise Monitor services 

option. Observe error.

Suggested fix:
Running the same as administrator (right-click, run as administrator) worked fine. However, the icons/menu are left in the start menu. Maybe there should be an "Complete Uninstall" option besides the "Uninstall Services".
[15 Apr 2010 1:46] Roel Van de Paar
Failing uninstall

Attachment: Mem2.2 Uninstall fails.png (image/png, text), 15.84 KiB.

[15 Apr 2010 1:48] Roel Van de Paar
Re-running the same once more after a correct (using "run-as-administrator") uninstall reports the service not being there.

Attachment: Mem2.2 Uninstall second run.png (image/png, text), 16.15 KiB.

[15 Apr 2010 1:49] Roel Van de Paar
^ This last image/error is correct, but it shows the need for a "Uninstall option" IMO. (i.e. an uninstall that removes all menus/icons - thereby disabling the possibility of someone re-running the uninstall).
[15 Apr 2010 1:55] Roel Van de Paar
Then, when trying to use "Programs and Features" to uninstall completely, it fails since the services are already gone.

Attachment: Mem2.2 Full uninstall fails.png (image/png, text), 79.39 KiB.

[15 Apr 2010 1:59] Roel Van de Paar
In summary, there are two ways to go about fixing this:

Option #1
> Have two options in the menu "Uninstall MySQL Enterprise Monitor services" and a "Uninstall MySQL Enterprise Monitor Completely", whereby the first simply uninstalls the services (which is a good option to have) and the second points to the full uninstall which is started in a similar way as uninstalling using "Programs and Features"
> Fix the first option "Uninstall MySQL Enterprise Monitor services" so it auto-starts as administrator
> And, the uninstall script from "Programs and Features" should check if the services are there. If not, don't fail.

Option #2
> Leave the "Uninstall MySQL Enterprise Monitor services" as-is and do not add a "Uninstall MySQL Enterprise Monitor Completely".
> Fix such "Uninstall MySQL Enterprise Monitor services" to auto-start as administrator
> And, the uninstall script from "Programs and Features" should check if the services are there. If not, don't fail.
[16 Apr 2010 1:33] Roel Van de Paar
Also, there is only one service "MySQLEnterpriseTomcat" so all references to "services" (including the menu itself) should become "service" instead.
[16 Apr 2010 2:09] Roel Van de Paar
One more small item: the install screen sits a long time on this (see image) - seemingly unpacking a small .bat file

Attachment: MEM2.2 unpacking small file.png (image/png, text), 43.26 KiB.

[20 Apr 2010 21:30] Enterprise Tools JIRA Robot
Andy Bang writes: 
There are 2 issues to address here:

1) The Install/Uninstall services shortcuts are confusing and can easily lead you to think you're installing/uninstalling the whole application, which is not the case.  The main reason to use these options is to reconfigure various Tomcat parameters, but there's already another documented way to do that: using the mysqlmonitorctl.bat file directly (see https://enterprise.mysql.com/docs/monitor/2.2/en/mem-program-reference.html#id3208907).  You can also use the Start->Control Panel->Administrative Tools->Services option.

So to avoid confusion, and to stick with what's already documented and standard (note that even the MySQL server does not have start/stop or install/uninstall shortcuts), we have decided to remove these two shortcuts.

2) The second issue is to address the following comment added on [15 Apr 3:55]:

     Then, when trying to use "Programs and Features" to
     uninstall completely, it fails since the services are
     already gone.

So please be sure that everything works properly if someone happens to uninstall the services and then attempts to uninstall the whole application.
[21 Apr 2010 0:41] Roel Van de Paar
And, 3) There is still this item:

- the documentation already says that in "5.2.5. Starting/Stopping the MySQL Enterprise Monitor Service on Windows" that one has to run the Start Menu shortcuts as administrator.
(- it would be fine to have a check at the beginning of the called script whether it is started as administrator to avoid confusion like shown in this report)

To make this more user friendly, maybe this can be fixed in the code. 

There is no error at all for a failed start/stop of the MySQLEnterpriseTomcat service, and the service does not stop "normally". I have opened a new bug for this here: bug #53017
[21 Apr 2010 0:50] Roel Van de Paar
And, 4) Upgrade documentation to say "Windows Vista or later" - new bug logged here: bug #53018
[22 Apr 2010 8:20] BitRock Merlin
Patch sent to Keith.
[23 Apr 2010 17:31] Enterprise Tools JIRA Robot
Andy Bang writes: 
In build
[28 Apr 2010 13:45] Enterprise Tools JIRA Robot
Carsten Segieth writes: 
numbering as used in comment [20 Apr 23:30] Andy Bang:

1) remove of 2 entries from Start Menu checked OK  The documentation still mentions the Start Menu entries for installing/uninstalling the services, see section 5.7.1., but this can be handled when documenting this fix.

2) with solved for the MySQL service, but *not solved* for the Tomcat service. If the e.g. both services were already uninstalled when calling the uninstaller it still stops with "Application System Error" that the uninstaller is 'Unable to delete MySQLEnterpriseTomcat service'
[28 Apr 2010 16:04] BitRock Merlin
Patch sent to Keith.
[4 May 2010 17:35] Enterprise Tools JIRA Robot
Keith Russell writes: 
Patch pushed to installer repository.
[4 May 2010 18:08] Enterprise Tools JIRA Robot
Keith Russell writes: 
Patch installed in versions =>
[11 May 2010 11:01] Enterprise Tools JIRA Robot
Carsten Segieth writes: 
tested OK in
[24 May 2010 14:39] MC Brown
A note has been added to the 2.2.0 changelog: 

        Uninstalling &merlin_server; using the Uninstall Services tool,                                                                                    
        or later removing &merlin_server; after servers have already                                                                                       
        been successfully removed, could fail.