Sitecore “Value cannot be null. Parameter name: item”
While setting up a new deployment slot in an Sitecore 10.2 Azure App Service Plan, I ran across the following error:
I ran straight to the CMS, but was able to perform a full publish to the deployment slots database, and even verified via the Content Editor opened in Sitecore Desktop for the database in question that all content was there and matching… upon opening the logs, I then found the following:
8464 19:16:19 ERROR ProcessExpiredItems => StackExchange.Redis.RedisConnectionException: No connection is active/available to service this operation: EVAL; UnableToConnect on my-sitecore-redis.redis.cache.windows.net:6380/Interactive, Initializing/NotStarted, last: NONE, origin: BeginConnectAsync, outstanding: 0, last-read: 5s ago, last-write: 5s ago, keep-alive: 60s, state: Connecting, mgr: 10 of 10 available, last-heartbeat: never, global: 5s ago, v: 2.1.58.34321, mc: 1/1/0, mgr: 10 of 10 available, clientName: EASYDWK0001MN, IOCP: (Busy=0,Free=1000,Min=8,Max=1000), WORKER: (Busy=1,Free=32766,Min=8,Max=32767), v: 2.1.58.34321 ---> StackExchange.Redis.RedisConnectionException: UnableToConnect on my-sitecore-redis.redis.cache.windows.net:6380/Interactive, Initializing/NotStarted, last: NONE, origin: BeginConnectAsync, outstanding: 0, last-read: 5s ago, last-write: 5s ago, keep-alive: 60s, state: Connecting, mgr: 10 of 10 available, last-heartbeat: never, global: 5s ago, v: 2.1.58.34321
at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
at StackExchange.Redis.TaskExtensions.<TimeoutAfter>d__9.MoveNext() in /_/src/StackExchange.Redis/TaskExtensions.cs:line 49
--- 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 StackExchange.Redis.ConnectionMultiplexer.<WaitAllIgnoreErrorsAsync>d__82.MoveNext() in /_/src/StackExchange.Redis/ConnectionMultiplexer.cs:line 740
--- End of inner exception stack trace ---
at StackExchange.Redis.ConnectionMultiplexer.ThrowFailed[T](TaskCompletionSource`1 source, Exception unthrownException) in /_/src/StackExchange.Redis/ConnectionMultiplexer.cs:line 2769
--- 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 System.Runtime.CompilerServices.TaskAwaiter.ValidateEnd(Task task)
at Sitecore.SessionProvider.Redis.StackExchangeClientConnectionAsync.<OperationExecutorAsync>d__23`1.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
at Sitecore.SessionProvider.Redis.StackExchangeClientConnectionAsync.<RetryLogicAsync>d__26`1.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
at Sitecore.SessionProvider.Redis.StackExchangeClientConnectionAsync.<RetryLogicAsync>d__26`1.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.SessionProvider.Redis.StackExchangeClientConnectionAsync.<EvalAsync>d__22.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 System.Runtime.CompilerServices.ConfiguredTaskAwaitable`1.ConfiguredTaskAwaiter.GetResult()
at Sitecore.SessionProvider.Redis.RedisExpirationIndexWrapperAsync.<GetSessionFromExpirationIndexAsync>d__5.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
at Sitecore.SessionProvider.Redis.RedisSessionStateProviderAsync.<OnProcessExpiredItemsAsync>d__29.MoveNext()
Sure enough, running the following command to test connectivity to Redis from the App Service via Kudu showed that it was not able to complete a TCP ping (full disclosure, we are using Private Endpoints so it requires additional networking to allow communication between the App Service and Redis):
test-netconnection my-sitecore-redis.redis.cache.windows.net -port 6380
Resolving the connectivity was definitely needed, but the issue was still showing!
What Fixed the Issue
In reviewing the additional publishing target setup per Sitecore documentation: Create a publishing target | Sitecore Documentation it states in steps 4 and 5 to make a copy of “the App_Data\items\ folder, make a copy of the Web folder” and then in the folder rename the .dat file.
While this was already done in the CMS, it was unclear in the documentation that it was also required in the CD. Once this was added, the site resolved.
I am still facing the same issue even after creating a copy of the web folder with similar name to my additional web db and renaming the .dat file. anything else i can look at?
Are you able to confirm connectivity to your additional web db?
I am facing this issue when trying to switch to another publishing target via CMS.