# Unable to rebuild database cache

**URL:** <https://forum.umbraco.com/t/unable-to-rebuild-database-cache/8068>\
**Category:** Questions\
**Tags:** v13\
**Created:** [May 20, 2026, 6:52am UTC](https://forum.umbraco.com/t/unable-to-rebuild-database-cache/8068 "2026-05-20T06:52:35Z")\
**Posts on this page:** 20\
**Page:** 1

<div class="post-metadata">

**Author:** ![Pekdon](https://forum.umbraco.com/user_avatar/forum.umbraco.com/pekdon/32/625_2.png) [@Pekdon](https://forum.umbraco.com/u/Pekdon)\
**Post date:** [May 20, 2026, 6:52am UTC](https://forum.umbraco.com/t/unable-to-rebuild-database-cache/8068/1 "2026-05-20T06:52:35Z")

</div>

Heya folks!

I have this Umb13 site that’s experiencing some issues, our database cache has been corrupt or generally doesn’t feel great. When I go to the **Published Status** section of the backoffice I see this:

 ![image](https://forum.umbraco.com/uploads/default/original/2X/f/f8ae288588feffa230c53d3c2963e2b861ce864e.png)

I’ve tried hitting the Rebuild button under the **Database Cache** section, and since you don’t really get any indication of progress here i’ve been forced to look in the database, here’s what I’ve found and the queries I’ve run:

```sql
SELECT [key], [value], [updated] 
FROM [dbo].[umbracoKeyValue] 
WHERE [key] = 'Umbraco.Web.PublishedCache.NuCache.Serializer';   

```

key value updated  
Umbraco.Web.PublishedCache.NuCache.Serializer MessagePack 2026-05-05 21:02:43.853

I followed the instructions in this link: [How to check Umbraco Database Cache Rebuild operation has finished](https://umbracare.net/blog/problems-with-rebuilding-umbraco-database-cache/)

From what this result gives me, the Cache rebuilding hasn’t been run since the 5th of May (today is the 20th).

I’ve also run this query:

```sql
SELECT 
    (SELECT COUNT(*) FROM cmsContentNu) AS CurrentRows,
    (SELECT COUNT(*) * 2 FROM umbracoNode 
     WHERE nodeObjectType IN (
         'C66BA18E-EAF3-4CFF-8A22-41B16D66A972',
         'B796F64C-1F99-4FFB-B886-4BF4BC011A9C'
     )) AS ExpectedRows

```

Which I got from an AI agent, it tells me this:

CurrentRows ExpectedRows  
334 34446

I ran this query maybe 20minutes ago (it’s 08:50 AM now) and then I just got 330 Current Rows, now it’s 334 (again, I don’t really know if the rebuilding of the cache is actually taking place and is just very slow).

**So to the issue at hand,** how can I tell if the rebuilding of the cache is actually running or not? I’ve searched for NuCache and other related stuff in the logviewer but I get no information. The only “real” indication I have is that it jumped from 330 CurrentRows to 334.

What is the solution here? How can I make sure the Database Cache is rebuilt successfully?

---

<div class="post-metadata">

**Author:** ![justin-nevitech](https://forum.umbraco.com/user_avatar/forum.umbraco.com/justin-nevitech/32/6219_2.png) [@justin-nevitech](https://forum.umbraco.com/u/justin-nevitech)\
**Post date:** [May 20, 2026, 7:12am UTC](https://forum.umbraco.com/t/unable-to-rebuild-database-cache/8068/2 "2026-05-20T07:12:52Z")

</div>

Hi @Pekdon

When you hit Rebuild under the Database Cache and have the Network tab in the Developer Tools open, does it ever complete successfully or does it error? If it errors, what error comes back?

Also, have you got any errors in the log related to NuCache?

Justin

---

<div class="post-metadata">

**Author:** ![ShekharTarare](https://forum.umbraco.com/user_avatar/forum.umbraco.com/shekhartarare/32/5488_2.png) [@ShekharTarare](https://forum.umbraco.com/u/ShekharTarare)\
**Post date:** [May 20, 2026, 7:16am UTC](https://forum.umbraco.com/t/unable-to-rebuild-database-cache/8068/3 "2026-05-20T07:16:29Z")

</div>

Hi @Pekdon,

Here are some things you can try:

1. Try this:

2. Please check this forum link. Paul was having somewhat similar issue:  
[Rebuild Database Cache - The request timed out](https://forum.umbraco.com/t/rebuild-database-cache-the-request-timed-out/2524/)

3. Also try deleting the local cache files, it’s stored under Temp/NuCache.

4. At last try truncating the cmsContentNu table.  
_ **Why TRUNCATE and not DELETE?**  
A `DELETE` statement logs every single row removal in the transaction log, which can cause massive log file growth and take a long time on 34,000+ rows. `TRUNCATE` simply deallocates the data pages, acting instantly and completely clearing any lingering locks._

Hope it helps!

---

<div class="post-metadata">

**Author:** ![Pekdon](https://forum.umbraco.com/user_avatar/forum.umbraco.com/pekdon/32/625_2.png) [@Pekdon](https://forum.umbraco.com/u/Pekdon)\
**Post date:** [May 20, 2026, 7:26am UTC](https://forum.umbraco.com/t/unable-to-rebuild-database-cache/8068/4 "2026-05-20T07:26:05Z")

</div>

I’ll try setting UsePagedSqlQuery to false, this will force me to recycle the app-pool and restart the site, which I need to contact my client for. It’s for quite a large and national site so this needs to be coordinated a bit. But I will try!

---

<div class="post-metadata">

**Author:** ![Pekdon](https://forum.umbraco.com/user_avatar/forum.umbraco.com/pekdon/32/625_2.png) [@Pekdon](https://forum.umbraco.com/u/Pekdon)\
**Post date:** [May 20, 2026, 7:29am UTC](https://forum.umbraco.com/t/unable-to-rebuild-database-cache/8068/5 "2026-05-20T07:29:27Z")

</div>

I just clicked the rebuild cache button aagain, I’m betting no error in the network tab, all I see is this:

 ![image](https://forum.umbraco.com/uploads/default/original/2X/6/64101df4ba497fa09d1c058a443956f11e066dea.png)

when I search the logviewer for “NuCache” or other nucache related stuff I see nothing, i do however see this:

 ![image](https://forum.umbraco.com/uploads/default/original/2X/9/967460788920d75cab4eed8817ebdb7615bfa810.png)

---

<div class="post-metadata">

**Author:** ![Pekdon](https://forum.umbraco.com/user_avatar/forum.umbraco.com/pekdon/32/625_2.png) [@Pekdon](https://forum.umbraco.com/u/Pekdon)\
**Post date:** [May 20, 2026, 7:30am UTC](https://forum.umbraco.com/t/unable-to-rebuild-database-cache/8068/6 "2026-05-20T07:30:24Z")

</div>

And now my CurrentRows has jumped to 367, far from 34470. But Im not sure if this is just from visitors going to pages on the site that then ends up in the cache, or if it’s actually the rebuilding of the cache background job that’s still chugging along

---

<div class="post-metadata">

**Author:** ![justin-nevitech](https://forum.umbraco.com/user_avatar/forum.umbraco.com/justin-nevitech/32/6219_2.png) [@justin-nevitech](https://forum.umbraco.com/u/justin-nevitech)\
**Post date:** [May 20, 2026, 7:42am UTC](https://forum.umbraco.com/t/unable-to-rebuild-database-cache/8068/7 "2026-05-20T07:42:21Z")

</div>

Hi @Pekdon

It is most likely still rebuilding the database cache, can you check again shortly? It may be slow if you’re running on production depending on the number of content nodes and spec of the database.

Justin

---

<div class="post-metadata">

**Author:** ![Pekdon](https://forum.umbraco.com/user_avatar/forum.umbraco.com/pekdon/32/625_2.png) [@Pekdon](https://forum.umbraco.com/u/Pekdon)\
**Post date:** [May 20, 2026, 7:47am UTC](https://forum.umbraco.com/t/unable-to-rebuild-database-cache/8068/8 "2026-05-20T07:47:39Z")

</div>

My sql query i’ve been running to kinda get a feel for how far off I am is this one:

```sql
SELECT [key], [value], [updated]
FROM [dbo].[umbracoKeyValue]
WHERE [key] = ‘Umbraco.Web.PublishedCache.NuCache.Serializer’;

SELECT
(SELECT COUNT() FROM cmsContentNu) AS CurrentRows,
(SELECT COUNT() * 2 FROM umbracoNode
WHERE nodeObjectType IN (
‘C66BA18E-EAF3-4CFF-8A22-41B16D66A972’,
‘B796F64C-1F99-4FFB-B886-4BF4BC011A9C’
)) AS ExpectedRows

```

and my current rows are right now 386, and my expected rows are 34474. when I started it was 330 in my current rows.

And again, I have no idea if the increase from 330→386 is actually the rebuilding of the cache job, or if Umbraco is gradually caching pages/media that visitors access on the site.

I feel very much “in the dark” here 😃

---

<div class="post-metadata">

**Author:** ![justin-nevitech](https://forum.umbraco.com/user_avatar/forum.umbraco.com/justin-nevitech/32/6219_2.png) [@justin-nevitech](https://forum.umbraco.com/u/justin-nevitech)\
**Post date:** [May 20, 2026, 7:54am UTC](https://forum.umbraco.com/t/unable-to-rebuild-database-cache/8068/9 "2026-05-20T07:54:32Z")

</div>

Hi @Pekdon

Where is your production site running? Azure or elsewhere?

Justin

---

<div class="post-metadata">

**Author:** ![Pekdon](https://forum.umbraco.com/user_avatar/forum.umbraco.com/pekdon/32/625_2.png) [@Pekdon](https://forum.umbraco.com/u/Pekdon)\
**Post date:** [May 20, 2026, 7:56am UTC](https://forum.umbraco.com/t/unable-to-rebuild-database-cache/8068/10 "2026-05-20T07:56:22Z")

</div>

It’s runnin on-prem in IIS

---

<div class="post-metadata">

**Author:** ![justin-nevitech](https://forum.umbraco.com/user_avatar/forum.umbraco.com/justin-nevitech/32/6219_2.png) [@justin-nevitech](https://forum.umbraco.com/u/justin-nevitech)\
**Post date:** [May 20, 2026, 8:41am UTC](https://forum.umbraco.com/t/unable-to-rebuild-database-cache/8068/11 "2026-05-20T08:41:57Z")

</div>

Are you able to see from the database whether anything is running that looks like it is rebuilding the NuCache tables? Something like this while a rebuild is supposedly in progress would tell you:

```sql
SELECT session_id, status, command, wait_type, blocking_session_id
FROM sys.dm_exec_requests
WHERE session_id <> @@SPID;

```

If nothing’s hitting `cmsContentNu` or `umbracoNode`, the rebuild has died silently. Also worth a quick look at `sys.dm_tran_locks` in case something’s blocked on `umbracoLock`.

Also worth checking the site is not recycling mid-rebuild and that the CPU and memory on the server are not running low. App pool recycles mid-rebuild would give you exactly this pattern — small bursts of progress then nothing.

One other thing to try — drop the NuCache logger to Debug in `appsettings.json` and trigger another rebuild, the silence in the log viewer is itself a clue:

```json
"Serilog": {
  "MinimumLevel": {
    "Override": {
      "Umbraco.Cms.Infrastructure.PublishedCache": "Debug"
    }
  }
}

```

Appreciate that would require a restart of the site.

Justin

---

<div class="post-metadata">

**Author:** ![Pekdon](https://forum.umbraco.com/user_avatar/forum.umbraco.com/pekdon/32/625_2.png) [@Pekdon](https://forum.umbraco.com/u/Pekdon)\
**Post date:** [May 20, 2026, 8:58am UTC](https://forum.umbraco.com/t/unable-to-rebuild-database-cache/8068/12 "2026-05-20T08:58:36Z")

</div>

@justin-nevitech I did the xhanges to drop PublishedCache to debug, in my stage environment, i clicked the database cache rebuild button but still saw nothing in the logviewer (the database was rebuilt successfully though)

I’ve yet to hear back from my client yet, so I havn’t taken action that restarts the production evironment yet

---

<div class="post-metadata">

**Author:** ![justin-nevitech](https://forum.umbraco.com/user_avatar/forum.umbraco.com/justin-nevitech/32/6219_2.png) [@justin-nevitech](https://forum.umbraco.com/u/justin-nevitech)\
**Post date:** [May 20, 2026, 9:15am UTC](https://forum.umbraco.com/t/unable-to-rebuild-database-cache/8068/13 "2026-05-20T09:15:58Z")

</div>

Hi @Pekdon

Are you able to pull down a copy of production locally and try rebuilding the database cache locally to see if it works there to rule out a hosting issue?

At least that way you may get more clues if you can turn on additional debug logging wiuthout affecting live.

Justin

---

<div class="post-metadata">

**Author:** ![Pekdon](https://forum.umbraco.com/user_avatar/forum.umbraco.com/pekdon/32/625_2.png) [@Pekdon](https://forum.umbraco.com/u/Pekdon)\
**Post date:** [May 20, 2026, 11:40am UTC](https://forum.umbraco.com/t/unable-to-rebuild-database-cache/8068/14 "2026-05-20T11:40:02Z")

</div>

@ShekharTarare I did what you asked, it didn’t help. My site is crashing. I can get into the backoffice but when I go to the Published status screen it’s grayed out and I get an error:

**Server error:** Contact administrator, see log for full details.  
\*Failed to verify the cache.

(I can’t check the logviewer because it tells me this:)  
\*

 ![image](https://forum.umbraco.com/uploads/default/original/2X/c/c4fd4494203ce7a5b67b1c794c0bccbf698c34ec.png)

---

<div class="post-metadata">

**Author:** ![justin-nevitech](https://forum.umbraco.com/user_avatar/forum.umbraco.com/justin-nevitech/32/6219_2.png) [@justin-nevitech](https://forum.umbraco.com/u/justin-nevitech)\
**Post date:** [May 20, 2026, 11:42am UTC](https://forum.umbraco.com/t/unable-to-rebuild-database-cache/8068/15 "2026-05-20T11:42:41Z")

</div>

Hi @Pekdon

You will need to look at the logs outside of Umbraco.

I’m assuming this is causing live site issues, so is it worth a restart and try rebuilding the cache again anyway?

Justin

---

<div class="post-metadata">

**Author:** ![ShekharTarare](https://forum.umbraco.com/user_avatar/forum.umbraco.com/shekhartarare/32/5488_2.png) [@ShekharTarare](https://forum.umbraco.com/u/ShekharTarare)\
**Post date:** [May 20, 2026, 11:45am UTC](https://forum.umbraco.com/t/unable-to-rebuild-database-cache/8068/16 "2026-05-20T11:45:27Z")

</div>

Yes please check the physical text logs, it will tell the exact issue. The log files seem too large that’s why the log viewer is not showing the logs.

---

<div class="post-metadata">

**Author:** ![Pekdon](https://forum.umbraco.com/user_avatar/forum.umbraco.com/pekdon/32/625_2.png) [@Pekdon](https://forum.umbraco.com/u/Pekdon)\
**Post date:** [May 20, 2026, 12:09pm UTC](https://forum.umbraco.com/t/unable-to-rebuild-database-cache/8068/17 "2026-05-20T12:09:27Z")

</div>

Im unsure what to search for, the logfile has over a million lines, but i just searched for the keyword “Panic” and got this:

{

```
"@t": "2026-05-20T11:48:50.9050406Z",

```

“@mt”: “Panic, exception while loading cache data.”,

“@l”: “Fatal”,

“@x”: “System.InvalidOperationException: No data for media 1612\r\n at Umbraco.Cms.Infrastructure.PublishedCache.Persistence.NuCacheContentRepository.CreateMediaNodeKit(ContentSourceDto dto, IContentCacheDataSerializer serializer)\r\n at Umbraco.Cms.Infrastructure.PublishedCache.Persistence.NuCacheContentRepository.GetAllMediaSources()+MoveNext()\r\n at Umbraco.Extensions.EnumerableExtensions.InGroupsOf[T](IEnumerable`1 source, Int32 groupSize)+MoveNext()\r\n at Umbraco.Cms.Infrastructure.PublishedCache.ContentStore.SetAllFastSortedLocked(IEnumerable`1 kits, Int32 kitGroupSize, Boolean fromDb)\r\n at Umbraco.Cms.Infrastructure.PublishedCache.PublishedSnapshotService.LoadMediaFromDatabaseLocked(Boolean onStartup)\r\n at Umbraco.Cms.Infrastructure.PublishedCache.PublishedSnapshotService.b\_\_64\_4()\r\n at Umbraco.Cms.Infrastructure.PublishedCache.PublishedSnapshotService.LockAndLoadMedia(Func`1 action)\r\n at Umbraco.Cms.Infrastructure.PublishedCache.PublishedSnapshotService.b__64_0()\r\n at System.Threading.LazyInitializer.EnsureInitializedCore[T](T& target, Boolean& initialized, Object& syncLock, Func`1 valueFactory)\r\n at System.Threading.LazyInitializer.EnsureInitialized[T](T& target, Boolean& initialized, Object& syncLock, Func`1 valueFactory)\r\n at Umbraco.Cms.Infrastructure.PublishedCache.PublishedSnapshotService.EnsureCaches()\r\n at Umbraco.Cms.Infrastructure.PublishedCache.PublishedSnapshotService.CreatePublishedSnapshot(String previewToken)\r\n at Umbraco.Cms.Web.Common.UmbracoContext.UmbracoContext.\<\>c__DisplayClass11_0.\<.ctor\>b__0()\r\n at System.Lazy`1.ViaFactory(LazyThreadSafetyMode mode)”,

“@tr”: “2e1322ba3596ab5e882981f1e2bfc1eb”,

“@sp”: “6586680c23eff15b”,

“SourceContext”: “Umbraco.Cms.Infrastructure.PublishedCache.PublishedSnapshotService”,

“RequestId”: “40000cfc-0006-ff00-b63f-84710c7967bb”,

“RequestPath”: “/”,

“ProcessId”: 8860,

“ProcessName”: “w3wp”,

“ThreadId”: 15,

“ApplicationId”: “6e8db0fd0aebcbe213eabc9d3fc38e061aecb71b”,

“MachineName”: “FOS-APP01-PROD”,

“Log4NetLevel”: “FATAL”,

“HttpRequestId”: “d4850bea-28d2-4f0c-af64-0f4a3a60f382”,

“HttpRequestNumber”: 2,

“HttpSessionId”: “0”

}

my AI agent is telling me some data, somewhere is corrupt and is causing DocumentRepository.MapDtosToContent to throw exceptions

---

<div class="post-metadata">

**Author:** ![justin-nevitech](https://forum.umbraco.com/user_avatar/forum.umbraco.com/justin-nevitech/32/6219_2.png) [@justin-nevitech](https://forum.umbraco.com/u/justin-nevitech)\
**Post date:** [May 20, 2026, 12:37pm UTC](https://forum.umbraco.com/t/unable-to-rebuild-database-cache/8068/18 "2026-05-20T12:37:14Z")

</div>

> [@Pekdon](#):
>
> 1612

If you go into the media library and amend the URL to load 1612, does it give you any errors and/or load the media?

[https://www.yourdomain.com/umbraco#/media/media/edit/1612](https://www.yourdomain.com/umbraco#/media/media/edit/1612)

I would start there if it thinks something is corrupt or wrong…

Also, are you able to pull down the site and database locally as you could then run the Umbraco code to possibly get more details…

---

<div class="post-metadata">

**Author:** ![Pekdon](https://forum.umbraco.com/user_avatar/forum.umbraco.com/pekdon/32/625_2.png) [@Pekdon](https://forum.umbraco.com/u/Pekdon)\
**Post date:** [May 20, 2026, 12:48pm UTC](https://forum.umbraco.com/t/unable-to-rebuild-database-cache/8068/19 "2026-05-20T12:48:06Z")

</div>

im working on grabbing the database backup!

i went to the media/edit/1612, it’s just a nromal folder in the media library and didn’t give me any errors

---

<div class="post-metadata">

**Author:** ![Pekdon](https://forum.umbraco.com/user_avatar/forum.umbraco.com/pekdon/32/625_2.png) [@Pekdon](https://forum.umbraco.com/u/Pekdon)\
**Post date:** [May 20, 2026, 12:58pm UTC](https://forum.umbraco.com/t/unable-to-rebuild-database-cache/8068/20 "2026-05-20T12:58:37Z")

</div>

My AI agent tells me that we need the cmsContentNu cache to be rebuilt and that’s what’s causing the issues.

[Next page](https://forum.umbraco.com/t/unable-to-rebuild-database-cache/8068.md?page=2)
