AmpersandTarski / Ampersand

Build database applications faster than anyone else, and keep your data pollution free as a bonus.
http://ampersandtarski.github.io/
GNU General Public License v3.0
40 stars 8 forks source link

ExecEngine fails to work #1283

Closed stefjoosten closed 2 years ago

stefjoosten commented 2 years ago

Working with Ampersand-v4.6.2 [main:26ca14784*]

What happened

I wrote an ENFORCE rule to copy an email address from a form to a Persoon:

ENFORCE email[Persoon*EmailAdres] >: personalia~;email[AanmeldingsformulierGG*EmailAdres]

It didn't work. Considering the newness of ENFORCE rules and my inexperience with it, I fell back to the original ExecEngine rule syntax. I wrote:

   ROLE ExecEngine MAINTAINS MaakAanmeldingGGEmail
   RULE MaakAanmeldingGGEmail: personalia~;I[AanmeldingsformulierGG];email |- email
   VIOLATION ( TXT "{EX} InsPair;email;Persoon;",SRC I, TXT ";EmailAdres;", TGT I )

This time I got yellow errors: afbeelding This suggests that the ExecEngine is not working. The tail of the log confirms this. It mentions the violated signals, but the ExecEngine is not being called...

prototype  | [2022-04-04 06:53:29] APPLICATION.DEBUG: Active roles already evaluated. Returning from cache [] {"request_id":"50d520d05f"}
prototype  | [2022-04-04 06:53:29] APPLICATION.DEBUG: Actived role 'Anonymous[Role]', but role is not used/defined in &-script. [] {"request_id":"50d520d05f"}
prototype  | [2022-04-04 06:53:29] PERFORMANCE.DEBUG: PHASE-3 SESSION: Memory in use: 6.59 Mb [] {"request_id":"50d520d05f"}
prototype  | [2022-04-04 06:53:29] PERFORMANCE.DEBUG: PHASE-3 SESSION: Execution time  : 0.02 Sec [] {"request_id":"50d520d05f"}
prototype  | [2022-04-04 06:53:29] APPLICATION.DEBUG: Active roles already evaluated. Returning from cache [] {"request_id":"50d520d05f"}
prototype  | [2022-04-04 06:53:29] APPLICATION.DEBUG: Checking process rules for active roles: Anonymous, Coordinator, ExecEngine, Intaker, User [] {"request_id":"50d520d05f"}
prototype  | [2022-04-04 06:53:29] DATABASE.DEBUG: SELECT * FROM "__conj_violation_cache__" WHERE "conjId" IN ('conj_76','conj_6','conj_0','conj_10','conj_11','conj_14','conj_12','conj_20','conj_13','conj_15','conj_21','conj_173','conj_85','conj_86','conj_88','conj_16','conj_17','conj_165','conj_18','conj_163','conj_164','conj_166','conj_19','conj_9','conj_167','conj_168','conj_2','conj_1','conj_56','conj_100') [] {"request_id":"50d520d05f"}
prototype  | [2022-04-04 06:53:29] APPLICATION.DEBUG: SIGNAL '{EX} InsPair;email;Persoon;Persoon_fe882e17-9901-4471-bcba-4eea434c3edb;EmailAdres;G-.s@hotmail.com' RULE: 'MaakAanmeldingGGEmail' [] {"request_id":"50d520d05f"}
prototype  | [2022-04-04 06:53:29] APPLICATION.DEBUG: SIGNAL '{EX} InsPair;email;Persoon;Persoon_6dea6b03-466f-42b9-a070-f416618cf24f;EmailAdres;f.l.temel@hotmail.com' RULE: 'MaakAanmeldingGGEmail' [] {"request_id":"50d520d05f"}
prototype  | [2022-04-04 06:53:29] APPLICATION.DEBUG: SIGNAL '{EX} InsPair;email;Persoon;Persoon_46cda745-e538-4b26-b76a-a5b1af62348b;EmailAdres;f.l.temel@hotmail.com' RULE: 'MaakGastgezinEmail' [] {"request_id":"50d520d05f"}
prototype  | [2022-04-04 06:53:29] DATABASE.DEBUG: select distinct org.src as src, org.tgt as tgt, cptTbl."PF_NavMenuItem" as "ifc_id", cptTbl."label" as "ifc_label", cptTbl."seqNr" as "ifc_seqNr", cptTbl."ifc" as "ifc_ifc", cptTbl."url" as "ifc_url", cptTbl."isSubItemOf" as "ifc_parent" from (select distinct fence0.src as src, fence2.tgt as tgt from (/* EDcD sessionActiveRoles[SESSION*Role] */ /* Expression: sessionActiveRoles [SESSION*Role] */ /* Signature : [SESSION*Role] */ select "SESSION" as src, "Role" as tgt from "sessionActiveRoles" where ("SESSION" is not null) and ("Role" is not null)) as fence0, (/* EFlp (EDcD pf_navItemRoles[PF_NavMenuItem*Role]) */ /* Expression: pf_navItemRoles [PF_NavMenuItem*Role]~ */ /* Signature : [Role*PF_NavMenuItem] */ /* case: EFlp x */ /* Expression: pf_navItemRoles [PF_NavMenuItem*Role]~ */ /* Signature : [Role*PF_NavMenuItem] */ /* EDcD pf_navItemRoles[PF_NavMenuItem*Role] */ /* Expression: pf_navItemRoles [PF_NavMenuItem*Role] */ /* Signature : [PF_NavMenuItem*Role] */ /* Expression: pf_navItemRoles [PF_NavMenuItem*Role]~ */ /* Signature : [Role*PF_NavMenuItem] */ select "Role" as src, "PF_NavMenuItem" as tgt from "pf_navItemRoles" where ("PF_NavMenuItem" is not null) and ("Role" is not null)) as fence1, (/* EDcD isVisible[PF_NavMenuItem*PF_NavMenuItem] */ /* Expression: isVisible [PF_NavMenuItem*PF_NavMenuItem] */ /* Signature : [PF_NavMenuItem*PF_NavMenuItem] */ select "PF_NavMenuItem" as src, "isVisible" as tgt from "PF_NavMenuItem" where ("PF_NavMenuItem" is not null) and ("isVisible" is not null)) as fence2 where (fence0.src = 'd1b572ede4158fdcec4f3af3c539b5f7') and ((fence0.tgt = fence1.src) and (fence1.tgt = fence2.src))) as org, "PF_NavMenuItem" as cptTbl where org.tgt = cptTbl."PF_NavMenuItem" [] {"request_id":"50d520d05f"}
prototype  | [2022-04-04 06:53:29] APPLICATION.DEBUG: Active roles already evaluated. Returning from cache [] {"request_id":"50d520d05f"}
prototype  | [2022-04-04 06:53:29] DATABASE.DEBUG: SELECT "SESSION" as "src", "Role" as "tgt" FROM "sessionAllowedRoles" WHERE "SESSION" = 'd1b572ede4158fdcec4f3af3c539b5f7' AND "Role" IS NOT NULL [] {"request_id":"50d520d05f"}
prototype  | [2022-04-04 06:53:29] PERFORMANCE.DEBUG: PHASE-4 REQUEST: Memory in use: 6.69 Mb [] {"request_id":"50d520d05f"}
prototype  | [2022-04-04 06:53:29] PERFORMANCE.DEBUG: PHASE-4 REQUEST: Execution time  : 0.01 Sec [] {"request_id":"50d520d05f"}
prototype  | [2022-04-04 06:53:29] PERFORMANCE.INFO: Peak memory used: 6.73 Mb [] {"request_id":"50d520d05f"}
prototype  | [2022-04-04 06:53:29] PERFORMANCE.INFO: Execution time  : 0.21 Sec [] {"request_id":"50d520d05f"}
prototype  | 172.20.0.1 - - [04/Apr/2022:06:53:28 +0000] "GET /api/v1/app/navbar HTTP/1.1" 200 7137 "http://localhost/" "Mozilla/5.0 (Macintosh; Intel Mac OS X 10.15; rv:98.0) Gecko/20100101 Firefox/98.0"
Michiel-s commented 2 years ago

I believe we've fixed this issue by updating your script right? Wrong exec-engine rule specifications can result in infinite loops. That was indicated here by the error. In the UI you can open the error by clicking on it and see which rules causes exceeding the max reruns.