MongOData icon indicating copy to clipboard operation
MongOData copied to clipboard

The specified type for the complex property is not a complex type.

Open LonghornTaco opened this issue 9 years ago • 8 comments

When I connect to one of my Mongo databases, I get this error when trying to call the data service: image

Here's the stack trace: at DataServiceProvider.DSPMetadata.AddComplexProperty(ResourceType resourceType, String name, ResourceType complexType) at Mongo.Context.MongoMetadataCache.AddComplexProperty(ResourceType resourceType, String propertyName, ResourceType propertyType) at Mongo.Context.MongoMetadata.AddDocumentProperty(MongoContext context, String collectionName, ResourceType collectionType, String propertyName, BsonElement element, Boolean isCollection) at Mongo.Context.MongoMetadata.AddResourceProperty(MongoContext context, String collectionName, ResourceType collectionType, BsonElement element, Boolean treatObjectIdAsKey) at Mongo.Context.MongoMetadata.RegisterResourceProperty(MongoContext context, ResourceType resourceType, BsonElement element) at Mongo.Context.MongoMetadata.RegisterDocumentProperty(MongoContext context, ResourceType resourceType, BsonElement element) at Mongo.Context.MongoMetadata.UpdateResourceSet(MongoContext context, ResourceSet resourceSet, BsonDocument document) at Mongo.Context.MongoMetadata.PopulateMetadataFromCollection(MongoContext context, String collectionName, ResourceSet resourceSet) at Mongo.Context.MongoMetadata.PopulateMetadata(MongoContext context) at Mongo.Context.MongoMetadata..ctor(String connectionString, Metadata metadata) at Mongo.Context.MongoDataServiceBase2.<.ctor>b__1(String x) at Mongo.Context.MongoDataServiceBase2..ctor(String connectionString, MongoConfiguration mongoConfiguration) at Mongo.Context.Queryable.MongoQueryableDataService..ctor(String connectionString, MongoConfiguration mongoConfiguration) at MongODataTest.MongoDataService..ctor() in c:\Projects\Sandbox\MongODataTest\MongODataTest\MongoDataService.cs:line 12 at CreateMongODataTest.MongoDataService() at System.ServiceModel.Dispatcher.InstanceProvider.GetInstance(InstanceContext instanceContext, Message message) at System.ServiceModel.Dispatcher.InstanceBehavior.GetInstance(InstanceContext instanceContext, Message request) at System.ServiceModel.InstanceContext.GetServiceInstance(Message message) at System.ServiceModel.Dispatcher.InstanceBehavior.EnsureServiceInstance(MessageRpc& rpc) at System.ServiceModel.Dispatcher.ImmutableDispatchRuntime.ProcessMessage41(MessageRpc& rpc) at System.ServiceModel.Dispatcher.ImmutableDispatchRuntime.ProcessMessage4(MessageRpc& rpc) at System.ServiceModel.Dispatcher.ImmutableDispatchRuntime.ProcessMessage31(MessageRpc& rpc) at System.ServiceModel.Dispatcher.ImmutableDispatchRuntime.ProcessMessage3(MessageRpc& rpc) at System.ServiceModel.Dispatcher.ImmutableDispatchRuntime.ProcessMessage2(MessageRpc& rpc) at System.ServiceModel.Dispatcher.ImmutableDispatchRuntime.ProcessMessage11(MessageRpc& rpc) at System.ServiceModel.Dispatcher.ImmutableDispatchRuntime.ProcessMessage1(MessageRpc& rpc) at System.ServiceModel.Dispatcher.MessageRpc.Process(Boolean isOperationContextSet)

I was able to connect to a different database, but the one I want the most throws this error.

Thoughts?

LonghornTaco avatar Oct 16 '15 05:10 LonghornTaco

Hi, Here's the code that raises the exception:

if (complexType.ResourceTypeKind != ResourceTypeKind.ComplexType) { throw new ArgumentException("The specified type for the complex property is not a complex type."); }

It's hard to say what kind of data might cause this but perhaps you can debug it find out.

object avatar Oct 16 '15 06:10 object

Looks like it's failing on the Lease property:

image

Viewing with Robomongo: image

LonghornTaco avatar Oct 16 '15 22:10 LonghornTaco

Do you have a small database that you can share so I could try to reproduce the issue?

object avatar Oct 17 '15 05:10 object

Here's a mongodump of the database and collection I'm trying to get data from.

https://db.tt/SvN1qH6x

LonghornTaco avatar Oct 17 '15 16:10 LonghornTaco

Thanks, I will have a look at it.

object avatar Oct 19 '15 06:10 object

Any luck?

LonghornTaco avatar Oct 29 '15 22:10 LonghornTaco

Sorry, didn't have time to investigate yet (was busywith work and other open source project). Hope to check this out in the next few days.

object avatar Nov 01 '15 06:11 object

Hello again, I believed the issue is fixed now, pushed in the package 1.3.0. Please have check it out.

object avatar Nov 29 '15 14:11 object