CREATE AGGREGATE failed... [Build 23372]

Jul 27, 2012 at 3:21 PM
Edited Jul 27, 2012 at 3:23 PM

I was unable to get the compiled version to work properly, so I downloaded the source. Upon execution of the import I receive the following error (I'm using Windows Server 2008 on my local machine):

CREATE AGGREGATE failed because it could not not find type 'osm2mssql.DbExtensions.RelationBuilder' in assembly 'osm2mssql.OsmDb2008'.

CREATE AGGREGATE failed.

Configuration option 'show advanced options' changed from 1 to 1.

Run the RECONFIGURE statement to install.

Configuration option 'clr enabled' changed from 1 to 1. Run the RECONFIGURE statement to install. Changed database context to 'foo'. 

Any insight on what I could do to troubleshoot this a bit deeper, or is this a known issue? 

Cheers, 

Chris

Coordinator
Jul 27, 2012 at 3:59 PM
lkny wrote:

I was unable to get the compiled version to work properly, so I downloaded the source. Upon execution of the import I receive the following error (I'm using Windows Server 2008 on my local machine):

CREATE AGGREGATE failed because it could not not find type 'osm2mssql.DbExtensions.RelationBuilder' in assembly 'osm2mssql.OsmDb2008'.

CREATE AGGREGATE failed.

Configuration option 'show advanced options' changed from 1 to 1.

Run the RECONFIGURE statement to install.

Configuration option 'clr enabled' changed from 1 to 1. Run the RECONFIGURE statement to install. Changed database context to 'foo'. 

Any insight on what I could do to troubleshoot this a bit deeper, or is this a known issue? 

Cheers, 

Chris

Hi!

Do i assume right, that you are trying to use SQL Server 2008 R2 ?
I will have a look at it - maybe i have broken something. :-) 

greets

Christian

Jul 27, 2012 at 4:06 PM
Edited Jul 27, 2012 at 4:06 PM

My apologies for not specifying. I am using SQL Server 2008 R2. I appreciate your help!

Chris

Aug 3, 2012 at 2:31 PM
Edited Aug 3, 2012 at 2:48 PM

Just wanted to add a little more information. The exception occurs during the 'InstallExtensions' method of the database table creation when the sql command execution occurs (createExtensions).

Once we hit 'ExecuteSqlCmd' and cmd.ExecuteNonQuery with: cmd.CommandText = "exec sp_configure 'show advanced options', 1;\r\nRECONFIGURE;\r\nexec sp_configure 'clr enabled', 1;\r\nRECONFIGURE;\r\n\r\n\r\nuse testgeo;\r\n\r\ncreate assembly BuildLineString FROM 0x4D5A90000300000004000000FFFF0000B800000000000000400000000000000000000...

The exception is thrown:

(TaskBase:RunTask) Exception: System.Data.SqlClient.SqlException (0x80131904): CREATE AGGREGATE failed because it could not find type 'osm2mssql.DbExtensions.RelationBuilder' in assembly 'osm2mssql.OsmDb2008'.
CREATE AGGREGATE failed.
Configuration option 'show advanced options' changed from 1 to 1. Run the RECONFIGURE statement to install.
Configuration option 'clr enabled' changed from 1 to 1. Run the RECONFIGURE statement to install.
Changed database context to 'testgeo'.
   at System.Data.SqlClient.SqlConnection.OnError(SqlException exception, Boolean breakConnection)
   at System.Data.SqlClient.SqlInternalConnection.OnError(SqlException exception, Boolean breakConnection)
   at System.Data.SqlClient.TdsParser.ThrowExceptionAndWarning()
   at System.Data.SqlClient.TdsParser.Run(RunBehavior runBehavior, SqlCommand cmdHandler, SqlDataReader dataStream, BulkCopySimpleResultSet bulkCopyHandler, TdsParserStateObject stateObj)
   at System.Data.SqlClient.SqlCommand.RunExecuteNonQueryTds(String methodName, Boolean async)
   at System.Data.SqlClient.SqlCommand.InternalExecuteNonQuery(DbAsyncResult result, String methodName, Boolean sendToPipe)
   at System.Data.SqlClient.SqlCommand.ExecuteNonQuery()
   at osm2mssql.Importer.Tasks.TaskBase.ExecuteSqlCmd(String sqlCommand) in C:\Users\crussell\Documents\Visual Studio 2010\Projects\osm2mssql\osm2mssql.Importer\Tasks\TaskBase.cs:line 113
   at osm2mssql.Importer.Tasks.TaskCreateDatabase.InstallExtensions() in C:\Users\crussell\Documents\Visual Studio 2010\Projects\osm2mssql\osm2mssql.Importer\Tasks\TaskCreateDatabase.cs:line 61
   at osm2mssql.Importer.Tasks.TaskCreateDatabase.DoTaskWork(String osmFile) in C:\Users\crussell\Documents\Visual Studio 2010\Projects\osm2mssql\osm2mssql.Importer\Tasks\TaskCreateDatabase.cs:line 24
   at osm2mssql.Importer.Tasks.TaskBase.RunTask(SqlConnectionStringBuilder connection, String osmFile) in C:\Users\crussell\Documents\Visual Studio 2010\Projects\osm2mssql\osm2mssql.Importer\Tasks\TaskBase.cs:line 247
ClientConnectionId:41b3fd3a-0559-44d3-874b-59fa8521ef1b
Aug 3, 2012 at 3:41 PM

After reading the previous discussions I downloaded commit #19615 and the import appears to be working properly.