Copied to clipboard

Flag this post as spam?

This post will be reported to the moderators as potential spam to be looked at


  • Paul Marden 235 posts 338 karma points MVP 2x c-trib
    Oct 02, 2009 @ 11:44
    Paul Marden
    0

    Trouble Publishing after moving umbraco instance

    I had an umbraco instance running just fine on an old server.  I've just moved it to a new server, and I'm now having trouble publishing nodes.  Whenever I do a publish, the backend says the publish is succesful, but the publish doesn't work and when checking the Event Log on the server there is an unhandled exception:

    An unhandled exception occurred and the process was terminated.

    Application ID: /LM/W3SVC/1992667648/ROOT

    Process ID: 1652

    Exception: System.UnauthorizedAccessException

    Message: Access to the path 'D:\home\Default\freeumbracotemplates.co.uk\htdocs\data\umbraco.config' is denied.

    StackTrace:    at System.IO.__Error.WinIOError(Int32 errorCode, String maybeFullPath)
       at System.IO.File.SetAttributes(String path, FileAttributes fileAttributes)
       at umbraco.content.ClearDiskCache()
       at umbraco.content.SaveContentToDisk(XmlDocument xmlDoc)
       at umbraco.content.<>c__DisplayClass10.<SaveContentToDiskAsync>b__f(Object )
       at System.Threading._ThreadPoolWaitCallback.WaitCallback_Context(Object state)
       at System.Threading.ExecutionContext.runTryCode(Object userData)
       at System.Runtime.CompilerServices.RuntimeHelpers.ExecuteCodeWithGuaranteedCleanup(TryCode code, CleanupCode backoutCode, Object userData)
       at System.Threading.ExecutionContext.RunInternal(ExecutionContext executionContext, ContextCallback callback, Object state)
       at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state)
       at System.Threading._ThreadPoolWaitCallback.PerformWaitCallbackInternal(_ThreadPoolWaitCallback tpWaitCallBack)
       at System.Threading._ThreadPoolWaitCallback.PerformWaitCallback(Object state)

    The thing is I know that the permissions on that file are ok, because it's being run by Administrator.

    The site is running Umbraco 4.0.2.1 with Asp.net 2.0.50727, Windows Server 2003 32bit Web Edition SP2.

  • Paul Marden 235 posts 338 karma points MVP 2x c-trib
    Oct 02, 2009 @ 11:45
    Paul Marden
    0

    I forgot to mention that when the exception is thrown the server spins up a process called DW20.exe which consumes vast amounts of cpu and slows the machine to a crawl until I kill it.

  • Douglas Robar 3570 posts 4711 karma points MVP ∞ admin c-trib
    Oct 02, 2009 @ 12:11
    Douglas Robar
    0

    I believe the error report... triple-check the file perms on the data/umbraco.config file. In fact, just delete the file and then touch the web.config. Does it get re-created? If not, then the data folder doesn't have enough perms.

    Remember, it is the owner of the application pool that needs CRUD perms, not 'administrator'.

    cheers,
    doug.

  • Paul Marden 235 posts 338 karma points MVP 2x c-trib
    Oct 02, 2009 @ 12:17
    Paul Marden
    0

    Quite clever really aren't you!!!

    Never thought to check the identity of the app pool.  That was running as network service not Administrator.  Perms all fixed.  Deleted and recreated umbraco.config....  and Ta Da.

  • Douglas Robar 3570 posts 4711 karma points MVP ∞ admin c-trib
    Oct 02, 2009 @ 12:28
    Douglas Robar
    0

    Always here to help, Paul. :)

    Glad it's all working for you.

    cheers,
    doug.

  • Richard 146 posts 168 karma points
    Oct 02, 2009 @ 15:38
    Richard
    0

    I had to move a number sites to a new server, so I wrote the following batch file to set the permissions:

    REM Set permissions for Umbraco installation
    set IIS_USER="NETWORK SERVICE"

    set WEBDIR="<directory_name>"

    REM Give IIS User read permission to all folders
    CACLS %WEBDIR% /E /T /C /G %IIS_USER%:R

    REM Write permission to folders: css, data, media, scripts, xslt

    CACLS %WEBDIR%\css /E /T /C /G %IIS_USER%:W
    CACLS %WEBDIR%\css /E /T /C /G %IIS_USER%:C

    CACLS %WEBDIR%\data /E /T /C /G %IIS_USER%:W
    CACLS %WEBDIR%\data /E /T /C /G %IIS_USER%:C

    CACLS %WEBDIR%\media /E /T /C /G %IIS_USER%:W
    CACLS %WEBDIR%\media /E /T /C /G %IIS_USER%:C

    CACLS %WEBDIR%\scripts /E /T /C /G %IIS_USER%:W
    CACLS %WEBDIR%\scripts /E /T /C /G %IIS_USER%:C

    CACLS %WEBDIR%\xslt /E /T /C /G %IIS_USER%:W
    CACLS %WEBDIR%\xslt /E /T /C /G %IIS_USER%:C

    Set the IIS_USER value to the application pool account, and the WEBDIR variable to the directory containing your web site, so web.config will be in this directory. This then sets read permission to all files and gives write permission to the directories that need it. This was used for Umbraco 3, so you may need to add in lines for MasterPages so that you can change them in the admin screen.

Please Sign in or register to post replies

Write your reply to:

Draft