Error msg: Some features need to be upgraded: MyNewModuleName

Oct 30, 2010 at 4:32 PM
Edited Oct 30, 2010 at 4:33 PM

Hi,

I'm not sure what I've done, but I thought you might be able to tell me what this error message means.

I'm writing my own module following the instructions for the Map module while changing the code slightly to match the 0.8 version of the module.

It all compiles, but when I try to install my module it says:

Some features need to be upgraded: MyNewModuleName
MyNewModuleName was enabled

The module is then highlighted red and it's record table doesn't seem to have been added to the database.
My first thought was I'd set the OrchardVersion to 0.8 in Module.txt, but the 0.8 Map module sets it to 1.0.0, so I set it to that, but I still get the same message. I thought it might be cached so I deleted the database and the App-Data folder and ran setup again. This didn't fix it.
My other thought is that there might be something wrong with my Data Migrations, but it looks right. Here it is, just in case: 
namespace MyNewModuleName.DataMigrations
{
	public class MyNewModuleNameMigration : DataMigrationImpl
	{
		public int Create()
		{
			// Creating table Record
			SchemaBuilder.CreateTable("NewModuleRecord", table => table
				.ContentPartRecord()
				.Column("City", DbType.UInt16)
			);

			return 1;
		}
	}
}

Any ideas?
Coordinator
Oct 30, 2010 at 5:17 PM

This can happen if there is a discrepency between the known current database schema for this module, and the available migrations. It is possible that you have installed it earlier, then the migrations have changed in a way which is not compatible with the previous module. When updating a module, the migrations should return incremental numbers.

Your current migration class looks good though, so I would suggest you to reset your database. Or you can also manually change the isntalled version numbers in the datamigrations table.

Oct 30, 2010 at 8:38 PM

It still happens with a clean db. Even when trying to enable this module is the first thing I do after the setup finishes.

The module isn't in the datamigrations table, before or after the failed enabling.

Is there a way to get a more detailed error message than "Some features need to be upgraded".

--
Thanks for your help,

Richard.

Coordinator
Oct 30, 2010 at 8:48 PM

Can you try to create a c:\logs folder, as in dev mode it will be used as a log folder ?

We have so many modules working nicely that there must some explanation. Maybe it's coming from another provider in the module, which makes it to fail. We'll see with the log.

Oct 30, 2010 at 9:45 PM

Here is the log (My module is called WeatherExperienced):

