User login : system does not have related Party
----------------------------------------------- Key: OFBIZ-4231 URL: https://issues.apache.org/jira/browse/OFBIZ-4231 Project: OFBiz Issue Type: Bug Affects Versions: Release Branch 10.04 Environment: Data scope: SEED Reporter: Sergei I faced a problem, which will appear for the seed db initialization (not demo)!!! I have setup email sending for order confirmation, the each new email has the attachment in PDF. During the mail sending chain of services are called (via callback events) and in the end of the chain these services are called: <!-- dataresource role ecas --> <eca service="createDataResourceRole" event="invoke"> <action service="ensurePartyRole" mode="sync" run-as-user="system"/> </eca> <service name="ensurePartyRole" engine="simple" location="component://party/script/org/ofbiz/party/party/PartySimpleMethods.xml" invoke="ensureNaPartyRole" auth="false"> <description>Ensure that the party is in the specified role.</description> <attribute name="partyId" type="String" mode="IN" optional="true"/> <attribute name="roleTypeId" type="String" mode="IN" optional="false"/> </service> as you can see these services are called by "system" UserLogin. ensurePartyRole - throws an exception, because of partyId = null. I researched db model, and found that the UserLogin "system" exists, but without a party. However, these methods are called after the mail was sent, but the overall transaction is rollbacked, so the next retries fire the same problems, as result we have 3 retries and 3 mails in the mailbox. To fix this problem, I have created the "system" party and associated it with the UserLogin (I got it from the Demo data): <!-- Party for System UserLogin Account - just in case logic depends on it --> <Party partyId="system" partyTypeId="PERSON"/> <Person partyId="system" firstName="System" lastName="Account"/> <!-- various automated processes will cause it to be put in this role anyway --> <PartyRole partyId="system" roleTypeId="PACKER"/> <UserLogin userLoginId="system" partyId="system"/> -- This message is automatically generated by JIRA. For more information on JIRA, see: http://www.atlassian.com/software/jira |
[ https://issues.apache.org/jira/browse/OFBIZ-4231?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ] Jacques Le Roux closed OFBIZ-4231. ---------------------------------- Resolution: Not A Problem Assignee: Jacques Le Roux Sergei, You should have a look at http://svn.apache.org/viewvc?view=revision&revision=739743. Where notably the ofbiz/trunk/applications/securityext/data/SecurityExtData.xml have been removed and replaced by demo data. So, I suggest to rather handle that in your application. If you really think it's should be handled OOTB as seed in OFBiz (I don't think so for security reasons, but I must admit I have not a clear opininon about that), then please discuss it in dev ML before doing anything else You may also be interested by [history about that|http://ofbiz.markmail.org/search/%3CParty+partyId%3Dsystem+partyTypeId%3DPERSON/%3E+list:org.apache.ofbiz.commits#query:%3CParty%20partyId%3Dsystem%20partyTypeId%3DPERSON%2F%3E%20list%3Aorg.apache.ofbiz.commits+page:1+mid:oefiszwzzvwgxbsu+state:results] and some discussions around it http://markmail.org/message/pu5mox36dnlfdsc3 http://markmail.org/message/7ciat57wbdx4xjtm Thanks > User login : system does not have related Party > ----------------------------------------------- > > Key: OFBIZ-4231 > URL: https://issues.apache.org/jira/browse/OFBIZ-4231 > Project: OFBiz > Issue Type: Bug > Affects Versions: Release Branch 10.04 > Environment: Data scope: SEED > Reporter: Sergei > Assignee: Jacques Le Roux > Original Estimate: 1h > Remaining Estimate: 1h > > I faced a problem, which will appear for the seed db initialization (not demo)!!! > I have setup email sending for order confirmation, the each new email has the attachment in PDF. During the mail sending chain of services are called (via callback events) and in the end of the chain these services are called: > <!-- dataresource role ecas --> > <eca service="createDataResourceRole" event="invoke"> > <action service="ensurePartyRole" mode="sync" run-as-user="system"/> > </eca> > <service name="ensurePartyRole" engine="simple" > location="component://party/script/org/ofbiz/party/party/PartySimpleMethods.xml" invoke="ensureNaPartyRole" auth="false"> > <description>Ensure that the party is in the specified role.</description> > <attribute name="partyId" type="String" mode="IN" optional="true"/> > <attribute name="roleTypeId" type="String" mode="IN" optional="false"/> > </service> > as you can see these services are called by "system" UserLogin. > ensurePartyRole - throws an exception, because of partyId = null. I researched db model, and found that the UserLogin "system" exists, but without a party. > However, these methods are called after the mail was sent, but the overall transaction is rollbacked, so the next retries fire the same problems, as result we have 3 retries and 3 mails in the mailbox. > To fix this problem, I have created the "system" party and associated it with the UserLogin (I got it from the Demo data): > <!-- Party for System UserLogin Account - just in case logic depends on it --> > <Party partyId="system" partyTypeId="PERSON"/> > <Person partyId="system" firstName="System" lastName="Account"/> > <!-- various automated processes will cause it to be put in this role anyway --> > <PartyRole partyId="system" roleTypeId="PACKER"/> > <UserLogin userLoginId="system" partyId="system"/> -- This message is automatically generated by JIRA. For more information on JIRA, see: http://www.atlassian.com/software/jira |
In reply to this post by Nicolas Malin (Jira)
[ https://issues.apache.org/jira/browse/OFBIZ-4231?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13011841#comment-13011841 ] Sergei commented on OFBIZ-4231: ------------------------------- Thanks for your answer, of course I have handled this in my application, however it can be the potential problem: you install OFBiz, import SEED data model, setup email but mail sending works with problems, because of the "system" party is in the DEMO data model. So this is not obvious and you need to make an investigation, because you have an entity engine problem where the partyId= null. -- Best regards, Sergei Biletnikov > User login : system does not have related Party > ----------------------------------------------- > > Key: OFBIZ-4231 > URL: https://issues.apache.org/jira/browse/OFBIZ-4231 > Project: OFBiz > Issue Type: Bug > Affects Versions: Release Branch 10.04 > Environment: Data scope: SEED > Reporter: Sergei > Assignee: Jacques Le Roux > Original Estimate: 1h > Remaining Estimate: 1h > > I faced a problem, which will appear for the seed db initialization (not demo)!!! > I have setup email sending for order confirmation, the each new email has the attachment in PDF. During the mail sending chain of services are called (via callback events) and in the end of the chain these services are called: > <!-- dataresource role ecas --> > <eca service="createDataResourceRole" event="invoke"> > <action service="ensurePartyRole" mode="sync" run-as-user="system"/> > </eca> > <service name="ensurePartyRole" engine="simple" > location="component://party/script/org/ofbiz/party/party/PartySimpleMethods.xml" invoke="ensureNaPartyRole" auth="false"> > <description>Ensure that the party is in the specified role.</description> > <attribute name="partyId" type="String" mode="IN" optional="true"/> > <attribute name="roleTypeId" type="String" mode="IN" optional="false"/> > </service> > as you can see these services are called by "system" UserLogin. > ensurePartyRole - throws an exception, because of partyId = null. I researched db model, and found that the UserLogin "system" exists, but without a party. > However, these methods are called after the mail was sent, but the overall transaction is rollbacked, so the next retries fire the same problems, as result we have 3 retries and 3 mails in the mailbox. > To fix this problem, I have created the "system" party and associated it with the UserLogin (I got it from the Demo data): > <!-- Party for System UserLogin Account - just in case logic depends on it --> > <Party partyId="system" partyTypeId="PERSON"/> > <Person partyId="system" firstName="System" lastName="Account"/> > <!-- various automated processes will cause it to be put in this role anyway --> > <PartyRole partyId="system" roleTypeId="PACKER"/> > <UserLogin userLoginId="system" partyId="system"/> -- This message is automatically generated by JIRA. For more information on JIRA, see: http://www.atlassian.com/software/jira |
In reply to this post by Nicolas Malin (Jira)
[ https://issues.apache.org/jira/browse/OFBIZ-4231?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13011936#comment-13011936 ] Jacques Le Roux commented on OFBIZ-4231: ---------------------------------------- Sergei, I agree, I just ask you to discuss this on dev ML in order to be sure to have all the parties being aware before taking a decision (I'd apply your patch but I'm not sure of other opinions) > User login : system does not have related Party > ----------------------------------------------- > > Key: OFBIZ-4231 > URL: https://issues.apache.org/jira/browse/OFBIZ-4231 > Project: OFBiz > Issue Type: Bug > Affects Versions: Release Branch 10.04 > Environment: Data scope: SEED > Reporter: Sergei > Assignee: Jacques Le Roux > Original Estimate: 1h > Remaining Estimate: 1h > > I faced a problem, which will appear for the seed db initialization (not demo)!!! > I have setup email sending for order confirmation, the each new email has the attachment in PDF. During the mail sending chain of services are called (via callback events) and in the end of the chain these services are called: > <!-- dataresource role ecas --> > <eca service="createDataResourceRole" event="invoke"> > <action service="ensurePartyRole" mode="sync" run-as-user="system"/> > </eca> > <service name="ensurePartyRole" engine="simple" > location="component://party/script/org/ofbiz/party/party/PartySimpleMethods.xml" invoke="ensureNaPartyRole" auth="false"> > <description>Ensure that the party is in the specified role.</description> > <attribute name="partyId" type="String" mode="IN" optional="true"/> > <attribute name="roleTypeId" type="String" mode="IN" optional="false"/> > </service> > as you can see these services are called by "system" UserLogin. > ensurePartyRole - throws an exception, because of partyId = null. I researched db model, and found that the UserLogin "system" exists, but without a party. > However, these methods are called after the mail was sent, but the overall transaction is rollbacked, so the next retries fire the same problems, as result we have 3 retries and 3 mails in the mailbox. > To fix this problem, I have created the "system" party and associated it with the UserLogin (I got it from the Demo data): > <!-- Party for System UserLogin Account - just in case logic depends on it --> > <Party partyId="system" partyTypeId="PERSON"/> > <Person partyId="system" firstName="System" lastName="Account"/> > <!-- various automated processes will cause it to be put in this role anyway --> > <PartyRole partyId="system" roleTypeId="PACKER"/> > <UserLogin userLoginId="system" partyId="system"/> -- This message is automatically generated by JIRA. For more information on JIRA, see: http://www.atlassian.com/software/jira |
Free forum by Nabble | Edit this page |