debug 500 error when there is nothing in the PHP log

(still running Sugar Pro 11.0.3 sigh Frowning2)

I have a 500 error when creating a related Address Location (custom module) on an Account

The front end shows:

HTTP: 500 Internal Server Error

Database failure. Please refer to sugarcrm.log for details.

the Console shows the error as:

POST https://.../sugarcrm/rest/v11_12/Accounts/f5c5abe6-fcc9-11ee-986b-001a4a160394/link/addlo_addretions_accounts?erased_fields=true&viewed=1 500 (Internal Server Error)

Usually for 500 errors I can check the PHP logs and see what's happening but this time there is nothing in the php log and nothing in the sugar log (other than my "fatal" global log statements used to track the progress of some logic hooks)

The Address Location is correctly created and saved in the DB. The records are correctly related.
So I really don't know why the front end (and any APIs that build the relationship) are failing.

There are no failed queries or other suspicious activity in the DB either.

Any tips on what else to look at?

Thanks,

FrancescaS

Parents
  •   's suggestion revealed the culprit, THANK YOU!

    It looks like I have a logic hook that kicks off between the insert in the core table and the insert in the custom table causing two inserts for the same id_c in the related module's custom table. The first insert works fine, so the record looks correct, the second insert fails at the DB level (duplicate id_c) and triggers the 500 error.

    Working to unravel where / how this could happen....

    Lesson learned: there is such a thing as too many logic-hooks! Disappointed

    --- Update: Problem found and fixed. Nested logic was saving the record in a before save.

Reply
  •   's suggestion revealed the culprit, THANK YOU!

    It looks like I have a logic hook that kicks off between the insert in the core table and the insert in the custom table causing two inserts for the same id_c in the related module's custom table. The first insert works fine, so the record looks correct, the second insert fails at the DB level (duplicate id_c) and triggers the 500 error.

    Working to unravel where / how this could happen....

    Lesson learned: there is such a thing as too many logic-hooks! Disappointed

    --- Update: Problem found and fixed. Nested logic was saving the record in a before save.

Children
No Data