Python Forum
Need help with debugging employee directory csv upload
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Need help with debugging employee directory csv upload
#1
Hey everyone - new to the code world so bare with me while I meander through this request for assistance...

I'm working in [REMOVED] - because I'm illiterate in code... trying to learn because I have tasked myself with the daunting task of developing an app to manage various workflows within a construction company. Ultimately I would like for it to manage everything (I have modules built for Estimating - including an AI-powered Takeoff sub-module, estimating module, and proposal generaotr), a pre-con module for sequencing, scheduling, and developing a manpower demand curve), and Project management module for processing all of the various PM workflows day to day) - all are in development but done currently work all the way through. Although those are important features to me, the issue that is causing us the biggest headache is our timesheet submission process. currently we are using an excel spreadsheet that I have developed which utilities very basic functions within excel and has the entire workbook locked except for the areas where the guys can enter data... they still have problems with the fucntionality because some guys use laptops with windows while somem use Apple products and still others are stuck using chromebooks... not everyone has a platform that ucan run microsoft office products and because of this theres a lot of opportunity for error... so for now, I have pushed the other modules to the side and I am just trying to code in the ability for us to upload our existing employee directory to an HR module (WorkforceHub Module) that I have put together and save it successfully to a database managed in Supabase. Additionally I would like for it to route this directory to a different module for our field operations (FieldOps Module) where the end user could select said employees from a drop down list and add them to a timesheet where they can enter in time weekly and submit to the PM in the project management module for approval and routing back to the HR module for final processing and then once all corrections are made and the final time sheet is approved for payment, I would like for it to then push the data back to the PM module for final data analytics. im stuck with the upload failing with the following error message: "Failed to execute 'postMessage' on 'Window': Response object could not be cloned." help?

Sorry for the elongated intro... any troubleshooting/debugging hints/tips/advise would be greatly appreciated...
Reply
#2
From your ramble I understand you want to connect to a database using Python? Is that correct?

If so, you may look here for help. There are also many other webpages with help and advice for doing this.

The link is documentation for the Python module pymysql. I have used this module very successufully to connect to a database on a cloud server.

Apparently many devices like mobile phones and whatever use sqlite. I have no experience with sqlite, but with the Python module sqlite3 you can interact with such a database. Here are the docs for the Python module sqllite3

If you want to manipulate your database from your computer, install phpmyadmin

There are many webpages which will give you good advice on how to install phpmyadmin, just do a search. phpmyadmin is not Python, it is written in PHP.

Using phpmyadmin you can very easily import vast amounts of data using .csv files.
Reply
#3
@schwifty_mcplugstein: so what's the actual problem now...? Posting error messages you get is in the given case pretty pointless, as we do not know your code, thus we cannot review for possible mistakes.

Dealing with uploaded data in form of editable files created by humans, like an Excel sheet or a CSV file or a JSON file or ... requires extensive error handling and robustness to wrong / missing data, as - at least in my opinion - there is no way to relying on that the data has always the right structure and contains always all the data you expect. Humans make mistakes. One possible way to circumvent that it to work exclusively with web-based forms, as you can enforce the structure plus you can add error handling and missing data handling two times: on the client-side and on the server-side. Plus web-forms work cross-platform, as the require a browser only. Once you got structured and complete data, it should be very easy to store in a suitable data base or structured data storage format and process the data.

Regards, noisefloor
Reply
#4
That specific error — “Failed to execute 'postMessage' on 'Window': Response object could not be cloned” — usually happens when you try to directly return or pass the Response object itself between contexts (like via postMessage or even sometimes in a fetch flow). The Response object isn’t fully serializable, so it can’t be cloned.

👉 A quick fix is to handle the data from the response before passing it along. For example, instead of sending the raw Response, use something like:

const res = await fetch(url, options);
const data = await res.json(); // or res.text(), depending on what you're working with
// then pass 'data' instead of 'res'



If you’re using Supabase, make sure you’re sending the parsed JSON object or array of records, not the raw response.

Also, double-check:

That the upload request is going to the right Supabase endpoint.

You’re not accidentally trying to pass the whole res object into state, props, or postMessage.

It sounds like you’re building a pretty ambitious system 👏— my suggestion is to keep focusing on one small module at a time (like your HR upload) and get that working smoothly before wiring all the routing. Once you solve the data upload step, linking it to the timesheet and approval flow will get easier.
Reply
#5
That specific error usually occurs when trying to post a non‑serializable object (like a Response or File object) via postMessage. You likely need to process the file (e.g., convert it to JSON or base64) before sending it. Ensure your upload function serializes data correctly and test on all devices to avoid compatibility issues.
buran write Oct-13-2025, 05:22 AM:
Spam content removed
Reply


Possibly Related Threads…
Thread Author Replies Views Last Post
  Deleting employee from list SephMon 3 5,229 Jan-05-2021, 04:15 AM
Last Post: deanhystad
  plot multiple employee sales data in a single graph pitanshu 0 2,774 Oct-24-2019, 01:56 PM
Last Post: pitanshu
  How are these Employee objects stored? Vysero 2 4,765 Jul-13-2018, 12:05 PM
Last Post: buran

Forum Jump:

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020