JSOM unable to get Terms from TermStore for user with Read Access

%3CLINGO-SUB%20id%3D%22lingo-sub-196974%22%20slang%3D%22en-US%22%3EJSOM%20unable%20to%20get%20Terms%20from%20TermStore%20for%20user%20with%20Read%20Access%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-196974%22%20slang%3D%22en-US%22%3E%3CP%3EI%20am%20using%20JSOM%20to%20fetch%20terms%20from%20TermStore%20the%20solution%20been%20working%20fine.%20Since%20yesterday%20for%20standard%20users%20the%20JSOM%20is%20unable%20to%20get%20terms.%20However%20if%20I%20make%20everyone%20TermStore%20admin%20the%20Javascript%20call%20works.%20Below%20is%20javascript%20code%20and%20the%20api%20response%3A%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EJSOM%3A%3C%2FP%3E%3CP%3E%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%20var%20context%20%3D%20SP.ClientContext.get_current()%3B%3CBR%20%2F%3E%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%20var%20taxonomySession%20%3D%20SP.Taxonomy.TaxonomySession.getTaxonomySession(context)%3B%3CBR%20%2F%3E%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%20var%20termStore%20%3D%20taxonomySession.getDefaultSiteCollectionTermStore()%3B%3CBR%20%2F%3E%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%20var%20termSets%20%3D%20termStore.getTermSetsByName(%22Global%20Navigation%22%2C%201033)%3B%3CBR%20%2F%3E%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%20var%20termSet%20%3D%20termSets.getByName(%22Global%20Navigation%22)%3B%3CBR%20%2F%3E%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%20var%20terms%20%3D%20termSet.getAllTerms()%3B%3CBR%20%2F%3E%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%20context.load(terms)%3B%3CBR%20%2F%3E%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%20context.executeQueryAsync(Function.createDelegate(this%2C%20function%20(sender%2C%20args)%20%7B%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EResponse%20from%20ProcessQuery%20call%3A%3C%2FP%3E%3CP%3E%5B%3CBR%20%2F%3E%7B%3CBR%20%2F%3E%22SchemaVersion%22%3A%2215.0.0.0%22%2C%22LibraryVersion%22%3A%2216.0.7709.1205%22%2C%22ErrorInfo%22%3A%7B%3CBR%20%2F%3E%22ErrorMessage%22%3A%22Specified%20argument%20was%20out%20of%20the%20range%20of%20valid%20values.%5Cr%5CnParameter%20name%3A%20index%22%2C%22ErrorValue%22%3Anull%2C%22TraceCorrelationId%22%3A%2255086a9e-f08a-5000-d331-8415c61f9ebf%22%2C%22ErrorCode%22%3A-2146233086%2C%22ErrorTypeName%22%3A%22System.ArgumentOutOfRangeException%22%3CBR%20%2F%3E%7D%2C%22TraceCorrelationId%22%3A%2255086a9e-f08a-5000-d331-8415c61f9ebf%22%3CBR%20%2F%3E%7D%3CBR%20%2F%3E%5D%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EAny%20help%20would%20be%20appreciated.%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-321485%22%20slang%3D%22en-US%22%3ERe%3A%20JSOM%20unable%20to%20get%20Terms%20from%20TermStore%20for%20user%20with%20Read%20Access%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-321485%22%20slang%3D%22en-US%22%3Eit%20is%20an%20permission%20issue.%20Same%20error%20we%20got%20while%20accessing%20terms%20form%20store.%20We%20gave%20read%20access%20to%20the%20users.%3CBR%20%2F%3EIn%20our%20case%20we%20add%20All%20users%20Except%20external%20in%20our%20Read%20group%20and%20it%20start%20working.%3CBR%20%2F%3Ehope%20it%20may%20help%20you%20give%20a%20try.%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-197162%22%20slang%3D%22en-US%22%3ERe%3A%20JSOM%20unable%20to%20get%20Terms%20from%20TermStore%20for%20user%20with%20Read%20Access%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-197162%22%20slang%3D%22en-US%22%3E%3CP%3EWe%20are%20working%20with%20SharePoint%20Online%20so%20don't%20have%20access%20to%20logs.%20Apparently%20Microsoft%20didn't%20upgrades%20and%20since%20then%20it%20has%20stopped%20working.%20Raised%20a%20service%20request%20but%20that%20was%20assigned%20to%20First%20Line%20support%20and%20they%20couldn't%20help.%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-197116%22%20slang%3D%22en-US%22%3ERe%3A%20JSOM%20unable%20to%20get%20Terms%20from%20TermStore%20for%20user%20with%20Read%20Access%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-197116%22%20slang%3D%22en-US%22%3E%3CP%3EWhich%20version%20of%20Sharepoint%20is%20this%3F%20Can%20you%20track%20error%20log%20by%20correlation%20id%3F%3C%2FP%3E%3C%2FLINGO-BODY%3E
New Contributor

I am using JSOM to fetch terms from TermStore the solution been working fine. Since yesterday for standard users the JSOM is unable to get terms. However if I make everyone TermStore admin the Javascript call works. Below is javascript code and the api response:

 

JSOM:

                var context = SP.ClientContext.get_current();
                var taxonomySession = SP.Taxonomy.TaxonomySession.getTaxonomySession(context);
                var termStore = taxonomySession.getDefaultSiteCollectionTermStore();
                var termSets = termStore.getTermSetsByName("Global Navigation", 1033);
                var termSet = termSets.getByName("Global Navigation");
                var terms = termSet.getAllTerms();
                context.load(terms);
                context.executeQueryAsync(Function.createDelegate(this, function (sender, args) {

 

Response from ProcessQuery call:

[
{
"SchemaVersion":"15.0.0.0","LibraryVersion":"16.0.7709.1205","ErrorInfo":{
"ErrorMessage":"Specified argument was out of the range of valid values.\r\nParameter name: index","ErrorValue":null,"TraceCorrelationId":"55086a9e-f08a-5000-d331-8415c61f9ebf","ErrorCode":-2146233086,"ErrorTypeName":"System.ArgumentOutOfRangeException"
},"TraceCorrelationId":"55086a9e-f08a-5000-d331-8415c61f9ebf"
}
]

 

Any help would be appreciated.

 

3 Replies

Which version of Sharepoint is this? Can you track error log by correlation id?

We are working with SharePoint Online so don't have access to logs. Apparently Microsoft didn't upgrades and since then it has stopped working. Raised a service request but that was assigned to First Line support and they couldn't help.

it is an permission issue. Same error we got while accessing terms form store. We gave read access to the users.
In our case we add All users Except external in our Read group and it start working.
hope it may help you give a try.