Publishing to Experience Edge might get stuck


Description

Publishing to Experience Edge might hang. In this case, the publish job remains in the running state endlessly, and all subsequent publish jobs get stuck in the publishing queue. The following message can be found in the logs:

ERROR Error processing ack messages [ExperienceEdge Publishing]: An error has occurred while publishing Ack events.
Exception: Sitecore.ExperienceEdge.Connector.ContentHubDelivery.Exceptions.EdgeApiException
Message: [ExperienceEdge Publishing]: An error has occurred while publishing Ack events.
Source: Sitecore.ExperienceEdge.Connector.ContentHubDelivery
   at Sitecore.ExperienceEdge.Connector.ContentHubDelivery.Delivery.Ack.EdgePublishAckManager.<GetNextAckBatchMessage>d__5.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
   at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
   at Sitecore.ExperienceEdge.Connector.ContentHubDelivery.DirectPublish.Delivery.Export.Blocks.ProcessAckMessagesBlock.<AckBatchMessageReader>d__20.MoveNext()

Nested Exception

Exception: Grpc.Core.RpcException
Message: Status(StatusCode="Unknown", Detail="Received http2 header with status: 520", DebugException="Grpc.Core.Internal.CoreErrorDetailException: {"created":"@1676287115.302000000","description":"Received http2 :status header with non-200 OK status","file":"..\..\..\src\core\ext\filters\http\client\http_client_filter.cc","file_line":134,"grpc_message":"Received http2 header with status: 520","grpc_status":2,"value":"520"}")
Source: Sitecore.ExperienceEdge.Connector.ContentHubDelivery
   at Sitecore.ExperienceEdge.Connector.ContentHubDelivery.Infrastructure.EdgePublishAckAutoConnectClient.<GetNextAckBatch>d__4.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
   at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
   at Sitecore.ExperienceEdge.Connector.ContentHubDelivery.Delivery.Ack.EdgePublishAckManager.<GetNextAckBatchMessage>d__5.MoveNext()

Solution

To resolve the issue, consider one of the following options compatible with the affected product version: