Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Bug report: m365 flow export - permissions error & unhandledpromise rejection errors #2582

Open
robertcaretta opened this issue Jul 13, 2021 · 1 comment

Comments

@robertcaretta
Copy link

robertcaretta commented Jul 13, 2021

Description

The script finds 45 flows from the default environment, however only 13 export. I understand that one of the errors is listed on this export documentation page however as a tenant admin I don't think I should be restricted by permissions. Perhaps this command needs an --asAdmin option?

Steps to reproduce

I am using this script sample as a basis for exporting the flows.
https://pnp.github.io/cli-microsoft365/sample-scripts/flow/export-all-flows-in-environment/

image

Expected result

As a tenant admin I would like to be able to export all flows to create a backup process.

Actual result

The script finds 45 flows from the default environment, however only 13 export. I receive numerous errors such as:

  1. Error: The caller with object id '6928ab65-60d2-4a71-ab96-f47d7e14b2af' does not have permission for connection 'ed6d375b-d7f2-443a-bcfc-470aa0496f82' under Api 'shared_logicflows'.
  2. (node:5652) UnhandledPromiseRejectionWarning: Error: ENOENT: no such file or directory, open 'Admin|DummyApprovalFlow_20211013121023.zip'
    at Object.openSync (fs.js:476:3)
    at Object.writeFileSync (fs.js:1467:35)
    at C:\Users\xxxxxx\AppData\Roaming\npm\node_modules@pnp\cli-microsoft365\dist\m365\flow\commands\flow-export.js:123:16
    at processTicksAndRejections (internal/process/task_queues.js:93:5)
    (Use node --trace-warnings ... to show where the warning was created)
    (node:5652) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). To terminate the node process on unhandled promise rejection, use the CLI flag --unhandled-rejections=strict (see https://nodejs.org/api/cli.html#cli_unhandled_rejections_mode). (rejection id: 1)
    (node:5652) [DEP0018] DeprecationWarning: Unhandled promise rejections are deprecated. In the future, promise rejections that are not handled will terminate the Node.js process with a non-zero exit code.

Environment

Windows 10
Powershell 7.1.3
VS Code 1.57.1
PnP CLI 3.12.0

Additional Context

I have opened similar tickets regarding the Export-PnPFlow command. This might be related.
pnp/powershell#617
pnp/powershell#865

@robertcaretta robertcaretta changed the title Bug report: m365 flow export - permissions error & npm audit fixunhandledpromise rejection errors Bug report: m365 flow export - permissions error & unhandledpromise rejection errors Jul 13, 2021
@waldekmastykarz
Copy link
Member

Thank you for reporting the issue @robertcaretta.

however as a tenant admin I don't think I should be restricted by permissions

Unfortunately, we're limited by the functionality exposed by the API. If the API doesn't support a particular operation, there is nothing we can do about it. We could definitely have a look if the API supports exporting flows as admin but if it doesn't, I'm afraid there is nothing we can do.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

5 participants