Hi everyone,
I’m hoping for some expert guidance on a very stubborn “silent failure” issue while integrating a Django application with SENAITE LIMS. We have exhausted all client-side debugging and believe the issue is on the server.
The Goal: I have a Django web app that automates soil mechanics calculations. The final step is to programmatically send these results to an Analysis Request in SENAITE and change its workflow state.
The Problem: My Django application sends the results to SENAITE’s standard web form handlers. The SENAITE server responds with a 200 OK success code. However, the data is never saved, and the workflow state does not change. This silent failure occurs even when authenticating as the admin/Manager user, and there are no corresponding errors in the SENAITE log files (event.log or docker logs).
What We’ve Tried (The Long Journey):
-
JSON API Failure: We initially tried using the
senaite.jsonapiadd-on but found its/updateand/searchendpoints to be unreliable in our environment, leading to the original silent failures. -
“Browser Simulation” Workaround: We developed a method to simulate a real user. The code programmatically logs in to get a session cookie and an
_authenticatortoken, and then makesPOSTrequests to the same URLs the browser uses (e.g.,.../set_fieldsto save results and.../transitionsto change the workflow state). -
Hybrid Authentication: We created a final client that uses two authentication methods: simple Basic Auth for reading data (which works perfectly) and the full session-based login for the browser simulation.
-
The Final Test (Using Admin User): To eliminate any possibility of a permissions issue, we ran the entire process using the credentials of the
admin/Manageruser. The silent failure still occurs.
Our Core Questions for the Community:-
Why would a programmatic
POSTrequest, authenticated with a Manager’s session, result in a200 OKbut a silent failure to save data? -
Is there a known issue in SENAITE LIMS where requests from a Python library like
requestsare treated differently than those from a real browser, even if headers and payload seem identical? -
What is the best way to debug this on the server side when the Zope logs are silent? Could this be a transaction veto or a database issue (e.g., read-only) that doesn’t produce an error?
Any insight or suggestions for server-side debugging would be incredibly helpful.
Thank you!
-