Hello Team,
cat error.log
2020-12-22 08:32:17,318 ERROR 192.168.1.55 exception when fetching from device...
Traceback (most recent call last):
File "/home/ubuntu/biometric-attendance-sync-tool/biovenv/lib/python3.7/site-packages/zk/base.py", line 249, in __send_command
self.__tcp_data_recv = self.__sock.recv(response_size + 8)
ConnectionResetError: [Errno 104] Connection reset by peer
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "erpnext_sync.py", line 138, in get_all_attendance_from_device
conn = zk.connect()
File "/home/ubuntu/biometric-attendance-sync-tool/biovenv/lib/python3.7/site-packages/zk/base.py", line 373, in connect
cmd_response = self.__send_command(const.CMD_CONNECT)
File "/home/ubuntu/biometric-attendance-sync-tool/biovenv/lib/python3.7/site-packages/zk/base.py", line 260, in __send_command
raise ZKNetworkError(str(e))
zk.exception.ZKNetworkError: [Errno 104] Connection reset by peer
2020-12-22 08:32:17,324 ERROR exception when calling pull_process_and_push_data function for device{"device_id": "SHOWROOM", "ip": "192.168.1.55", "punch_direction": "AUTO", "clear_from_device_on_fetch": false}
Traceback (most recent call last):
File "/home/ubuntu/biometric-attendance-sync-tool/biovenv/lib/python3.7/site-packages/zk/base.py", line 249, in __send_command
self.__tcp_data_recv = self.__sock.recv(response_size + 8)
ConnectionResetError: [Errno 104] Connection reset by peer
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "erpnext_sync.py", line 138, in get_all_attendance_from_device
conn = zk.connect()
File "/home/ubuntu/biometric-attendance-sync-tool/biovenv/lib/python3.7/site-packages/zk/base.py", line 373, in connect
cmd_response = self.__send_command(const.CMD_CONNECT)
File "/home/ubuntu/biometric-attendance-sync-tool/biovenv/lib/python3.7/site-packages/zk/base.py", line 260, in __send_command
raise ZKNetworkError(str(e))
zk.exception.ZKNetworkError: [Errno 104] Connection reset by peer
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "erpnext_sync.py", line 51, in main
pull_process_and_push_data(device, device_attendance_logs)
File "erpnext_sync.py", line 78, in pull_process_and_push_data
device_attendance_logs = get_all_attendance_from_device(device['ip'], device_id=device['device_id'], clear_from_device_on_fetch=device['clear_from_device_on_fetch'])
File "erpnext_sync.py", line 159, in get_all_attendance_from_device
raise Exception('Device fetch failed.')
Exception: Device fetch failed.
2020-12-22 08:32:20,014 ERROR Error during ERPNext API Call. 1 1605798758.0 WORKSHOP IN Traceback (most recent call last):
File "/home/frappe/benches/bench-version-13-f2-35/apps/frappe/frappe/app.py", line 64, in application
response = frappe.api.handle()
File "/home/frappe/benches/bench-version-13-f2-35/apps/frappe/frappe/api.py", line 58, in handle
return frappe.handler.handle()
File "/home/frappe/benches/bench-version-13-f2-35/apps/frappe/frappe/handler.py", line 30, in handle
data = execute_cmd(cmd)
File "/home/frappe/benches/bench-version-13-f2-35/apps/frappe/frappe/handler.py", line 70, in execute_cmd
return frappe.call(method, **frappe.form_dict)
File "/home/frappe/benches/bench-version-13-f2-35/apps/frappe/frappe/init.py", line 1107, in call
return fn(*args, **newargs)
File "/home/frappe/benches/bench-version-13-f2-35/apps/erpnext/erpnext/hr/doctype/employee_checkin/employee_checkin.py", line 70, in add_log_based_on_employee_field
doc.insert()
File "/home/frappe/benches/bench-version-13-f2-35/apps/frappe/frappe/model/document.py", line 238, in insert
self.run_before_save_methods()
File "/home/frappe/benches/bench-version-13-f2-35/apps/frappe/frappe/model/document.py", line 930, in run_before_save_methods
self.run_method("validate")
File "/home/frappe/benches/bench-version-13-f2-35/apps/frappe/frappe/model/document.py", line 831, in run_method
out = Document.hook(fn)(self, *args, **kwargs)
File "/home/frappe/benches/bench-version-13-f2-35/apps/frappe/frappe/model/document.py", line 1116, in composer
return composed(self, method, *args, **kwargs)
File "/home/frappe/benches/bench-version-13-f2-35/apps/frappe/frappe/model/document.py", line 1099, in runner
add_to_return_value(self, fn(self, *args, **kwargs))
File "/home/frappe/benches/bench-version-13-f2-35/apps/frappe/frappe/model/document.py", line 825, in
fn = lambda self, *args, **kwargs: getattr(self, method)(*args, **kwargs)
File "/home/frappe/benches/bench-version-13-f2-35/apps/erpnext/erpnext/hr/doctype/employee_checkin/employee_checkin.py", line 15, in validate
self.validate_duplicate_log()
File "/home/frappe/benches/bench-version-13-f2-35/apps/erpnext/erpnext/hr/doctype/employee_checkin/employee_checkin.py", line 26, in validate_duplicate_log
.format("
" + doc_link))
File "/home/frappe/benches/bench-version-13-f2-35/apps/frappe/frappe/init.py", line 409, in throw
msgprint(msg, raise_exception=exc, title=title, indicator='red', is_minimizable=is_minimizable, wide=wide, as_list=as_list)
File "/home/frappe/benches/bench-version-13-f2-35/apps/frappe/frappe/init.py", line 388, in msgprint
_raise_exception()
File "/home/frappe/benches/bench-version-13-f2-35/apps/frappe/frappe/init.py", line 342, in _raise_exception
raise raise_exception(msg)
frappe.exceptions.ValidationError: This employee already has a log with the same timestamp.
Employee Checkin EMP-CKIN-12-2020-000021
2020-12-22 08:32:20,016 ERROR exception when calling pull_process_and_push_data function for device{"device_id": "WORKSHOP", "ip": "192.168.1.56", "punch_direction": "AUTO", "clear_from_device_on_fetch": false}
Traceback (most recent call last):
File "erpnext_sync.py", line 51, in main
pull_process_and_push_data(device, device_attendance_logs)
File "erpnext_sync.py", line 129, in pull_process_and_push_data
raise Exception('API Call to ERPNext Failed.')
Exception: API Call to ERPNext Failed.
2020-12-22 08:32:34,150 ERROR Error during ERPNext API Call. 1 1607936331.0 ADMIN IN Traceback (most recent call last):
File "/home/frappe/benches/bench-version-13-f2-35/apps/frappe/frappe/app.py", line 64, in application
response = frappe.api.handle()
File "/home/frappe/benches/bench-version-13-f2-35/apps/frappe/frappe/api.py", line 58, in handle
return frappe.handler.handle()
File "/home/frappe/benches/bench-version-13-f2-35/apps/frappe/frappe/handler.py", line 30, in handle
data = execute_cmd(cmd)
File "/home/frappe/benches/bench-version-13-f2-35/apps/frappe/frappe/handler.py", line 70, in execute_cmd
return frappe.call(method, **frappe.form_dict)
File "/home/frappe/benches/bench-version-13-f2-35/apps/frappe/frappe/init.py", line 1107, in call
return fn(*args, **newargs)
File "/home/frappe/benches/bench-version-13-f2-35/apps/erpnext/erpnext/hr/doctype/employee_checkin/employee_checkin.py", line 70, in add_log_based_on_employee_field
doc.insert()
File "/home/frappe/benches/bench-version-13-f2-35/apps/frappe/frappe/model/document.py", line 238, in insert
self.run_before_save_methods()
File "/home/frappe/benches/bench-version-13-f2-35/apps/frappe/frappe/model/document.py", line 930, in run_before_save_methods
self.run_method("validate")
File "/home/frappe/benches/bench-version-13-f2-35/apps/frappe/frappe/model/document.py", line 831, in run_method
out = Document.hook(fn)(self, *args, **kwargs)
File "/home/frappe/benches/bench-version-13-f2-35/apps/frappe/frappe/model/document.py", line 1116, in composer
return composed(self, method, *args, **kwargs)
File "/home/frappe/benches/bench-version-13-f2-35/apps/frappe/frappe/model/document.py", line 1099, in runner
add_to_return_value(self, fn(self, *args, **kwargs))
File "/home/frappe/benches/bench-version-13-f2-35/apps/frappe/frappe/model/document.py", line 825, in
fn = lambda self, *args, **kwargs: getattr(self, method)(*args, **kwargs)
File "/home/frappe/benches/bench-version-13-f2-35/apps/erpnext/erpnext/hr/doctype/employee_checkin/employee_checkin.py", line 15, in validate
self.validate_duplicate_log()
File "/home/frappe/benches/bench-version-13-f2-35/apps/erpnext/erpnext/hr/doctype/employee_checkin/employee_checkin.py", line 26, in validate_duplicate_log
.format("
" + doc_link))
File "/home/frappe/benches/bench-version-13-f2-35/apps/frappe/frappe/init.py", line 409, in throw
msgprint(msg, raise_exception=exc, title=title, indicator='red', is_minimizable=is_minimizable, wide=wide, as_list=as_list)
File "/home/frappe/benches/bench-version-13-f2-35/apps/frappe/frappe/init.py", line 388, in msgprint
_raise_exception()
File "/home/frappe/benches/bench-version-13-f2-35/apps/frappe/frappe/init.py", line 342, in _raise_exception
raise raise_exception(msg)
frappe.exceptions.ValidationError: This employee already has a log with the same timestamp.
Employee Checkin EMP-CKIN-12-2020-000300
2020-12-22 08:32:34,151 ERROR exception when calling pull_process_and_push_data function for device{"device_id": "ADMIN", "ip": "192.168.1.57", "punch_direction": "AUTO", "clear_from_device_on_fetch": false}
Traceback (most recent call last):
File "erpnext_sync.py", line 51, in main
pull_process_and_push_data(device, device_attendance_logs)
File "erpnext_sync.py", line 129, in pull_process_and_push_data
raise Exception('API Call to ERPNext Failed.')
Exception: API Call to ERPNext Failed.
2020-12-22 08:32:49,211 ERROR 192.168.1.55 exception when fetching from device...
Traceback (most recent call last):
File "/home/ubuntu/biometric-attendance-sync-tool/biovenv/lib/python3.7/site-packages/zk/base.py", line 249, in __send_command
self.__tcp_data_recv = self.__sock.recv(response_size + 8)
ConnectionResetError: [Errno 104] Connection reset by peer
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "erpnext_sync.py", line 138, in get_all_attendance_from_device
conn = zk.connect()
File "/home/ubuntu/biometric-attendance-sync-tool/biovenv/lib/python3.7/site-packages/zk/base.py", line 373, in connect
cmd_response = self.__send_command(const.CMD_CONNECT)
File "/home/ubuntu/biometric-attendance-sync-tool/biovenv/lib/python3.7/site-packages/zk/base.py", line 260, in __send_command
raise ZKNetworkError(str(e))
zk.exception.ZKNetworkError: [Errno 104] Connection reset by peer
2020-12-22 08:32:49,213 ERROR exception when calling pull_process_and_push_data function for device{"device_id": "SHOWROOM", "ip": "192.168.1.55", "punch_direction": "AUTO", "clear_from_device_on_fetch": false}
Traceback (most recent call last):
File "/home/ubuntu/biometric-attendance-sync-tool/biovenv/lib/python3.7/site-packages/zk/base.py", line 249, in __send_command
self.__tcp_data_recv = self.__sock.recv(response_size + 8)
ConnectionResetError: [Errno 104] Connection reset by peer
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "erpnext_sync.py", line 138, in get_all_attendance_from_device
conn = zk.connect()
File "/home/ubuntu/biometric-attendance-sync-tool/biovenv/lib/python3.7/site-packages/zk/base.py", line 373, in connect
cmd_response = self.__send_command(const.CMD_CONNECT)
File "/home/ubuntu/biometric-attendance-sync-tool/biovenv/lib/python3.7/site-packages/zk/base.py", line 260, in __send_command
raise ZKNetworkError(str(e))
zk.exception.ZKNetworkError: [Errno 104] Connection reset by peer
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "erpnext_sync.py", line 51, in main
pull_process_and_push_data(device, device_attendance_logs)
File "erpnext_sync.py", line 78, in pull_process_and_push_data
device_attendance_logs = get_all_attendance_from_device(device['ip'], device_id=device['device_id'], clear_from_device_on_fetch=device['clear_from_device_on_fetch'])
File "erpnext_sync.py", line 159, in get_all_attendance_from_device
raise Exception('Device fetch failed.')
Exception: Device fetch failed.
2020-12-22 08:32:51,910 ERROR Error during ERPNext API Call. 1 1605798758.0 WORKSHOP IN Traceback (most recent call last):
File "/home/frappe/benches/bench-version-13-f2-35/apps/frappe/frappe/app.py", line 64, in application
response = frappe.api.handle()
File "/home/frappe/benches/bench-version-13-f2-35/apps/frappe/frappe/api.py", line 58, in handle
return frappe.handler.handle()
File "/home/frappe/benches/bench-version-13-f2-35/apps/frappe/frappe/handler.py", line 30, in handle
data = execute_cmd(cmd)
File "/home/frappe/benches/bench-version-13-f2-35/apps/frappe/frappe/handler.py", line 70, in execute_cmd
return frappe.call(method, **frappe.form_dict)
File "/home/frappe/benches/bench-version-13-f2-35/apps/frappe/frappe/init.py", line 1107, in call
return fn(*args, **newargs)
File "/home/frappe/benches/bench-version-13-f2-35/apps/erpnext/erpnext/hr/doctype/employee_checkin/employee_checkin.py", line 70, in add_log_based_on_employee_field
doc.insert()
File "/home/frappe/benches/bench-version-13-f2-35/apps/frappe/frappe/model/document.py", line 238, in insert
self.run_before_save_methods()
File "/home/frappe/benches/bench-version-13-f2-35/apps/frappe/frappe/model/document.py", line 930, in run_before_save_methods
self.run_method("validate")
File "/home/frappe/benches/bench-version-13-f2-35/apps/frappe/frappe/model/document.py", line 831, in run_method
out = Document.hook(fn)(self, *args, **kwargs)
File "/home/frappe/benches/bench-version-13-f2-35/apps/frappe/frappe/model/document.py", line 1116, in composer
return composed(self, method, *args, **kwargs)
File "/home/frappe/benches/bench-version-13-f2-35/apps/frappe/frappe/model/document.py", line 1099, in runner
add_to_return_value(self, fn(self, *args, **kwargs))
File "/home/frappe/benches/bench-version-13-f2-35/apps/frappe/frappe/model/document.py", line 825, in
fn = lambda self, *args, **kwargs: getattr(self, method)(*args, **kwargs)
File "/home/frappe/benches/bench-version-13-f2-35/apps/erpnext/erpnext/hr/doctype/employee_checkin/employee_checkin.py", line 15, in validate
self.validate_duplicate_log()
File "/home/frappe/benches/bench-version-13-f2-35/apps/erpnext/erpnext/hr/doctype/employee_checkin/employee_checkin.py", line 26, in validate_duplicate_log
.format("
" + doc_link))
File "/home/frappe/benches/bench-version-13-f2-35/apps/frappe/frappe/init.py", line 409, in throw
msgprint(msg, raise_exception=exc, title=title, indicator='red', is_minimizable=is_minimizable, wide=wide, as_list=as_list)
File "/home/frappe/benches/bench-version-13-f2-35/apps/frappe/frappe/init.py", line 388, in msgprint
_raise_exception()
File "/home/frappe/benches/bench-version-13-f2-35/apps/frappe/frappe/init.py", line 342, in _raise_exception
raise raise_exception(msg)
frappe.exceptions.ValidationError: This employee already has a log with the same timestamp.
Employee Checkin EMP-CKIN-12-2020-000021
2020-12-22 08:32:51,911 ERROR exception when calling pull_process_and_push_data function for device{"device_id": "WORKSHOP", "ip": "192.168.1.56", "punch_direction": "AUTO", "clear_from_device_on_fetch": false}
Traceback (most recent call last):
File "erpnext_sync.py", line 51, in main
pull_process_and_push_data(device, device_attendance_logs)
File "erpnext_sync.py", line 129, in pull_process_and_push_data
raise Exception('API Call to ERPNext Failed.')
Exception: API Call to ERPNext Failed.
2020-12-22 08:33:16,322 ERROR Error during ERPNext API Call. 1 1607936331.0 ADMIN IN Traceback (most recent call last):
File "/home/frappe/benches/bench-version-13-f2-35/apps/frappe/frappe/app.py", line 64, in application
response = frappe.api.handle()
File "/home/frappe/benches/bench-version-13-f2-35/apps/frappe/frappe/api.py", line 58, in handle
return frappe.handler.handle()
File "/home/frappe/benches/bench-version-13-f2-35/apps/frappe/frappe/handler.py", line 30, in handle
data = execute_cmd(cmd)
File "/home/frappe/benches/bench-version-13-f2-35/apps/frappe/frappe/handler.py", line 70, in execute_cmd
return frappe.call(method, **frappe.form_dict)
File "/home/frappe/benches/bench-version-13-f2-35/apps/frappe/frappe/init.py", line 1107, in call
return fn(*args, **newargs)
File "/home/frappe/benches/bench-version-13-f2-35/apps/erpnext/erpnext/hr/doctype/employee_checkin/employee_checkin.py", line 70, in add_log_based_on_employee_field
doc.insert()
File "/home/frappe/benches/bench-version-13-f2-35/apps/frappe/frappe/model/document.py", line 238, in insert
self.run_before_save_methods()
File "/home/frappe/benches/bench-version-13-f2-35/apps/frappe/frappe/model/document.py", line 930, in run_before_save_methods
self.run_method("validate")
File "/home/frappe/benches/bench-version-13-f2-35/apps/frappe/frappe/model/document.py", line 831, in run_method
out = Document.hook(fn)(self, *args, **kwargs)
File "/home/frappe/benches/bench-version-13-f2-35/apps/frappe/frappe/model/document.py", line 1116, in composer
return composed(self, method, *args, **kwargs)
File "/home/frappe/benches/bench-version-13-f2-35/apps/frappe/frappe/model/document.py", line 1099, in runner
add_to_return_value(self, fn(self, *args, **kwargs))
File "/home/frappe/benches/bench-version-13-f2-35/apps/frappe/frappe/model/document.py", line 825, in
fn = lambda self, *args, **kwargs: getattr(self, method)(*args, **kwargs)
File "/home/frappe/benches/bench-version-13-f2-35/apps/erpnext/erpnext/hr/doctype/employee_checkin/employee_checkin.py", line 15, in validate
self.validate_duplicate_log()
File "/home/frappe/benches/bench-version-13-f2-35/apps/erpnext/erpnext/hr/doctype/employee_checkin/employee_checkin.py", line 26, in validate_duplicate_log
.format("
" + doc_link))
File "/home/frappe/benches/bench-version-13-f2-35/apps/frappe/frappe/init.py", line 409, in throw
msgprint(msg, raise_exception=exc, title=title, indicator='red', is_minimizable=is_minimizable, wide=wide, as_list=as_list)
File "/home/frappe/benches/bench-version-13-f2-35/apps/frappe/frappe/init.py", line 388, in msgprint
_raise_exception()
File "/home/frappe/benches/bench-version-13-f2-35/apps/frappe/frappe/init.py", line 342, in _raise_exception
raise raise_exception(msg)
frappe.exceptions.ValidationError: This employee already has a log with the same timestamp.
Employee Checkin EMP-CKIN-12-2020-000300
2020-12-22 08:33:16,323 ERROR exception when calling pull_process_and_push_data function for device{"device_id": "ADMIN", "ip": "192.168.1.57", "punch_direction": "AUTO", "clear_from_device_on_fetch": false}
Traceback (most recent call last):
File "erpnext_sync.py", line 51, in main
pull_process_and_push_data(device, device_attendance_logs)
File "erpnext_sync.py", line 129, in pull_process_and_push_data
raise Exception('API Call to ERPNext Failed.')
Exception: API Call to ERPNext Failed.
ubuntu@ubuntu:~/biometric-attendance-sync-tool/logs$