Orchard.Environment.ShellBuilders.ShellContextFactory Warning: 0 : No shell settings available. Creating shell context for setup
Orchard.Environment.ShellBuilders.ShellContextFactory Warning: 0 : No shell settings available. Creating shell context for setup
Orchard.Data.SessionLocator Information: 0 : Openning database session
Orchard.Data.SessionLocator Information: 0 : Openning database session
Orchard.Environment.ShellBuilders.ShellContextFactory Warning: 0 : No shell settings available. Creating shell context for setup
Orchard.Data.SessionLocator Information: 0 : Openning database session
Orchard.Data.SessionLocator Information: 0 : Openning database session
Orchard.Data.SessionLocator Information: 0 : Openning database session
Orchard.Data.SessionLocator Information: 0 : Openning database session
Orchard.Data.SessionLocator Information: 0 : Openning database session
Orchard.Data.SessionLocator Information: 0 : Openning database session
Orchard.Data.SessionLocator Information: 0 : Openning database session
Orchard.Data.SessionLocator Information: 0 : Openning database session
Orchard.Data.SessionLocator Information: 0 : Openning database session
Orchard.Data.SessionLocator Information: 0 : Openning database session
Orchard.Events.DefaultOrchardEventBus Error: 0 : TargetInvocationException thrown from IFeatureEventHandler.Install by Orchard.Data.Migration.DataMigrationCoordinator, System.Reflection.TargetInvocationException: Exception has been thrown by the target of an invocation. ---> System.Reflection.TargetInvocationException: Exception has been thrown by the target of an invocation. ---> System.ArgumentException: Dialect does not support DbType.UInt16
Parameter name: typecode
   at NHibernate.Dialect.TypeNames.Get(DbType typecode)
   at NHibernate.Dialect.Dialect.GetTypeName(SqlType sqlType)
   at Orchard.Data.Migration.Interpreters.DefaultDataMigrationInterpreter.GetTypeName(DbType dbType, Nullable`1 length, Byte precision, Byte scale) in D:\Users\Richard\Garsonix\projects\Noggin Box\Orchard0.8full\src\Orchard\Data\Migration\Interpreters\DefaultDataMigrationInterpreter.cs:line 281
   at Orchard.Data.Migration.Interpreters.DefaultDataMigrationInterpreter.Visit(StringBuilder builder, CreateColumnCommand command) in D:\Users\Richard\Garsonix\projects\Noggin Box\Orchard0.8full\src\Orchard\Data\Migration\Interpreters\DefaultDataMigrationInterpreter.cs:line 297
   at Orchard.Data.Migration.Interpreters.DefaultDataMigrationInterpreter.Visit(CreateTableCommand command) in D:\Users\Richard\Garsonix\projects\Noggin Box\Orchard0.8full\src\Orchard\Data\Migration\Interpreters\DefaultDataMigrationInterpreter.cs:line 74
   at Orchard.Data.Migration.Interpreters.AbstractDataMigrationInterpreter.Visit(ISchemaBuilderCommand command) in D:\Users\Richard\Garsonix\projects\Noggin Box\Orchard0.8full\src\Orchard\Data\Migration\Interpreters\AbstractDataMigrationInterpreter.cs:line 14
   at Orchard.Data.Migration.Schema.SchemaBuilder.Run(ISchemaBuilderCommand command) in D:\Users\Richard\Garsonix\projects\Noggin Box\Orchard0.8full\src\Orchard\Data\Migration\Schema\SchemaBuilder.cs:line 44
   at Orchard.Data.Migration.Schema.SchemaBuilder.CreateTable(String name, Action`1 table) in D:\Users\Richard\Garsonix\projects\Noggin Box\Orchard0.8full\src\Orchard\Data\Migration\Schema\SchemaBuilder.cs:line 17
   at WeatherExperienced.DataMigrations.WeatherExperiencedDataMigration.Create()
   --- End of inner exception stack trace ---
   at System.RuntimeMethodHandle._InvokeMethodFast(IRuntimeMethodInfo method, Object target, Object[] arguments, SignatureStruct& sig, MethodAttributes methodAttributes, RuntimeType typeOwner)
   at System.RuntimeMethodHandle.InvokeMethodFast(IRuntimeMethodInfo method, Object target, Object[] arguments, Signature sig, MethodAttributes methodAttributes, RuntimeType typeOwner)
   at System.Reflection.RuntimeMethodInfo.Invoke(Object obj, BindingFlags invokeAttr, Binder binder, Object[] parameters, CultureInfo culture, Boolean skipVisibilityChecks)
   at System.Reflection.RuntimeMethodInfo.Invoke(Object obj, BindingFlags invokeAttr, Binder binder, Object[] parameters, CultureInfo culture)
   at System.Reflection.MethodBase.Invoke(Object obj, Object[] parameters)
   at Orchard.Data.Migration.DataMigrationManager.Update(String feature) in D:\Users\Richard\Garsonix\projects\Noggin Box\Orchard0.8full\src\Orchard\Data\Migration\DataMigrationManager.cs:line 121
   at Orchard.Data.Migration.DataMigrationCoordinator.Install(Feature feature) in D:\Users\Richard\Garsonix\projects\Noggin Box\Orchard0.8full\src\Orchard\Data\Migration\DataMigrationCoordinator.cs:line 26
   --- End of inner exception stack trace ---
   at System.RuntimeMethodHandle._InvokeMethodFast(IRuntimeMethodInfo method, Object target, Object[] arguments, SignatureStruct& sig, MethodAttributes methodAttributes, RuntimeType typeOwner)
   at System.RuntimeMethodHandle.InvokeMethodFast(IRuntimeMethodInfo method, Object target, Object[] arguments, Signature sig, MethodAttributes methodAttributes, RuntimeType typeOwner)
   at System.Reflection.RuntimeMethodInfo.Invoke(Object obj, BindingFlags invokeAttr, Binder binder, Object[] parameters, CultureInfo culture, Boolean skipVisibilityChecks)
   at System.Reflection.RuntimeMethodInfo.Invoke(Object obj, BindingFlags invokeAttr, Binder binder, Object[] parameters, CultureInfo culture)
   at System.Reflection.MethodBase.Invoke(Object obj, Object[] parameters)
   at Orchard.Events.DefaultOrchardEventBus.TryInvokeMethod(IEventHandler eventHandler, Type interfaceType, String methodName, IDictionary`2 arguments, IEnumerable& returnValue) in D:\Users\Richard\Garsonix\projects\Noggin Box\Orchard0.8full\src\Orchard\Events\DefaultOrchardEventBus.cs:line 82
   at Orchard.Events.DefaultOrchardEventBus.TryInvoke(IEventHandler eventHandler, String interfaceName, String methodName, IDictionary`2 arguments, IEnumerable& returnValue) in D:\Users\Richard\Garsonix\projects\Noggin Box\Orchard0.8full\src\Orchard\Events\DefaultOrchardEventBus.cs:line 68
   at Orchard.Events.DefaultOrchardEventBus.TryNotifyHandler(IEventHandler eventHandler, String messageName, String interfaceName, String methodName, IDictionary`2 eventData, IEnumerable& returnValue) in D:\Users\Richard\Garsonix\projects\Noggin Box\Orchard0.8full\src\Orchard\Events\DefaultOrchardEventBus.cs:line 51
Orchard.Data.SessionLocator Information: 0 : Openning database session
Orchard.Data.SessionLocator Information: 0 : Openning database session
Orchard.Data.SessionLocator Information: 0 : Openning database session
Orchard.Data.SessionLocator Information: 0 : Openning database session

Oct 30, 2010 at 9:47 PM

I think I've just seen the problem.

System.ArgumentException: Dialect does not support DbType.UInt16

I'll try changing my data type.

Oct 30, 2010 at 10:05 PM
Edited Oct 30, 2010 at 10:06 PM

I changed it to DbType.UInt32 and it doesn't like that either.

 

Oct 30, 2010 at 10:13 PM
Edited Oct 30, 2010 at 10:14 PM

Problem solved!

You can't use unsigned Data types. So DBType.Int16 was the way to go.

Thanks for your help Sebastien. Couldn't have fixed without knowing how to generate the log file.