using migration file in live environment

Topics: Troubleshooting, Writing modules
Dec 5, 2012 at 3:37 PM

Hey everyone,

I'm trying to add a record to my database in a live environment via the migrations file:

       public int UpdateFrom14()
       {
           _schoolTypeRepository.Create(new SchoolTypeRecord { SchoolType = "Deeltijds Onderwijs" });

           return 15;
       }

when using this in visual studio it works fine, when I update my migrations file in a live running website nothing seems to happen.

Does anyone know how i can do this?

I already restarted the site (it's on azure) and also deactivated en activated the module again.

Kind regards,

Borrie

Coordinator
Dec 5, 2012 at 6:58 PM

Nothing in app_data\logs? Set a breakpoint in there and attach a debugger.

Dec 6, 2012 at 10:02 PM

Bertrand,

I don't see anything regarding the issue, it's a live site, how can I attach a debugger?

Also every 7 minutes (i generate warmup pages every 7 minutes) this appears in the logs:

 

2012-12-04 23:59:48,447 [42] Orchard.ContentManagement.DefaultContentManager - NullReferenceException thrown from IContentHandler by Orchard.Core.Navigation.Handlers.ContentMenuItemPartHandler
System.NullReferenceException: Object reference not set to an instance of an object.
   at Orchard.ContentManagement.DefaultContentManager.GetItemMetadata(IContent content)
   at Orchard.Core.Navigation.Handlers.ContentMenuItemPartHandler.GetItemMetadata(GetContentItemMetadataContext context)
   at Orchard.ContentManagement.Handlers.ContentHandler.Orchard.ContentManagement.Handlers.IContentHandler.GetContentItemMetadata(GetContentItemMetadataContext context)
   at Orchard.ContentManagement.DefaultContentManager.<>c__DisplayClass60.<GetItemMetadata>b__5f(IContentHandler handler)
   at Orchard.InvokeExtensions.Invoke[TEvents](IEnumerable`1 events, Action`1 dispatch, ILogger logger)
2012-12-04 23:59:48,650 [60] Orchard.ContentManagement.DefaultContentManager - NullReferenceException thrown from IContentHandler by Orchard.Core.Navigation.Handlers.ContentMenuItemPartHandler
System.NullReferenceException: Object reference not set to an instance of an object.
   at Orchard.ContentManagement.DefaultContentManager.GetItemMetadata(IContent content)
   at Orchard.Core.Navigation.Handlers.ContentMenuItemPartHandler.GetItemMetadata(GetContentItemMetadataContext context)
   at Orchard.ContentManagement.Handlers.ContentHandler.Orchard.ContentManagement.Handlers.IContentHandler.GetContentItemMetadata(GetContentItemMetadataContext context)
   at Orchard.ContentManagement.DefaultContentManager.<>c__DisplayClass60.<GetItemMetadata>b__5f(IContentHandler handler)
   at Orchard.InvokeExtensions.Invoke[TEvents](IEnumerable`1 events, Action`1 dispatch, ILogger logger)
2012-12-04 23:59:48,854 [58] Orchard.ContentManagement.DefaultContentManager - NullReferenceException thrown from IContentHandler by Orchard.Core.Navigation.Handlers.ContentMenuItemPartHandler
System.NullReferenceException: Object reference not set to an instance of an object.
   at Orchard.ContentManagement.DefaultContentManager.GetItemMetadata(IContent content)
   at Orchard.Core.Navigation.Handlers.ContentMenuItemPartHandler.GetItemMetadata(GetContentItemMetadataContext context)
   at Orchard.ContentManagement.Handlers.ContentHandler.Orchard.ContentManagement.Handlers.IContentHandler.GetContentItemMetadata(GetContentItemMetadataContext context)
   at Orchard.ContentManagement.DefaultContentManager.<>c__DisplayClass60.<GetItemMetadata>b__5f(IContentHandler handler)
   at Orchard.InvokeExtensions.Invoke[TEvents](IEnumerable`1 events, Action`1 dispatch, ILogger logger)

 

So everyday I have 2 log files of around 1.5MB, do you know how I can solve this and what it means?

 

Borrie

Coordinator
Dec 7, 2012 at 2:19 AM

So the migration works on your dev machine, but not in the live environment? Did you check the Orchard_FrameworkDataMigrationRecord table?

For your second issue, please file a bug.