404 after Upgrade to 1.4.1

Topics: Installing Orchard, Troubleshooting
May 16, 2012 at 6:46 PM
Edited May 16, 2012 at 7:50 PM

I am following the instructions for upgrading to 1.4.0 to 1.4.1 using the zip file. I unzipped in my My Sites. I copied over the media, themes, modules, and App_Data folders. I open the folder as a site in WebMatrix. It reports that the site has started successully. I click to open the homepage and get a 404. What am I missing or doing wrong? 

 

I followed these steps:

  • In a new, empty directory, install a fresh copy of the latest version of Orchard, but don't go through setup.
  • Copy your existing site's Media folder into the new directory.
  • Copy the remaining module and themes directories that you have on your existing site and that are not already in the new one into the new directory's Modules and Themes directories.
  • Copy the AppData_ folder from the existing site into the new directory.
  • Point a local web server to the new directory. You can use IIS; in that case, use IIS Manager to create a new web site that points at the directory and then navigate to it. Alternatively, you can use WebMatrix and IIS Express; to do that, right-click the directory in Windows Explorer and choose Open as a Web Site with Microsoft WebMatrix and then run the site.

     

    Editing this to remove the resolved error and because I forgot to mention I'm using SQL Express on a remote server rather than SQL Compact. Are there any other upgrade issues/steps for using a remote DB?

    Thanks for any help!

  • Developer
    May 16, 2012 at 6:52 PM

    Is your IIS7 application pool running in ASP.NET 4.0 Integrated mode?

    May 16, 2012 at 7:39 PM
    sfmskywalker wrote:

    Is your IIS7 application pool running in ASP.NET 4.0 Integrated mode?


    It is now, thanks. That fixed the configuration error, but now I just get the same 404 as when I load it into Web Matrix.

    Thanks for the reply.

    Developer
    May 16, 2012 at 9:01 PM

    I have run into this as well a few times, but can't remember exactly what the problem was. Maybe there are some errors in the log that give you a hint?

    May 18, 2012 at 3:59 PM
    sfmskywalker wrote:

    I have run into this as well a few times, but can't remember exactly what the problem was. Maybe there are some errors in the log that give you a hint?


    Hey again,

    Thanks for the reply. Here is all I can find. It looks like some basic application error. I'm probably missing a step somewhere, but I don't know where. I have come to the conclusion that the manual upgrade instructions are out of date and everyone who knows what they're doing is working from repository/enlistment, which is a bit over my head at this point.

    #Software: Microsoft Internet Information Services 7.5
    #Version: 1.0
    #Date: 2012-05-16 18:37:25
    #Fields: date time s-ip cs-method cs-uri-stem cs-uri-query s-port cs-username c-ip cs(User-Agent) sc-status sc-substatus sc-win32-status time-taken
    2012-05-16 18:37:25 ::1 GET / - 85 - ::1 Mozilla/5.0+(compatible;+MSIE+9.0;+Windows+NT+6.1;+WOW64;+Trident/5.0) 500 0 0 327
    #Software: Microsoft Internet Information Services 7.5
    #Version: 1.0
    #Date: 2012-05-16 19:35:33
    #Fields: date time s-ip cs-method cs-uri-stem cs-uri-query s-port cs-username c-ip cs(User-Agent) sc-status sc-substatus sc-win32-status time-taken
    2012-05-16 19:35:33 ::1 GET / - 85 - ::1 Mozilla/5.0+(compatible;+MSIE+9.0;+Windows+NT+6.1;+WOW64;+Trident/5.0) 404 0 0 8049

    Developer
    May 18, 2012 at 4:15 PM

    Hi mrenf, could you check the logs in the App_data/Log directory? It may give you a hint of what's going on.

    May 18, 2012 at 5:33 PM

    Yes, I noticed those logs today! It reported an error about the Lists module is the first line. I removed the Lists module (which I think is deprecated) and now I get more than a 404 to work with. I now have an error about permissions for Network Service on the dependencies.xml file. I granted read and execute access for Network Service and now I still get:

    Access to the path 'C:\inetpub\HDI-Orchard-1-4-1\App_Data\Dependencies\dependencies.xml' is denied.

    Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.

    Exception Details: System.UnauthorizedAccessException: Access to the path 'C:\inetpub\HDI-Orchard-1-4-1\App_Data\Dependencies\dependencies.xml' is denied.

    ASP.NET is not authorized to access the requested resource. Consider granting access rights to the resource to the ASP.NET request identity. ASP.NET has a base process identity (typically {MACHINE}\ASPNET on IIS 5 or Network Service on IIS 6 and IIS 7, and the configured application pool identity on IIS 7.5) that is used if the application is not impersonating. If the application is impersonating via <identity impersonate="true"/>, the identity will be the anonymous user (typically IUSR_MACHINENAME) or the authenticated request user.

    To grant ASP.NET access to a file, right-click the file in Explorer, choose "Properties" and select the Security tab. Click "Add" to add the appropriate user or group. Highlight the ASP.NET account, and check the boxes for the desired access.

    Source Error:

    An unhandled exception was generated during the execution of the current web request. Information regarding the origin and location of the exception can be identified using the exception stack trace below.

    So hopefully its just a matter of understanding what permissions it needs.

    Thanks again for replying!

     

    Coordinator
    May 19, 2012 at 6:55 AM

    All of app_data should have read/write permissions for the app pool user.

    May 23, 2012 at 6:14 PM

    Thank you, Bertrand. I got the manual upgrade to work finally. 

    For anyone who may find this thread, if you are new to using IIS 7.5 you actually need to add r/w permissions for the virtual application pool user rather than Network Service.

    Here is the information on application pool identities that helped me:

    http://learn.iis.net/page.aspx/624/application-pool-identities/

    Also from the Orchard documentation:

    Running the Site Using IIS

    To use IIS, extract the contents of the Orchard folder from the .zip file to an IIS virtual directory (or site root), and then view the site using a browser. If you are using IIS 7, configure it to run in integrated mode, and configure the application pool to run the .NET Framework version 4.

    You might have to set read/write permissions for the account that is configured as the identity for the IIS application pool on the following folders:

    • Modules. This is required if you want to install modules from the gallery. (We recommend that you remove the read/write permissions for production sites.)
    • Themes. This is required if you want to install themes from the gallery. (We recommend that you remove the read/write permissions for production sites.)
    • AppData_. This folder is where Orchard stores site settings.
    • Media. This folder is where Orchard stores media files (images, etc.).

    If you want to completely reset an Orchard site configuration to its default settings, you can delete the AppData_ directory. This removes all your custom settings, users, and configuration, as well as any custom data you have added to the site. If you delete the AppData_ folder, and if you want to remove custom images that you have added to the site, you can delete the Media folder as well.

     

    May 24, 2012 at 9:25 PM

    I'm running into the 404 error mentioned at the start of this thread.  If I stop/re-start the site in IIS The home page loads fine once but on a refresh I get the 404.  The app pool is running v4.0/Integrated and I did need to give permissions.

    The log file seems to be full of these guys:

    System.AggregateException: One or more errors occurred. ---> Orchard.OrchardException: Error while loading extension 'Lucene'. ---> System.TypeLoadException: Inheritance security rules violated while overriding member: 'Lucene.Models.LuceneDocumentIndex.SetContentItemId(Int32)'. Security accessibility of the overriding method must match the security accessibility of the method being overriden.

     

     

    Coordinator
    May 24, 2012 at 9:29 PM

    I think you need to upgrade the modules too, in this case Lucene

    May 24, 2012 at 10:15 PM

    Updating the Lucene module by just copying in the new module to the module directory got by that one but it seems to be going right down the line with other modules.  

    The next module didn't have an update but I worked around it by removing [assembly: SecurityTransparent] from the AssemblyInfo.cs file.

    The module it's giving that error on now is the Orchard.Messaging module.  I updated the module to the 1.4.1 version but it's still spitting out the below message in the log:

    2012-05-24 18:03:37,088 [17] Orchard.Environment.Extensions.ExtensionManager - Error loading extension 'Orchard.Messaging'System.TypeLoadException: Inheritance security rules violated by type: 'Orchard.Messaging.Drivers.MessageSettingsPartDriver'. Derived types must either match the security accessibility of the base type or be less accessible.

    Coordinator
    May 24, 2012 at 10:23 PM

    When you upgrade, you should overwrite all files with the new version. Because the new versions don't have this attribute anymore.

    Another solution is to grab the new version source code, and copy/paste you App_Data + Media + Custom Theme inside, so that you are sure to use the new files.

    May 24, 2012 at 10:29 PM

    That's where I'm at with it... I'm going to remove all the modules except for the packaged guys and install the missing ones through the admin.  Thanks for your help Sébastien!