473,748 Members | 4,030 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

python service problem

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 jHistExportServ ice

The important remnant seems to be:
HKLM\SYSTEM\Con trolSet002\Serv ices\jHistExpor tService and children

which actually holds details of how to run the service. For the record,
the other remnants are:
HKLM\SYSTEM\Con trolSet001\Enum \Root\LEGACY_JH ISTEXPORTSERVIC E and children

HKLM\SYSTEM\Con trolSet001\Serv ices\EventLog\A pplication\jHis tExportService
and children

HKLM\SYSTEM\Con trolSet002\Serv ices\EventLog\A pplication\jHis tExportService
and children
HKLM\SYSTEM\Cur rentControlSet\ Enum\Root\LEGAC Y_JHISTEXPORTSE RVICE

HKLM\SYSTEM\Cur rentControlSet\ Services\EventL og\Application\ jHistExportServ ice
Jul 18 '05 #1
3 5217
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 jHistExportServ ice

The important remnant seems to be:
HKLM\SYSTEM\Con trolSet002\Serv ices\jHistExpor tService and children

which actually holds details of how to run the service. For the record,
the other remnants are:
HKLM\SYSTEM\Con trolSet001\Enum \Root\LEGACY_JH ISTEXPORTSERVIC E and children
HKLM\SYSTEM\Con trolSet001\Serv ices\EventLog\A pplication\jHis tExportService
and children

HKLM\SYSTEM\Con trolSet002\Serv ices\EventLog\A pplication\jHis tExportService
and children
HKLM\SYSTEM\Cur rentControlSet\ Enum\Root\LEGAC Y_JHISTEXPORTSE RVICE

HKLM\SYSTEM\Cur rentControlSet\ Services\EventL og\Application\ jHistExportServ i
ce
Jul 18 '05 #2
Larry Bates wrote:
"David Fraser" <da****@sjsoft. com> wrote:
One thing I noticed about the first computer is that, even after
uninstallin g 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
Jul 18 '05 #3
Peter Hansen wrote:
Larry Bates wrote:
> "David Fraser" <da****@sjsoft. com> wrote:
>
>>One thing I noticed about the first computer is that, even after
>>uninstallin g 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
Jul 18 '05 #4

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

0
1549
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 files is bigger than a given upper limit, then it starts to delete log files until the space is less than a given lower limit. I configured the service to start up automatically on system boot. The script checks the space used by log files every 1000...
0
1388
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 service -> it's ok 2. I start the service -> it's ok 3. I stop the service -> it's ok
4
1892
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 start it on Windows NT Workstation.
2
4255
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 experiment was to use Python to consume these same web services, and even though I am able to get Python to consume web services from a variety of sources (Apache SOAP, Glue, AXIS), I cannot get web services created with MS.NET to work. Actually,...
3
2603
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 problem cann't be reproduced easily in my system and the call stack generated by the application is given below. Please note that the call stack generation is taken from crash dump file.
0
1268
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. The following error has been reported to event viewer sparadically. "Reporting queued error: faulting application PythonService.exe, version 2.3.0.163, faulting module python23.dll, version 2.3.3150.1012, fault address 0x0005c202."
3
2606
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 in background as NT service. I got a example code: SmallestService.py from chapter 18 of the book "Python Programming On Win32" by Mark Hammond etc. The code is as follows and runs well as an NT service.
1
3034
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 install | start | stop The problem is: if I create an exe of this script (all required modules are included in the exe) with gui2exe (a frontend to py2exe) I can install the service - but not start it. The error it returns is "Error
2
2648
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 ~/Documents/Code/Python/src/jester/service.py -m jester then I did : make
0
8991
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
9374
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
9325
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 Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
8244
agi2029
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, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
6796
isladogs
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 presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
6076
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
4607
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
4876
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
3
2215
bsmnconsultancy
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 can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.