This project is read-only.

Error on Settings page after 1.8 Upgrade

Topics: Troubleshooting
Apr 3, 2014 at 8:50 PM
Hey guys,

Before I upgrade the other 5 sites to 1.8, I have encountered an error on the first upgrade when attempting to access the Settings page in admin. The error I'm getting is:
Invalid object name 'Orchard_Messaging_MessageSettingsPartRecord'.
Statement(s) could not be prepared.

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.Data.SqlClient.SqlException: Invalid object name 'Orchard_Messaging_MessageSettingsPartRecord'.
Statement(s) could not be prepared.

Source Error: 

Line 9:              <select id="@Html.FieldIdFor(m => m.MessageSettings.DefaultChannelService)" name="@Html.FieldNameFor(m => m.MessageSettings.DefaultChannelService)">
Line 10:             @foreach ( var service in Model.ChannelServices ) {
Line 11:                 <option @if(Model.MessageSettings.DefaultChannelService == service) { <text>selected="selected"</text> } value="@service">@service</option>
Line 12:              }
Line 13:              </select>

Source File: c:\HostingSpaces\wiggle\\wwwroot\Modules\Orchard.Messaging\Views\EditorTemplates\Parts\MessageSettings.cshtml    Line: 11
After completing the upgrade, I enabled the Upgrade module and ran all the Migrate buttons on the 1.8 tabs (InfoSet and Messaging)

Any ideas on what the issue may be and how to resolve it? Thanks!
Apr 3, 2014 at 8:53 PM
If I disable the Email Messaging module, I'm able to view the Settings page again. Re-enabling the module causes the error once again.
Apr 3, 2014 at 11:32 PM
Given it is a SqlException, it sounds like the Orchard_Messaging_MessageSettingsPartRecord Table is missing. Since you're doing an upgrade and the email module was originally enabled, it should be there. If it isn't, that would be weird.

Now I would think that if you migrated the messaging it shouldn't really be looking there for the settings anyway, since they should now be accessible by InfoSet. However, if that migration silently failed because of a missing table, that explains everything.

My guess is that the table is missing and migration failed for messaging, so it is looking for the table. If the table doesn't exist, just create one and re-do the migration to eliminate the problem.


Apr 4, 2014 at 12:04 AM
You are correct, the table is not there...which is really strange because the module has been enabled for at least 6 months.

I'm going to try to create the table and attempt the migration again.

Thanks for the info David!
Apr 4, 2014 at 1:16 AM
Unless this module is actually removed from 1.8 ... and the table deleted during the migration, meaning you can also remove the module.
Apr 4, 2014 at 2:19 AM
Doh! But, of course, the messaging infrastructure was deprecated so the module/table is no longer needed.

Will this error always occur during upgrades if the module was previously enabled? I didn't get this error on two upgrades, but I don't remember if the module was enabled or not.
Apr 4, 2014 at 4:15 AM
Probably a mistake actually. I should update the release notes to mention that.
Apr 4, 2014 at 4:44 AM
I must not be following this upgrade to email. If I disable the Email module in Orchard, I get the following message at the top:

Some Orchard.User settings require an Email channel to be enabled.

and it tells me to enable the Orchard.Email module. I supposed to remove the Email module in 1.8? I looked at the default 1.8 Orchard.Web package and the module is still there, so that makes me think it's still supposed to be present and enabled.
Apr 4, 2014 at 4:46 AM
Yes, Orchard.Email is necessary, Orchard.Messaging can be removed, I haven't read the thread, too lazy

PS: still haven't, hope my answer makes sense
Marked as answer by psenechal on 4/4/2014 at 8:44 AM
Apr 4, 2014 at 4:53 AM
OH! I was looking at the wrong module. Okay, that makes more sense. Yes...disabling Orchard.Messaging worked and I can get to Settings again.

Thanks =)