microsoft / coe-starter-kit

Other
767 stars 227 forks source link

[CoE Starter Kit - BUG] - Admin Sync flow fails saying flow doesn't exist despite of the flow being in the environment. #4142

Closed Neel1KNK closed 2 years ago

Neel1KNK commented 2 years ago

Describe the issue

Hello….. We have the COE installed with only the Core components installed. We have a flow “Admins Sync Template (Flows) which fails 8 times per day and gives out the error stating that “admin_flow With Id = 28b4c6c4-dccc-b0b8-d363-273ad3adc871 Does Not Exist”.

image

But when we check the flows using the flow ID actually all the flows exist in the environment. For example if I go to the flow ID: 28b4c6c4-dccc-b0b8-d363-273ad3adc871 and this flow is in the My SharePoint Files environment and it’s a Teams type without dataverse.

image

image

I confirm that it’s the same flow using the flow URL: https://admin.powerplatform.microsoft.com/environments/b3bb6e50-3413-e517-aba2-327cdb2a330f/flows/28b4c6c4-dccc-b0b8-d363-273ad3adc871/flowDetails

So here we have the flow existing in the environment and still the Admin sync (Flows) is failing every day. Note: Also like when we try to go to “Set App Permissions” and check the flow if Orphaned and here we are unable to find the environment listed in this app. Question: Our concern is like why the Admin Sync flow is failing despite of the flow is existing in the environment?? Why we are unable to get the Environments details in COE created with Teams type.

Thanks

Expected Behavior

The COE should capture all the flows and the environments of all types. But this is failing.

What solution are you experiencing the issue with?

Core

What solution version are you using?

3.45

What app or flow are you having the issue with?

Admin - Sync Template V3 (Flows)

Steps To Reproduce

We have the COE installed with only the Core components installed. We have a flow “Admins Sync Template (Flows) which fails 8 times per day and gives out the error stating that “admin_flow With Id = 28b4c6c4-dccc-b0b8-d363-273ad3adc871 Does Not Exist”.

But when we check the flows using the flow ID actually all the flows exist in the environment. For example if I go to the flow ID: 28b4c6c4-dccc-b0b8-d363-273ad3adc871 and this flow is in the My SharePoint Files environment and it’s a Teams type without dataverse.

I confirm that it’s the same flow using the flow URL: https://admin.powerplatform.microsoft.com/environments/b3bb6e50-3413-e517-aba2-327cdb2a330f/flows/28b4c6c4-dccc-b0b8-d363-273ad3adc871/flowDetails

So here we have the flow existing in the environment and still the Admin sync (Flows) is failing every day. Note: Also like when we try to go to “Set App Permissions” and check the flow if orphaned and here we are unable to find the environment listed in this app. Question: Our concern is like why the Admin Sync flow is failing despite of the flow is existing in the environment?? Why we are unable to get the Environments details in COE created with Teams type.

Anything else?

No response

Jenefer-Monroe commented 2 years ago

Hello, it looks like this failure is on Get Flow from CoE. This is an expected and caught error which we use to determine if the flow is already in the CoE inventory. You can see this by the catch into the variable here: image

Unfortunately flow lists the first failure as the failure for the run even if its caught, so you will need to dive down into the flow run to find where it fails without being caught.

Neel1KNK commented 2 years ago

Hello Jenefer, Thanks for the response. Actually, I was checking where the flow was failing but I see that the flow is failing at an instance where it says it does not have permission with the flow ID 123**

image

Here the observation is like all the flows which are failing are in different environments and all are of Teams type environment. So, is that the reason failing as the flows are in Teams environment and my account is not the member of that group??

As am using the admin account where it is having access across all the platform, despite still facing the error.

Wanted to know what the reason for the flow getting failed.

Jenefer-Monroe commented 2 years ago

We have seen this caused by two main issues

1) The account running the flow does not have the correct role permanently assigned. The identity running the flows needs to be Microsoft Power Platform service admin, global tenant admin, or Dynamics 365 service admin. And this role must be permanently assigned (not PIM). Here is a document in case you need help finding that answer: PPAdmin Role.pdf See also What identity should I install the CoE Starter Kit with?

2) Sometimes there is a caching issue in the product and flows that are returned from List Flows as Admin are actually flows that were deleted in the past. Something Get Flow as Admin correctly deduces (and fails as a result in this case).

3) (more rare) Occasionally a run time issue happens which results in this failure and a rerun will succeed.

I would first check the role (suggestion 1) as it is the most likely case. And if thats not it I can get you a script to see if its the second issue

Neel1KNK commented 2 years ago

Hello Jenefer, Am sure that as per the Suggestions

  1. Holding with Power Platform Admin permanently.
  2. We have all those flows in the environment enabled.
  3. This is happening every day and failing at same instance not occasionally, not sure why. Kindly help.
Jenefer-Monroe commented 2 years ago

ok i think you may have hit this issue then in which there is a cache issue. I just found it in my test tenant too so I think there is a resurgence of it. Let me et you a test script to run.

Jenefer-Monroe commented 2 years ago

I believe you have hit a known product bug around caching of deleted flows. Let's get a repro outside of the toolkit.

To use: Import the flow, open, select the environment which repros for you.
It loops the flows, will hit the same failure and the you can go to support with this flow instead of the toolkit, for faster iteration to fix.
ProductBugDemo-getflowaftergetflowsfails_20211116133300.zip image

Neel1KNK commented 2 years ago

After importing this flow (Product Demo bug flow) do I need to contact to MS support??

Actually, I can say that the flows are not deleted. They are visible but Sync-flow not fetching them.

The error says admin flow with ID doesn't exist, if I can add the account to group and later it should not get the flow failed right??

Also is it not because that we are running only Core COE, right??

Please confirm the above.

Thanks

Jenefer-Monroe commented 2 years ago

Sorry I dont follow your questions. Have you run the imported flow?

Neel1KNK commented 2 years ago

I wanted to know below four things like:

I was asking like do I need to import the flow which you have shared and do I need to contact Microsoft Support team??

Also like the error says the admin flow id is missing, but actually they are present not deleted. We can see them in the PPAC but the flow fails to fetch the details. Is it mandate like the user to be a maker/admin in the environment. Already he’s having the Power Platform admin role still erroring.

Also, the output of the error says that the ID doesn't exist in security group but for power platform admin it should have enough permission to check right??

One last thing wanted to know that the flow is not fetching complete data as we are only using the Core COE ??

Jenefer-Monroe commented 2 years ago

Hello. I believe you have hit a caching issue. If the flow I have given you repros, then yes that would be taken to support as it would be a product bug. You need to use the flow I have given you as it takes the bug out of the context of the kit and into a simple repro. Support will not be able to help you until we do this.

Jenefer-Monroe commented 2 years ago

Closing out as no further action for starter kit team