0

Since Sep 9, 2020 we started to get strange error on REST API call to get list of sub-sites and their lists:

GET <site url>_api/web?$expand=webs,lists,AllProperties,ThemeInfo,SiteUsers,RoleDefinitions&$select=*,webs/Url,lists/Id,lists/Title,lists/Description,lists/BaseType,lists/BaseTemplate,lists/Hidden,lists/Language,lists/ItemCount,lists/Created,lists/TemplateFeatureId,lists/CurrentChangeToken,SiteUsers/id,SiteUsers/Title,SiteUsers/LoginName,AllProperties/DesignPreviewThemedCssFolderUrl

The API call was working already for few year but something is broken now and in many our customers (not all , but about 30%) we see this error.

{"error":{"code":"-2147467261, System.ArgumentNullException","message":{"lang":"en-US","value":"Value cannot be null.Parameter name: key"}}}

Now, we don't ask for any parameter "key", so not sure why it's null, but I found that if I remove the last part

AllProperties/DesignPreviewThemedCssFolderUrl

And request now looks :

GET <site url>_api/web?$expand=webs,lists,AllProperties,ThemeInfo,SiteUsers,RoleDefinitions&$select=*,webs/Url,lists/Id,lists/Title,lists/Description,lists/BaseType,lists/BaseTemplate,lists/Hidden,lists/Language,lists/ItemCount,lists/Created,lists/TemplateFeatureId,lists/CurrentChangeToken,SiteUsers/id,SiteUsers/Title,SiteUsers/LoginName

Then this request is returns fine, without any error

@Sharepoint team, maybe some new versions was deployed and some behaviour changes / bugs were introduced ? Please advise, Thanks

SlavaG
  • 518
  • 8
  • 28

1 Answers1

0

So this could be because of URL length Max limit in SharePoint. Path length limit in SharePoint Online is 400 characters. Path length limit in SP 2013 on-Prem is 255 characters.

Try to remove unnecessary columns or make the url shorter by URL shorteners.

  • Well, when I'm removing AllProperties/DesignPreviewThemedCssFolderUrl I still far way after 500 characters, but's working without. And few more things - it was working before Sep 10. And another it's a file path, we know about file path length limitation. – SlavaG Sep 16 '20 at 04:55