Hi
We are trying to debug a problem with services created using py2exe.
It seems that these problems have arisen after services were installed
and removed a few times.
OK, first the actual problem we're seeing. After compiling a service
with py2exe, running "service -install" and attempting to start it from
the Services dialog, it pops up the message "Windows could not start the
Service on Local Computer. For more information, review the System
Event Log. If this is a non-Microsoft service, contact the service
vendor, and refer to service-specific error code 1.".
The only thing in the System Event Log is an error logged by Service
Control Manager saying the service terminated with service-specific error 1.
Now, the causes. On all the computers we've seen this problem, the
service has been installed at least once before and has been able to
start/stop properly. On two of the computers, the problem arose after
uninstalling the service, installing it with "python service.py service
--install", running it with pythonservice in debug mode, uninstalling it
with "python service.py service --remove", and then reinstalling from
the executable. Since then, the only way it ill run is from
pythonservice in debug mode.
On the third computer, the service was installed from executable, and
then reinstalled from an updated executable. I'm not sure how many
times the old executable was installed and uninstalled (at most three
times), but the updated
executable only ran once, and then showed the error.
One thing I noticed about the first computer is that, even after
uninstalling everything, there were some registry entries to do with the
installed services. I could not delete these entries - I got an access
denied error (details below)
Does anybody have any ideas?
TIA,
David Fraser
Registry details: The service is called jHistExportService
The important remnant seems to be:
HKLM\SYSTEM\ControlSet002\Services\jHistExportServ ice and children
which actually holds details of how to run the service. For the record,
the other remnants are:
HKLM\SYSTEM\ControlSet001\Enum\Root\LEGACY_JHISTEX PORTSERVICE and children
HKLM\SYSTEM\ControlSet001\Services\EventLog\Applic ation\jHistExportService
and children
HKLM\SYSTEM\ControlSet002\Services\EventLog\Applic ation\jHistExportService
and children
HKLM\SYSTEM\CurrentControlSet\Enum\Root\LEGACY_JHI STEXPORTSERVICE
HKLM\SYSTEM\CurrentControlSet\Services\EventLog\Ap plication\jHistExportService 3 5171
While it is unclear what your specific problem is, I can
tell you that this is not a "known" problem with Python
services. I have a development machine that I have
installed/removed one service on at least 100 times over
the course of development and it works properly. During
that time I installed/ran it both as a PythonService and
as a frozen py2exe service many, many times.
I can tell you that I use InnoInstaller to do my installations
and have it "clean" up during uninstallation by removing the
left over registry keys. If you cannot remove them, I would
suspect a "rights" issue (no administrative rights?).
HTH,
Larry Bates
Syscon, Inc.
"David Fraser" <da****@sjsoft.com> wrote in message
news:cb**********@ctb-nnrp2.saix.net... Hi
We are trying to debug a problem with services created using py2exe. It seems that these problems have arisen after services were installed and removed a few times.
OK, first the actual problem we're seeing. After compiling a service with py2exe, running "service -install" and attempting to start it from the Services dialog, it pops up the message "Windows could not start the Service on Local Computer. For more information, review the System Event Log. If this is a non-Microsoft service, contact the service vendor, and refer to service-specific error code 1.".
The only thing in the System Event Log is an error logged by Service Control Manager saying the service terminated with service-specific error
1. Now, the causes. On all the computers we've seen this problem, the service has been installed at least once before and has been able to start/stop properly. On two of the computers, the problem arose after uninstalling the service, installing it with "python service.py service --install", running it with pythonservice in debug mode, uninstalling it with "python service.py service --remove", and then reinstalling from the executable. Since then, the only way it ill run is from pythonservice in debug mode.
On the third computer, the service was installed from executable, and then reinstalled from an updated executable. I'm not sure how many times the old executable was installed and uninstalled (at most three times), but the updated executable only ran once, and then showed the error.
One thing I noticed about the first computer is that, even after uninstalling everything, there were some registry entries to do with the installed services. I could not delete these entries - I got an access denied error (details below)
Does anybody have any ideas?
TIA, David Fraser
Registry details: The service is called jHistExportService
The important remnant seems to be: HKLM\SYSTEM\ControlSet002\Services\jHistExportServ ice and children
which actually holds details of how to run the service. For the record, the other remnants are: HKLM\SYSTEM\ControlSet001\Enum\Root\LEGACY_JHISTEX PORTSERVICE and
children HKLM\SYSTEM\ControlSet001\Services\EventLog\Applic ation\jHistExportService and children
HKLM\SYSTEM\ControlSet002\Services\EventLog\Applic ation\jHistExportService and children HKLM\SYSTEM\CurrentControlSet\Enum\Root\LEGACY_JHI STEXPORTSERVICE
HKLM\SYSTEM\CurrentControlSet\Services\EventLog\Ap plication\jHistExportServi
ce
Larry Bates wrote: "David Fraser" <da****@sjsoft.com> wrote:
One thing I noticed about the first computer is that, even after uninstalling everything, there were some registry entries to do with the installed services. I could not delete these entries - I got an access denied error (details below)
[...] I can tell you that I use InnoInstaller to do my installations and have it "clean" up during uninstallation by removing the left over registry keys. If you cannot remove them, I would suspect a "rights" issue (no administrative rights?).
For what it's worth, in a possibly related situation we just
encountered something similar. In our case it was not a service,
but a COM server (using ctypes or win32com, running as LocalServer32
which launches pythonw.exe in the background). On my machine
I've had no troubles, but on a remote machine there were
"access denied" errors whenever the developer tried to "-unregserver",
which removes the registry entries. I believe he tried removing
them manually as well, but could not. It was a long-distance
thing, so I couldn't troubleshoot it myself...
I theorized there was a leftover process running, but after
checking over the task list he insisted there was not anything
active that could be doing this.
A reboot cured the problem, and so far we haven't seen it
again.
He definitely had administrative rights, so it wasn't that. I'm
positive it was a leftover "lock" of some kind, but I don't
know anything about that area of Windows so we just moved on.
My point is that it may not even be limited to the service
stuff, but could be a little broader, maybe more fundamental
to doing these kinds of background things using Python
under Windows.
-Peter
Peter Hansen wrote: Larry Bates wrote: > "David Fraser" <da****@sjsoft.com> wrote: > >>One thing I noticed about the first computer is that, even after >>uninstalling everything, there were some registry entries to do >>with the installed services. I could not delete these entries - I >>got an access denied error (details below) [...]
I can tell you that I use InnoInstaller to do my installations and have it "clean" up during uninstallation by removing the left over registry keys. If you cannot remove them, I would suspect a "rights" issue (no administrative rights?).
For what it's worth, in a possibly related situation we just encountered something similar. In our case it was not a service, but a COM server (using ctypes or win32com, running as LocalServer32 which launches pythonw.exe in the background). On my machine I've had no troubles, but on a remote machine there were "access denied" errors whenever the developer tried to "-unregserver", which removes the registry entries. I believe he tried removing them manually as well, but could not. It was a long-distance thing, so I couldn't troubleshoot it myself...
I theorized there was a leftover process running, but after checking over the task list he insisted there was not anything active that could be doing this.
A reboot cured the problem, and so far we haven't seen it again.
He definitely had administrative rights, so it wasn't that. I'm positive it was a leftover "lock" of some kind, but I don't know anything about that area of Windows so we just moved on.
My point is that it may not even be limited to the service stuff, but could be a little broader, maybe more fundamental to doing these kinds of background things using Python under Windows.
-Peter
Very interesting. This has also occured on one of our customer sites
where it was difficult to debug...
At least it has also occurred on our own machines so if we manage to
work out more details I'll post them here, maybe it will solve your
problem to...
David This thread has been closed and replies have been disabled. Please start a new discussion. Similar topics |
by: Nazgul |
last post by:
Hi!
Sorry if I posted it twice...
I need your help...
I have the following problem. I've implemented the python Windows Service
which behaves like a log supervisor. If the space
used by log...
|
by: chriss |
last post by:
Hello everybody!
I'm very bad in English but I'm going to try to explain my problem.
I have a python program and this program is a service.
chronologically:
1. I install my program like...
|
by: Ringwraith |
last post by:
Hello!
I have implemented a Windows Service in Python. It works on Windows XP
properly and logs in Event Viever any 'started' or "stopped" events.
The problem appeared when I tried to...
|
by: Michael Hatmaker |
last post by:
I have begun experimenting with web services, and I created some
simple web services in C# and was able to install them with IIS and
create an equally simple C# client to consume them.
My next...
|
by: Saravanan |
last post by:
Hello,
Im running Python Application as a Windows Service (using windows
extensions). But, sporadically the application crashes (crash in
Python23.dll) and this stops the service. This...
| |
by: Saravanan |
last post by:
Hello,
Im using Python 2.3.3 along with Win32all (163).
Currently my python application runs as Windows Service. Im using
Win32all Service Framework to run the Python Code as a Windows Service....
|
by: zxo102 |
last post by:
Hi there,
I have a python application (many python scripts) and I start the
application like this
python myServer.py start
in window. It is running in dos window. Now I would like to put it...
|
by: Aspersieman |
last post by:
Hi All
I have a windows service (attached file). I basically just calls another
script every 60 seconds. I can install, start and stop this service as
expected with:
ParseMailboxService.py...
|
by: Gabriel Rossetti |
last post by:
Hello everyone,
I'm trying to use python's freeze utility but I'm running into problems.
I called it like this :
python /usr/share/doc/python2.5/examples/Tools/freeze/freeze.py...
|
by: Hystou |
last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
|
by: Hystou |
last post by:
Overview:
Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
| |
by: tracyyun |
last post by:
Dear forum friends,
With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
|
by: agi2029 |
last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
|
by: isladogs |
last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM).
In this session, we are pleased to welcome a new...
|
by: adsilva |
last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
|
by: 6302768590 |
last post by:
Hai team
i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated ...
|
by: muto222 |
last post by:
How can i add a mobile payment intergratation into php mysql website.
| |
by: bsmnconsultancy |
last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence...
| |