SP.RequestContext.current/web/sitecollectionappcatalog 404 not found error when running spo app add
See original GitHub issueDescription
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:
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:
- Created 10 months ago
- Comments:6 (4 by maintainers)
Top Related StackOverflow Question
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.
Great to hear it is working now!