SP.RequestContext.current/web/sitecollectionappcatalog 404 not found error when running spo app add

See original GitHub issue

Description

I get a 404 error when I run:

m365 spo app add -p sharepoint/solution/spfx-nho-webpart.sppkg --appCatalogScope sitecollection --appCatalogUrl https://parsons365tst.sharepoint.com/sites/msodev --overwrite --debug

I have verified that site collection exists, along with permissions for my account. Debug error:

"url": "https://parsons365tst.sharepoint.com/sites/msodev/_api/web/sitecollectionappcatalog/Add(overwrite=true, url='spfx-nho-webpart.sppkg')", "status": 404, "statusText": "Not Found", ... "error": "{\"odata.error\":{\"code\":\"-1, Microsoft.SharePoint.Client.ResourceNotFoundException\",\"message\":{\"lang\":\"en-US\",\"value\":\"Cannot find resource for the request SP.RequestContext.current/web/sitecollectionappcatalog/.\"}}}"

When I do

m365 spo site get --url https://parsons365tst.sharepoint.com/sites/msodev I get data:

Steps to reproduce

Run:

m365 spo app add -p sharepoint/solution/spfx-nho-webpart.sppkg --appCatalogScope sitecollection --appCatalogUrl https://parsons365tst.sharepoint.com/sites/msodev --overwrite --debug

Expected results

successful package deployment to site collection

Actual results

Result as shown below:

image

Diagnostics

"url": "https://parsons365tst.sharepoint.com/sites/msodev/_api/web/sitecollectionappcatalog/Add(overwrite=true, url='spfx-nho-webpart.sppkg')", "status": 404, "statusText": "Not Found", ... "error": "{\"odata.error\":{\"code\":\"-1, Microsoft.SharePoint.Client.ResourceNotFoundException\",\"message\":{\"lang\":\"en-US\",\"value\":\"Cannot find resource for the request SP.RequestContext.current/web/sitecollectionappcatalog/.\"}}}"

CLI for Microsoft 365 version

v6.0.0

nodejs version

v16.18.1

Operating system (environment)

macOS

Shell

zsh

cli doctor

{ “os”: { “platform”: “darwin”, “version”: “Darwin Kernel Version 21.6.0: Thu Sep 29 20:13:56 PDT 2022; root:xnu-8020.240.7~1/RELEASE_ARM64_T6000”, “release”: “21.6.0” }, “cliVersion”: “6.0.0”, “nodeVersion”: “v16.18.1”, “cliAadAppId”: “31359c7f-bd7e-475c-86db-fdb8c937548e”, “cliAadAppTenant”: “common”, “authMode”: “DeviceCode”, “cliEnvironment”: “”, “cliConfig”: {}, “roles”: [], “scopes”: [ “AllSites.FullControl”, “AppCatalog.ReadWrite.All”, “ChannelMember.ReadWrite.All”, “ChannelMessage.Send”, “ChannelSettings.ReadWrite.All”, “Directory.AccessAsUser.All”, “Directory.ReadWrite.All”, “Group.ReadWrite.All”, “IdentityProvider.ReadWrite.All”, “Mail.ReadWrite”, “Mail.Send”, “Policy.Read.All”, “Reports.Read.All”, “Tasks.ReadWrite”, “Team.Create”, “TeamMember.ReadWrite.All”, “TeamsApp.ReadWrite.All”, “TeamsAppInstallation.ReadWriteForUser”, “TeamSettings.ReadWrite.All”, “TeamsTab.ReadWrite.All”, “TermStore.ReadWrite.All”, “User.Invite.All”, “User.ReadWrite.All”, “profile”, “openid”, “email”, “AllSites.FullControl”, “AppCatalog.ReadWrite.All”, “ChannelMember.ReadWrite.All”, “ChannelMessage.Send”, “ChannelSettings.ReadWrite.All”, “Directory.AccessAsUser.All”, “Directory.ReadWrite.All”, “Group.ReadWrite.All”, “IdentityProvider.ReadWrite.All”, “Mail.ReadWrite”, “Mail.Send”, “Policy.Read.All”, “Reports.Read.All”, “Tasks.ReadWrite”, “Team.Create”, “TeamMember.ReadWrite.All”, “TeamsApp.ReadWrite.All”, “TeamsAppInstallation.ReadWriteForUser”, “TeamSettings.ReadWrite.All”, “TeamsTab.ReadWrite.All”, “TermStore.ReadWrite.All”, “User.Invite.All”, “User.ReadWrite.All” ] }

Additional Info

No response

Issue Analytics

  • State:closed
  • Created 10 months ago
  • Comments:6 (4 by maintainers)

github_iconTop GitHub Comments

3reactions
michaelsorianocommented, Dec 7, 2022

It looked like it was permissions after all. I was added to site collection admin on the /sites/appcatalog/ site (which is not the site I was deploying to) - and it now works as expected.

Thank you @milanholemans / @nicodecleyre

Closing this issue.

1reaction
milanholemanscommented, Dec 7, 2022

Great to hear it is working now!

Read more comments on GitHub >

github_iconTop Results From Across the Web

Issues - GitHub
RequestContext.current/web/sitecollectionappcatalog 404 not found error when running spo app add pnp/cli-microsoft365#4200.
Read more >
Microsoft.SharePoint.Client.ResourceNotFoundException type ...
SharePoint.Client.ResourceNotFoundException type not found. I am getting following error while using [https://github.com/pnp/pnpframework] ...
Read more >
ASP.NET MVC 404 Error Handling [duplicate] - Stack Overflow
I've investigated A LOT on how to properly manage 404s in MVC (specifically MVC3), and this, IMHO is the best solution I've come...
Read more >
Sitecollection App Catalog error: Cannot find resource for the ...
This Powershell function using the SharePoint PnP PowerShell and retry logic works for me so far. function AddApp($SiteFullUrl, $Creds, $PackagePath) {. $ ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found