I've enabled the site collection app catalog on my tenant, and the app catalog list has appeared on the site contents page. However, when I try to drag and drop an spfx solution package I now get an error message appear that says "Cannot enable the site collection app catalog feature in this site collection because it has not been approved by the tenant admin".
I have done this many times over the past few weeks on various site collections and it has worked fine without me needing to approve anything - my webparts have been deployed successfully. Today only have I gotten this error. What approval is it referring to?
@nero120 - when you use the powershell command to add the site collection app catalog it actually goes and activates the feature on the web that has the site collection app catalog. However, we have currently shipped a bug which breaks this unless the person running the power shell command is a site collection administrator on the site you are adding the site collection app catalog to. Therefore, the workaround to this problem is just to make sure you give yourself rights before adding the site collection app catalog (or redo it in your case). This is a known issue and we will ship the fix to production in about 2-3 weeks.
Thank you @mcmynn83
Sounds like the work around fixed your issue? I'm going to close this issue as the work around has fixed it, however, you should no longer need to use the workaround in about 2-3 weeks as the fix will have rolled out.
@mcmynn83 more or less yes (works for one site collection but not for another, even though I'm site coll admin on both). Though I can live with it for a few weeks until the fix has been rolled out. Thanks.
@nero120 - Thanks for letting me know. I'd love to confirm its the same issue on your other site. If you go to a classic page on the tenant app catalog (apps for sharepoint library for example), go into your debug console, start a network trace, and then run the following in the console with the 2
var postObj = {
'absolutePath':'https://
};
var postBody = JSON.stringify(postObj);
var req = new XMLHttpRequest();
var digest = document.forms[MSOWebPartPageFormName]["__REQUESTDIGEST"].value
var serviceUrl = "https://
req.open("POST", serviceUrl, false);
req.setRequestHeader("Accept", "application/json;odata=verbose");
req.setRequestHeader("Content-Type", "application/json");
req.setRequestHeader("x-requestdigest", digest);
req.send(postBody);
That will add the site collection app catalog (assuming it was removed previously), and you should be able to get the correlation id of the request from the network trace in response headers (sp-request-id). If you send me that, as well as your site collection URL I can take a look at the logs and confirm whether it is the same issue or not seeming as you said you are a site collection admin on that site collection.
Thanks @mcmynn83, I ran the code you suggested and got the following response:
{
"d": {
"__metadata": {
"id": "https://savillsukdev.sharepoint.com/sites/app-catalog/_api/web/tenantappcatalog/sitecollectionappcatalogssites/add",
"uri": "https://savillsukdev.sharepoint.com/sites/app-catalog/_api/web/tenantappcatalog/sitecollectionappcatalogssites/add",
"type": "Microsoft.SharePoint.Marketplace.CorporateCuratedGallery.SiteCollectionAppCatalogAllowedItem"
},
"AbsoluteUrl": "https://savillsukdev.sharepoint.com/sites/cpa-ci",
"SiteID": "a9ae6600-00bf-4d2d-b2c7-f4ff099c3322"
}
}
The sprequestguid header value was 68e3459e-6025-5000-ca58-192259a1b82f and just to confirm the site's url is https://savillsukdev.sharepoint.com/sites/cpa-ci.
@nero120 - Ok, looks like you have fallout from the bug you encountered previously. After the fix gets rolled out this won't occur again... however, the way the data is left from the previous bug you won't ever be able to create a site collection app catalog. You must go to your tenant app catalog, open the list at /Lists/SiteCollectionAppCatalogs, and look at the entries. You will see a bunch of url's. If you modify the view you will see a column called SiteID. I believe that one of your rows with the given Url does NOT contain a valid site ID (because you couldn't open it when you created it). Please delete all of the entries for the site collection that is not working and then try to re-add the site collection app catalog.
Please let me know if that works and sorry for all the trouble.
@mcmynn83 yes! Deleting the broken site entries from /Lists/SiteCollectionAppCatalogs then re-adding the Site Collection App Catalog sorted it! Many thanks for all of your help! 馃槂
@nero120 - I'm looking at our code trying to figure out how empty site ID's got in there... and I don't see how. Could you actually tak e a screen shot of your /Lists/SiteCollectionAppCatalogs list after you modify the view and send it to me at Grahamc at Microsoft.com? Hoping that will give me some insite into how the bad data got into the list.
Darn it, looks like I won't be getting that screen shot. Glad you're unblocked.
Yes sorry, I've already deleted them 馃槥 . This is the view as it currently stands:

However, it might help you to know that cpa-ci is the continuous integration target site collection that gets torn down and re-built when VSTS runs a build/release cycle on code check in. Each time that happens the site coll app catalog is re-added. Perhaps a conflict occurred which led to the invalid site coll ID?
I didn't notice anything weird about the IDs unfortunately...
Ok great! That is good to hear. I totally understand what happened now! If you add the site at time X it will have site ID X1. However, if you then go and delete the site collection and create a new one, then it will have site ID X2, but have the same URL. Just going and adding a new site collection app catalog will create a new entry, however, when we check if it's valid we will say it's not since we still have the old entry. We'll discuss whether we want to fix this scenario or not. Thanks a ton for your help!
Great stuff, glad I could help @mcmynn83.
Just to follow up, this is fixed and should roll out in about 2 weeks.
Thanks @mcmynn83, just to be clear is the fix to the Add-SPOSiteCollectionAppCatalog powershell command?
No, the fix is in how we use the data. Right now you have rows in the allow list that look like:
Url,SiteId
Foo, X
Foo, Y
Foo, Z
Current site has siteId Z and it doesn't work. After the fix rolls out it will just start working and you won't have to re-run Add-SPOSiteCollectionAppCatalog.
Great stuff @mcmynn83, thanks for clarifying.
Want to point out that this issue pops up as well when:
@mcmynn83 I've just noticed that on one of my site collections the Site Collection App Catalog is not appearing after enabling it in powershell. After checking the Site Collection App Catalogs list in the app-catalog site, the site collection appears multiple times with various Ids, so I guess this is still an issue?
Shouldn't it just update the Id value if the site collection URL is already in the list rather than adding another item with a different Id?
@nero120 - I need more info (there is obviously an issue, but I doubt it's the same one). Could you send me a screen shot of your sites and ID's from the SiteCollectionAppCatalogs list that are not working, then I can investigate it from this side.
Issues that have been closed & had no follow-up activity for at least 7 days are automatically locked. Please refer to our wiki for more details, including how to remediate this action if you feel this was done prematurely or in error: Issue List: Our approach to locked issues
Most helpful comment
@nero120 - Ok, looks like you have fallout from the bug you encountered previously. After the fix gets rolled out this won't occur again... however, the way the data is left from the previous bug you won't ever be able to create a site collection app catalog. You must go to your tenant app catalog, open the list at /Lists/SiteCollectionAppCatalogs, and look at the entries. You will see a bunch of url's. If you modify the view you will see a column called SiteID. I believe that one of your rows with the given Url does NOT contain a valid site ID (because you couldn't open it when you created it). Please delete all of the entries for the site collection that is not working and then try to re-add the site collection app catalog.
Please let me know if that works and sorry for all the trouble.