-
Notifications
You must be signed in to change notification settings - Fork 473
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 property '{propertyname}' cannot be used in the $expand query option #2815
Comments
@mattkleiny Your service has the following configuration: config.Expand(QueryOptionSetting.Disabled); This line disables all $expand. Try to use: config.Expand(); |
Thanks for getting back to me @xuzhg. We need to selectively enable It will fail intermittently. Some requests do succeed and produce the correct response. Here's an example after just a few seconds of running, and I've updated the repro to more clearly show:
Debugging a little bit, it looks like WebApi/src/Microsoft.AspNet.OData.Shared/Query/Validators/SelectExpandQueryValidator.cs Lines 333 to 360 in 46d7ecb
I was tracing the source of this information back into |
Ok, It seems thread-safe problem and I already refactored it in our 8 version at OData/AspNetCoreOData#800. Do you mind to try our 8.x version? It's easy to update. If you need me to try, please share the 'write' permission to your GitHub repository. We have a plan to port back the changes from 8 to 7, but it needs time to finish it. |
Thanks @xuzhg! I've given you write access, if you'd like to try to update. I was under the impression that the ASP .NET Core version that you linked to would be incompatible with our old .NET Framework based app. It would be a much larger piece of work to migrate off of .NET Framework, of course. But if there's a way we can simply update to the 8.x package then that's great. |
Thanks @xuzhg for opening that PR. I see that the change involved is primarily about using an ASP.NET Core project? That would be great, but sadly we can't update our stack at this point. Hoping that the fix will get backported into the Web API library at some point. Should I leave this issue open until then? Others might have a similar problem. |
Periodically when querying the OData endpoints in one of our products, clients receive an unexpected 400 error stating:
The property '{propertyname}' cannot be used in the $expand query option
. This occurs on different entity sets.Normally, these properties are 'expandable' and work correctly. However, when the server is under load they start failing periodically with a 400 error.
Assemblies affected
Microsoft.AspNet.OData 7.7.2
Reproduce steps
.Expand()
option of allowed to those entity sets and those particular complex properties.Expected result
The response should be successful, and $expand as appropriate.
Actual result
The response will periodically fail with a 400 error stating that "The property '{propertyname}' cannot be used in the $expand query option".
Additional detail
Here's a repository reproducing the issue https://github.com/mattkleiny/odata-bug-repro
The text was updated successfully, but these errors were encountered: