HRMS Auto attendance calculation eror

While employees can succesfully Check-in and Check-out, auto-attendance has stopped being calculated for more than a month now.
Earlier, for the month of July, the attendance was being calculated. However, it suddenly stopped for the month of August 2024.
Here’s the screenshot of Shift Type, where “Last sync of Check-IN” is also updated.

Also, We tried manual attendance calculation by clicking “Mark Attendance” but it showed error as mentioned below:

App Versions

{
	"erpnext": "15.27.6",
	"frappe": "15.29.2",
	"helpdesk": "0.10.0",
	"hrms": "15.22.2",
	"payments": "0.0.1",
	"twilio_integration": "0.0.1"
}

Route

Form/Shift Type/General Shift

Traceback

Traceback (most recent call last):
  File "apps/frappe/frappe/app.py", line 114, in application
    response = frappe.api.handle(request)
  File "apps/frappe/frappe/api/__init__.py", line 49, in handle
    data = endpoint(**arguments)
  File "apps/frappe/frappe/api/v1.py", line 36, in handle_rpc_call
    return frappe.handler.handle()
  File "apps/frappe/frappe/handler.py", line 49, in handle
    data = execute_cmd(cmd)
  File "apps/frappe/frappe/handler.py", line 85, in execute_cmd
    return frappe.call(method, **frappe.form_dict)
  File "apps/frappe/frappe/__init__.py", line 1768, in call
    return fn(*args, **newargs)
  File "apps/frappe/frappe/handler.py", line 330, in run_doc_method
    response = doc.run_method(method)
  File "apps/frappe/frappe/model/document.py", line 962, in run_method
    out = Document.hook(fn)(self, *args, **kwargs)
  File "apps/frappe/frappe/model/document.py", line 1322, in composer
    return composed(self, method, *args, **kwargs)
  File "apps/frappe/frappe/model/document.py", line 1304, in runner
    add_to_return_value(self, fn(self, *args, **kwargs))
  File "apps/frappe/frappe/model/document.py", line 959, in fn
    return method_object(*args, **kwargs)
  File "apps/frappe/frappe/utils/typing_validations.py", line 31, in wrapper
    return func(*args, **kwargs)
  File "apps/hrms/hrms/hr/doctype/shift_type/shift_type.py", line 41, in process_auto_attendance
    attendance_date = key[1].date()
AttributeError: 'NoneType' object has no attribute 'date'

Request Data

{
	"type": "POST",
	"args": {
		"docs": "{\"name\":\"General Shift\",\"owner\":\"*myemailid*\",\"creation\":\"2024-06-17 14:40:29.742701\",\"modified\":\"2024-09-02 15:22:50.905168\",\"modified_by\":\"*myemailid*\",\"docstatus\":0,\"idx\":313,\"start_time\":\"9:00:00\",\"end_time\":\"18:00:00\",\"holiday_list\":\"2024 Holidays\",\"enable_auto_attendance\":1,\"determine_check_in_and_check_out\":\"Alternating entries as IN and OUT during the same shift\",\"working_hours_calculation_based_on\":\"First Check-in and Last Check-out\",\"begin_check_in_before_shift_start_time\":60,\"allow_check_out_after_shift_end_time\":180,\"mark_auto_attendance_on_holidays\":1,\"working_hours_threshold_for_half_day\":9,\"working_hours_threshold_for_absent\":4,\"process_attendance_after\":\"2024-06-01\",\"last_sync_of_checkin\":\"2024-09-01 18:27:39\",\"enable_late_entry_marking\":1,\"late_entry_grace_period\":60,\"enable_early_exit_marking\":1,\"early_exit_grace_period\":30,\"doctype\":\"Shift Type\"}",
		"method": "process_auto_attendance"
	},
	"freeze": true,
	"headers": {},
	"error_handlers": {},
	"url": "/api/method/run_doc_method",
	"request_id": null
}

Response Data

{
	"exception": "AttributeError: 'NoneType' object has no attribute 'date'",
	"exc_type": "AttributeError",
	"_exc_source": "hrms (app)"
}

There might be some buggy update somewhere in the whole chain.

There’s a None value in the attendance_date field, which is causing the process_auto_attendance method to fail.

This error might be due to missing or invalid shift assignment entry for some employees.

Look through your check-in and attendance records to confirm there are no missing or malformed entries, especially for the days auto-attendance stopped working

#RespectQuestion #EncourageNewUser