Developer forum

Forum » CMS - Standard features » Page template locked by process

Page template locked by process

Arnór Halldórsson
Arnór Halldórsson
Reply

Hi nerds,

One of our live websites got this error today and it blocked the website from being viewed:

System.ApplicationException: The process cannot access the file 'D:\Dynamicweb\Files\Templates\Designs\ProjectName\_parsed\DefaultPage_Vite.parsed.cshtml' because it is being used by another process. at Dynamicweb.Core.Helpers.TextFileHelper.ReadTextFile(String path, Encoding encoding) at Dynamicweb.Rendering.Reader.Read(String path, Int32 counter, Encoding encoding, Boolean replaceTags, Boolean& isCached, List`1 includes)

The page template in question looks like this:

@inherits Dynamicweb.Rendering.ViewModelTemplate<Dynamicweb.Frontend.PageViewModel>
@using Dynamicweb.Environment;
@using Advania.Custom.Extensions;
@MasterPageFile("Master/Master_Vite.cshtml")
@{
    ExecutingContext context = new ExecutingContext();
    bool isVisualEditor = context.IsVisualEditor();
}
@if (isVisualEditor)
{
    <grid>
        @Model.Grid("grid", "Grid", "", "VueGrid")
    </grid>
} else
{
    <app></app>
}

Best regards,
Arnór


Replies

 
Nicolai Pedersen Dynamicweb Employee
Nicolai Pedersen
Reply

Hi Arnor

Can be many things locking the file - antivirus, back jobs etc.. Did you see the error again?

It is not a known issue at least.

BR Nicolai

 
Andrew Rushworth
Reply

Hi,

We are experiencing this a lot on Azure hosting - tends to be when users are editing content.

Thanks,
Andrew

 
Kevin Steffer
Kevin Steffer
Reply

We also have a couple of cases lately on DW 9.15.x, 9.16.x and 9.17.x

Where the frontend just dies because the <Page>.parsed.cshtml is already in use. And file is locked - the only way out of it is to recycle App Pool.

 
Imar Spaanjaars Dynamicweb Employee
Imar Spaanjaars
Reply

We had a similar issue where this was caused by the deletion of the _parsed folder based on a specific query string variable. I believe that code has now gone and the changes should be available in 9.17.15 and 9.18.1.

 

 
Lauritz Holtze Dynamicweb Employee
Lauritz Holtze
Reply

We have also had this happen today on a client. a recycle fixes it. I recall have seen this on several solutions. The client in question today is on 9.18.3. 

I think this should be looked at. Either by product development, or at the least hosting, to make sure we proactively catch this front-end exception that makes the whole site down.

 
Nicolai Pedersen Dynamicweb Employee
Nicolai Pedersen
Reply
This post has been marked as an answer

Hi

I have created bug 24867 https://dev.azure.com/dynamicwebsoftware/Dynamicweb/_workitems/edit/24867

A suggestion to changing the process of reading parsed files have been implemented and needs testing and verification.

BR Nicolai

Votes for this answer: 1
 
Arnór Halldórsson
Arnór Halldórsson
Reply

Hi Nicolai,

Great news! Thank you :)

BR,
Arnór

 

You must be logged in to post in the forum