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

Fails to verify target URL #52

Open
spg-iwilson opened this issue Jun 4, 2023 · 4 comments
Open

Fails to verify target URL #52

spg-iwilson opened this issue Jun 4, 2023 · 4 comments

Comments

@spg-iwilson
Copy link
Contributor

I'm trying to migrate a Power App customized list between two SharePoint online tenants. It connects to the source and exports the templates. However when it tries to connect to the destination tenant, the Invoke-PnPSPRestMethod on line 90 in RunAllScripts.ps fails with the following error

Invoke-PnPSPRestMethod : Object reference not set to an instance of an object.
At C:\Users...\source\FlowPowerAppsMigrator\RunAllScripts.ps1:90 char:13
+ $Response = Invoke-PnPSPRestMethod -Url "$TARGET_SITE_URL/_api/web/cu ...
+ CategoryInfo : WriteError: (:) [Invoke-PnPSPRestMethod], NullReferenceException
+ FullyQualifiedErrorId : EXCEPTION,PnP.PowerShell.Commands.Admin.InvokeSPRestMethod

I have commented out line 90 and the script was able to continue.
I am running Windows PowerShell in Administrator mode.
MFA is disabled on the destination tenant.
I get the same error if I try calling Invoke-PnPSPRestMethod directly

@Zerg00s
Copy link
Owner

Zerg00s commented Jun 8, 2023

Hi @spg-iwilson ,

Can you try some steps from the troubleshooting guide?

For example, run the following script:

$TARGET_SITE_URL = "https://controso.sharepoint.com"
Connect-PnPOnline -Url $TARGET_SITE_URL -UseWebLogin -WarningAction Ignore
$Response = Invoke-PnPSPRestMethod -Url "$TARGET_SITE_URL/_api/web/currentUser"

@Zerg00s
Copy link
Owner

Zerg00s commented Jun 8, 2023

hi @spg-iwilson, can you try the latest release, please? https://github.com/Zerg00s/FlowPowerAppsMigrator/releases/tag/3.9.0

I hope it will have the issue fixed in this version.

@spg-iwilson
Copy link
Contributor Author

Hi @Zerg00s, apologies, I updated the master branch. I meant to create a pull request. There was an issue in RunAllScripts - it was using the source url config value for the target url. Also, there were some issues with the Connect-PnPOnline command in GenerateInitialMappings.

Once I updated these lines, the code was able to connect to the source and destination without any issues. Thanks for the update

@Zerg00s
Copy link
Owner

Zerg00s commented Jun 11, 2023

hi @spg-iwilson no worries :) I just realized that I didn't have any branch rules. Thanks to yo, I just set it up.

Also, thanks for calling out this bug.

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

No branches or pull requests

2 participants