ERPNext Biometric Integration Windows Service Error

Hi, manually when is run in cmd line it works.

When installed as a windows service and try to start the service. The below msg displays,


Below is the error details which i got in event log,

Python could not import the service’s module
Traceback (most recent call last):
File “C:\TimeAttendance\biometric-attendance-sync-tool-master\”, line 4, in
from erpnext_sync import main
File “C:\TimeAttendance\biometric-attendance-sync-tool-master\”, line 305, in
status = pickledb.load(’/’.join([config.LOGS_DIRECTORY, ‘status.json’]), True)
File “C:\Program Files\Python36\lib\site-packages\”, line 43, in load
return PickleDB(location, auto_dump, sig)
File “C:\Program Files\Python36\lib\site-packages\”, line 57, in init
File “C:\Program Files\Python36\lib\site-packages\”, line 77, in set_sigterm_handler
signal.signal(signal.SIGTERM, sigterm_handler)
File “C:\Program Files\Python36\lib\”, line 47, in signal
handler = _signal.signal(_enum_to_int(signalnum), _enum_to_int(handler))
ValueError: signal only works in main thread
%2: %3

I have the same problem! Did you resolve it? Thank you

Did you resolve it? Can’t find any solution!

Faced the same error with the windows service. So found an alternative to use Windows Task Scheduler to schedule frequent run for the script. Also for this to work make sure that the file has been correctly configured. You can invoke the program manually once to do the initial sync and double check if everything is working fine.

You can add a new task in Windows Task Scheduler with the following settings. This will run the script every 5 mins and sync the updated data with your erpnext system.

  1. New Task

  2. Add Trigger to run every day at interval of 5 minutes

  3. Start action
    a) Provide path to where python is installed. I have version 3.10, your directory will change based on which version you have installed.
    b) Option Parameter - provide the name of the script (not the This script will be executed.
    c) Start Directory - Where you have stored the file. Make sure no one moves or deletes the directory. Also ensure that the path as a trailing ** in the end.

  4. In the conditions change so that only 1 instance is running at a given time. The initial sync can take longer.

1 Like