DawidPotgieter / Dynamics-CRM-Binary-Storage-Options

A Dynamics CRM plugin to transparently store attachment binaries outside CRM database. Azure Blob or File storage for instance.
GNU Affero General Public License v3.0
34 stars 15 forks source link

3 Plugin steps is Async and does not fire #14

Closed san-86 closed 6 years ago

san-86 commented 6 years ago

Hi I have installed the 4.1 solution in a 2015 environment, but not all the steps was working, step on Create ActivityMimeAttachment, Delete Annotation and Delete ActivityMimeAttachment, I tried a few things but then I saw that it was the only steps that was running as Async steps, when I changed them to be sync instead, everything worked.

Do you have any comments ? is it a weird installation error that these 3 steps is Async ? or was there a reason for them to be Async ?

I hope you can bring some light to the issue, so I can be sure that problems won't arise later on thank you :-)

DawidPotgieter commented 6 years ago

Hi there,

Those three steps are indeed set as async for a reason which I will explain in just a moment.

For the two deletes, it does not really matter if they are sync or async. That was merely a performance optimization – i.e. There’s no need to have the user wait for this, it can happen in the background.

For the create of activitymimeattachment though, the reason was that I could not get it to work in sync mode. If you look at issue #13, this is discussed. The code runs fine, but the data in crm db is not cleared out. I could only get this to work when that plugin executes via workflow service.

On to your question. Of the plugins are not working in async, you would get errors in your processes log. If all three are not working, I’m going to guess you have a problem with your workflow process. It isn’t terribly stable, needs a restart now and then..

P. S. I’m assuming you're NOT talking about in debug mode here, you checked the database fields?

Let me know if you encounter further issues. Happy to try and help.

Sent from my Windows 10 phone


