BrokenPipe ErrorNo32

Hi There,
Totally new to erpnext
I am getting a brokenpipe error.no 32
this error is appears, with passing the parameter and without paramters also.
from this code:

import frappe

@frappe.whitelist()
def emploc(employee=None):
if not employee:
return {“error”: “No / Invalid employee ID”}

try:
    loc = frappe.db.sql(
        """SELECT ec.employee, ec.employee_name, ec.device_id, ec.time, e.department, e.payroll_cost_center, f.file_url
           FROM `tabEmployee Checkin` ec
           INNER JOIN `tabEmployee` e ON ec.employee = e.name
           LEFT JOIN `tabFile` f ON f.attached_to_name = e.user_id AND (f.file_url LIKE '%.png' OR f.file_url LIKE '%.jpg') AND f.attached_to_field = 'user_image'
           WHERE ec.log_type = 'IN' AND ec.employee = %s""",
        (employee),
        as_dict=True
    )
    return loc
except Exception as e:
    print(f"Error: {e}")
finally:
    frappe.db.close()

Secondly, As I have 0 experience in erpnext / frappe, can anyone please recommend me a good source to learn ERPNEXT /FRAPPE in depth/ extensively.

THANK YOU :innocent: