0

We've recently noticed a problem with the ActiveMQ Artemis 2.27.1 Windows Service created if the path to service contains a space. For example, with the pathname:

C:\executables\my artemis\apache-artemis\bin\test_space_broker\bin"

The service installs and starts correctly with:

artemis-service.exe start

However, when I stop it on the command line with:

artemis-service.exe stop

it returns immediately, but if you check the Windows Service display (service.msc) it shows a status of stopping and finally times out. It's the same behavior if you try to stop it from with Windows Services display - i.e. it stays on stopping status for a while and finally times out.

I haven't seen anything in any of the logs that indicates a problem with stopping.

This is the message that's displayed on the time out:

Windows could not stop the ActiveMQ Artemis: test_space_broker @ 00.00 service on Local Computer. 
Error 1053: The service did not respond to the start or control request in a timely fashion. 

It must be due to how one of these paths in the services xml files is interpreted:

<env name="ARTEMIS_INSTANCE_URI" value="file:/C:/executables/my%20artemis/apache-artemis/bin/test_space_broker/"/>
<env name="ARTEMIS_INSTANCE_ETC_URI" value="file:/C:/executables/my%%20artemis/apache-artemis/bin/test_space_broker/etc/"/>

I've tried a few fixes such as changing the %% to % to match the way the URL is handled on both variables, and using the shortened windows name, but no luck so far.

The uninstall works fine once the service is stopped using:

taskill /F /PID xxxx
Justin Bertram
  • 29,372
  • 4
  • 21
  • 43
Jack BeNimble
  • 35,733
  • 41
  • 130
  • 213
  • Hi Justin. It's version 2.27.1. – Jack BeNimble Mar 02 '23 at 18:53
  • "artemis-service.exe start" and "artemis-service.exe stop". I haven't seen anything in any of the logs that indicates a problem with stopping. There was one about invlalid Window Control, but I think that's when I had already tried stopping it and tried a second time. The windows service wrapper log shows the same message as the command line - 2023-03-02 12:58:26,026 INFO - Stopping the service with id 'artemis-test_space_broker-0.0.0.0' 2023-03-02 12:58:26,047 DEBUG - Completed. Exit code is 0 I could try it with the debug option. – Jack BeNimble Mar 02 '23 at 19:01
  • The uinstall works fine once the service is stopped using taskill /F /PID xxxx – Jack BeNimble Mar 02 '23 at 19:03
  • Sorry, that should have been "uninstall", that is "artemis-service.exe uninstall". – Jack BeNimble Mar 02 '23 at 19:17
  • Do you see an empty file named `STOP_ME` being created in the `etc` directory of your broker instance when you run `artemis-service.exe stop`? – Justin Bertram Mar 02 '23 at 19:32
  • Not so far. But I'm going to try again with a new broker to be sure. – Jack BeNimble Mar 02 '23 at 19:41
  • I still don't see the STOP_ME file in the broker with the space when stop the service. But I can see it in a broker without a space when I run the stop. – Jack BeNimble Mar 02 '23 at 20:10
  • The fact that no `STOP_ME` file is being created indicates that the `stop` command isn't actually working rather than the broker is frozen for some reason. – Justin Bertram Mar 02 '23 at 20:12
  • WinSW must send the file path name to Artemis, and due to the space in the pathname, it's getting somehow garbled. So the command just never happens, something like that. – Jack BeNimble Mar 02 '23 at 20:26
  • Can you execute `artemis.cmd --verbose` from the instance's `bin` directory and see what it reports? – Justin Bertram Mar 02 '23 at 20:30
  • Any particular option? – Jack BeNimble Mar 02 '23 at 20:35
  • Sorry, `artemis.cmd stop --verbose`. – Justin Bertram Mar 02 '23 at 21:03
  • C:\executables\my artemis\apache-artemis\bin\test_space_broker2\bin>artemis.cmd stop --verbose Executing org.apache.activemq.artemis.cli.commands.Stop stop --verbose Home::C:\executables\my artemis\apache-artemis, Instance::C:\executables\my artemis\apache-artemis\bin\test_space_broker2 – Jack BeNimble Mar 02 '23 at 21:05
  • Hi Justin - any progress on this? For now we're using a workaround. – Jack BeNimble Mar 29 '23 at 13:46
  • 1
    No progress. You should probably [open a Jira](https://issues.apache.org/jira/browse/ARTEMIS) if you want to see this fixed. I'm not super familiar with Windows services and how they should work. – Justin Bertram Mar 29 '23 at 14:15

0 Answers0