From: Soeren Andersen notifications@github.com Sent: Tuesday, June 19, 2018 7:13:38 AM To: DawidPotgieter/Dynamics-CRM-Binary-Storage-Options Cc: Subscribed Subject: [DawidPotgieter/Dynamics-CRM-Binary-Storage-Options] 3 Plugin steps is Async and does not fire (#14)

Hi I have installed the 4.1 solution in a 2015 environment, but not all the steps was working, step on Create ActivityMimeAttachment, Delete Annotation and Delete ActivityMimeAttachment, I tried a few things but then I saw that it was the only steps that was running as Async steps, when I changed them to be sync instead, everything worked.

Do you have any comments ? is it a weird installation error that these 3 steps is Async ? or was there a reason for them to be Async ?

I hope you can bring some light to the issue, so I can be sure that problems won't arise later on thank you :-)

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHubhttps://nam02.safelinks.protection.outlook.com/?url=https%3A%2F%2Fgithub.com%2FDawidPotgieter%2FDynamics-CRM-Binary-Storage-Options%2Fissues%2F14&data=02%7C01%7C%7Cfb9ecb6388194f0dfc2a08d5d54f992f%7C84df9e7fe9f640afb435aaaaaaaaaaaa%7C1%7C0%7C636649460199213858&sdata=sTixqxJcQwf43qYaQkBr0oP6jazJ25WJCt3d2gtxFzk%3D&reserved=0, or mute the threadhttps://nam02.safelinks.protection.outlook.com/?url=https%3A%2F%2Fgithub.com%2Fnotifications%2Funsubscribe-auth%2FATktwIJZEQ0Dfv_428mhAS3yQH1vF6Ofks5t9_vigaJpZM4UsUgK&data=02%7C01%7C%7Cfb9ecb6388194f0dfc2a08d5d54f992f%7C84df9e7fe9f640afb435aaaaaaaaaaaa%7C1%7C0%7C636649460199213858&sdata=scPxSJskfc7Zn8X3LraUfJlDiX%2FXXguUmIWbkKBklIA%3D&reserved=0.

san-86 commented 6 years ago

Okay, thank you for the explanation, I have looked through the system jobs and the only error shown is "This system job was canceled because a referenced record was deleted." and this is on the BinaryStorageOptions.Plugin: Create of activitymimeattachment, I'm trying to add an attachment on a new email. This is happening when the plugin is Async, when its set to sync it works, I havn't checked the database fields but the files is not showing up in the blob container when async

DawidPotgieter commented 6 years ago

Hmm.

Thanks for that. Will need to investigate a bit, as I can’t replicate.

You mentioned that this is 2015 on prem, correct? This means that the sandbox service will be executing the blob requests from where it is installed (probably where the crm website sits too). Can you check that you can access the azure blob Service outbound from that server. Sometimes firewall blocks that etc..

Regarding the message you get.. Seems to indicate the attachment is deleted before the async plugin fires??? Do you perhaps have something manipulating emails or moving them around?

Sent from my Windows 10 phone


From: Soeren Andersen notifications@github.com Sent: Tuesday, June 19, 2018 11:04:55 PM To: DawidPotgieter/Dynamics-CRM-Binary-Storage-Options Cc: Dawid Potgieter; Comment Subject: Re: [DawidPotgieter/Dynamics-CRM-Binary-Storage-Options] 3 Plugin steps is Async and does not fire (#14)

Okay, thank you for the explanation, I have looked through the system jobs and the only error shown is "This system job was canceled because a referenced record was deleted." and this is on the BinaryStorageOptions.Plugin: Create of activitymimeattachment, I'm trying to add an attachment on a new email. This is happening when the plugin is Async, when its set to sync it works, I havn't checked the database fields but the files is not showing up in the blob container when async

— You are receiving this because you commented. Reply to this email directly, view it on GitHubhttps://eur01.safelinks.protection.outlook.com/?url=https%3A%2F%2Fgithub.com%2FDawidPotgieter%2FDynamics-CRM-Binary-Storage-Options%2Fissues%2F14%23issuecomment-398360776&data=02%7C01%7C%7C644cc0a07e5d458c333408d5d5d47d8e%7C84df9e7fe9f640afb435aaaaaaaaaaaa%7C1%7C0%7C636650030964603183&sdata=qGptj%2BSuUDlSxZ6Rp%2FD8D4uRBFCV6O5WXWjnWY9ncSM%3D&reserved=0, or mute the threadhttps://eur01.safelinks.protection.outlook.com/?url=https%3A%2F%2Fgithub.com%2Fnotifications%2Funsubscribe-auth%2FATktwDnt6MYUJ2oAM_T8tQxxsFqj7nvGks5t-NrXgaJpZM4UsUgK&data=02%7C01%7C%7C644cc0a07e5d458c333408d5d5d47d8e%7C84df9e7fe9f640afb435aaaaaaaaaaaa%7C1%7C0%7C636650030964603183&sdata=rON3Bz6WmxEAEK6th2U3gCrNl79VERajaNes3CpvDrk%3D&reserved=0.

san-86 commented 6 years ago

I don't think that its the firewall, since it's working when it's running sync, and we don't have anything moving/manipulation emails either. It seems very odd..

san-86 commented 6 years ago

I was just thinking, how long can it take for the aync process to do its work ? could it be that I haven't waited enough time after adding the file ? thoughts ?

DawidPotgieter commented 6 years ago

Depends.

But usually no longer that 30 seconds or so.

Sent from my Windows 10 phone


From: Soeren Andersen notifications@github.com Sent: Thursday, June 21, 2018 6:16:06 PM To: DawidPotgieter/Dynamics-CRM-Binary-Storage-Options Cc: Dawid Potgieter; Comment Subject: Re: [DawidPotgieter/Dynamics-CRM-Binary-Storage-Options] 3 Plugin steps is Async and does not fire (#14)

I was just thinking, how long can it take for the aync process to do its work ? could it be that I haven't waited enough time after adding the file ? thoughts ?

— You are receiving this because you commented. Reply to this email directly, view it on GitHubhttps://nam03.safelinks.protection.outlook.com/?url=https%3A%2F%2Fgithub.com%2FDawidPotgieter%2FDynamics-CRM-Binary-Storage-Options%2Fissues%2F14%23issuecomment-398988490&data=02%7C01%7C%7C212257bf3a454eb0b14d08d5d73e797c%7C84df9e7fe9f640afb435aaaaaaaaaaaa%7C1%7C0%7C636651585674807958&sdata=dBH9EKmdrlZ0l1VIlh%2F8LzKgOVyYCnz0f7hqfsAJfiI%3D&reserved=0, or mute the threadhttps://nam03.safelinks.protection.outlook.com/?url=https%3A%2F%2Fgithub.com%2Fnotifications%2Funsubscribe-auth%2FATktwHqVL52hATsJR6YIwwC4--QS8UkHks5t-zomgaJpZM4UsUgK&data=02%7C01%7C%7C212257bf3a454eb0b14d08d5d73e797c%7C84df9e7fe9f640afb435aaaaaaaaaaaa%7C1%7C0%7C636651585674807958&sdata=JUGJ9z%2FOLeCTyMbI%2F%2F1110mCok7X5FNx9nzedU2jhxM%3D&reserved=0.

DawidPotgieter commented 6 years ago

Also, if you turn off the “delete after execution” box in plugin setup, you can actually see the job created in processes list.

Sent from my Windows 10 phone


From: Dawid Potgieter dawid.potgieter@LIVE.COM Sent: Thursday, June 21, 2018 6:23:21 PM To: DawidPotgieter/Dynamics-CRM-Binary-Storage-Options; DawidPotgieter/Dynamics-CRM-Binary-Storage-Options Cc: Comment Subject: RE: [DawidPotgieter/Dynamics-CRM-Binary-Storage-Options] 3 Plugin steps is Async and does not fire (#14)

Depends.

But usually no longer that 30 seconds or so.

Sent from my Windows 10 phone


From: Soeren Andersen notifications@github.com Sent: Thursday, June 21, 2018 6:16:06 PM To: DawidPotgieter/Dynamics-CRM-Binary-Storage-Options Cc: Dawid Potgieter; Comment Subject: Re: [DawidPotgieter/Dynamics-CRM-Binary-Storage-Options] 3 Plugin steps is Async and does not fire (#14)

I was just thinking, how long can it take for the aync process to do its work ? could it be that I haven't waited enough time after adding the file ? thoughts ?

— You are receiving this because you commented. Reply to this email directly, view it on GitHubhttps://nam03.safelinks.protection.outlook.com/?url=https%3A%2F%2Fgithub.com%2FDawidPotgieter%2FDynamics-CRM-Binary-Storage-Options%2Fissues%2F14%23issuecomment-398988490&data=02%7C01%7C%7C212257bf3a454eb0b14d08d5d73e797c%7C84df9e7fe9f640afb435aaaaaaaaaaaa%7C1%7C0%7C636651585674807958&sdata=dBH9EKmdrlZ0l1VIlh%2F8LzKgOVyYCnz0f7hqfsAJfiI%3D&reserved=0, or mute the threadhttps://nam03.safelinks.protection.outlook.com/?url=https%3A%2F%2Fgithub.com%2Fnotifications%2Funsubscribe-auth%2FATktwHqVL52hATsJR6YIwwC4--QS8UkHks5t-zomgaJpZM4UsUgK&data=02%7C01%7C%7C212257bf3a454eb0b14d08d5d73e797c%7C84df9e7fe9f640afb435aaaaaaaaaaaa%7C1%7C0%7C636651585674807958&sdata=JUGJ9z%2FOLeCTyMbI%2F%2F1110mCok7X5FNx9nzedU2jhxM%3D&reserved=0.

DawidPotgieter commented 6 years ago

A few questions :

  1. Is the attachment you're testing under 5mb?
  2. Can you see the jobs created in the processes list if you turn off auto delete on success?
  3. Have you tried restarting the sandbox service?
  4. Have you checked whether the activitymimeattachment/create works correctly in sync mode? I know you mentioned it executes, but does it actually create the blob file and set the local body content to "IA=="?

A bit out of ideas at the moment, we are running various 2015 instances and I cannot find a problem with how it is setup out of the box in any of those...

san-86 commented 6 years ago

Hi, I have been through the list, where I only enabled the 3 plugin steps where there were issues and it seems like it's working as intended now... the file was under 5mb and the system jobs was telling success and the body was changed to IA==, so could be that the sandbox service have been restarted in the meantime and that fixed it. but I will try to activate it all again and test thoroughly again to see if it just works now.

Thank you your your help and guidance :-)