Salesforce

For Tridion Sites 9.6 and DXA 2.2 (.NET), new pages can be successfully published but PCA call fails with error "GraphQLError : Exception while fetching data"

« Go Back

Information

 
Article TypeSolution Article
Scope/EnvironmentTridion Sites 9.6, DXA 2.2 (.NET)
Symptoms/Context
- After publishing new pages, the GraphQL API call fails with below error
|ERROR|Sdl.Web.Common.Logging.NLogLogger|PCA client returned an unexpected response when retrieving page model data for page url 
/PAGE_URL or Exception of type 'Sdl.Tridion.Api.GraphQL.Client.Exceptions.GraphQLClientException' was thrown.
GraphQLError : Exception while fetching data (/page/rawContent) : Error occurred while transforming page content at Line : 5 Column :4
- In the Session Content debug log, below log events can be seen
Caused by: com.fasterxml.jackson.core.JsonParseException: Unexpected character ('<' (code 60)): expected a valid value 
(JSON String, Number, Array, Object or token 'null', 'true' or 'false')" " at [Source: 
(String)""/en/contact-us/index.htmlLOREM IPSUM8476776477277240LOREM IPSUMLOREM IPSUM:INDEX-DATA-END -->
<!-- ""[truncated 3410 chars]; line: 1, column: 2]" ... "2023-04-21 10:15:15.191 ERROR [content-service,SERVERINFO] 13 
--- [o2-8081-exec-42] .c.g.e.CustomDataFetcherExceptionHandler : 
Exception while fetching data (/page/rawContent) : Error occurred while transforming page content" 
com.sdl.delivery.content.model.core.datafetcher.transformer.ModelTransformerException: Error occurred while transforming page content
- The si4t add-on extension has been deployed to environment.
Resolution
si4t jars had temporarily been removed from deployer-web addon to test publishing stability, and consequently content was being published to the broker DB without removing the si4t tags.  Issue persisted after disabling the SI4T extension, because the index data for search tags was being included in the JSON object that was being saved into the broker database.  The content service would successfully render content and then pages would randomly fail with a 404 or 500 error.

To be able to successfully view pages and remove the si4t tags from broker DB, developer added si4t jars back to deployer-web extension and republished offending pages.

To identify pages which need to be republished, DBA ran below query against the broker database.
select publication_id, component_id, content from PAGE_CONTENT where content like '%indexdata%'
Output such as the below will be returned
NAMESPACE_ID,PUBLICATION_ID,PAGE_ID,CONTENT,CHARSET,PAGE_CONTENT_KEY
1,31,2807,"<!-- INDEX-DATA-START:<indexdata><url>/en/legal/terms-of-use/index.html</url><title>Terms of Use</title>
...
Root Cause
Reference
Attachment 1 
Attachment 2 
Attachment 3 
Attachment 4 
Attachment 5 

Powered by