Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
LonghornTaco opened this issue Oct 16, 2015 · 8 comments
Open

Comments

@LonghornTaco
Copy link

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?

@object
Copy link
Owner

object commented Oct 16, 2015

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.

@LonghornTaco
Copy link
Author

Looks like it's failing on the Lease property:

image

Viewing with Robomongo:
image

@object
Copy link
Owner

object commented Oct 17, 2015

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

@LonghornTaco
Copy link
Author

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

https://db.tt/SvN1qH6x

@object
Copy link
Owner

object commented Oct 19, 2015

Thanks, I will have a look at it.

@LonghornTaco
Copy link
Author

Any luck?

@object
Copy link
Owner

object commented Nov 1, 2015

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
Copy link
Owner

object commented Nov 29, 2015

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants