[SOLVED] Validation Error Message Failing

I’m submitting a…

[ ] Regression (a behavior that topped working in a new release)
[x] Bug report
[ ] Performance issue
[ ] Documentation issue or request

Current behavior

When validation exceptions occur, the message is not always displayed. It will return the error message one time, and Failed to make request another (message/details in response are empty).

Expected behavior

Message is always returned.

Minimal reproduction of the problem

Easy way to see this is to add a number field to schema, and set Range to be Min=1 and Max=0 (or 1, but that is another question on why they can not be equal).
Click save several times, the message will go back and forth from actual error to failed to make request.

Environment

  • [x] Self hosted with version docker
  • [ ] Self hosted with IIS
  • [ ] Self hosted with other version
  • [x] Cloud version

Browser:

  • [x] Chrome (desktop)
  • [ ] Chrome (Android)
  • [ ] Chrome (iOS)
  • [ ] Firefox
  • [ ] Safari (desktop)
  • [ ] Safari (iOS)
  • [ ] IE
  • [ ] Edge

Others:
I believe this is a clustering issue. I can recreate this in our environment as well, however, I can not recreate it locally, and also can not recreate it when running on only 1 node. I think the issue happens from calling Func message() potentially when the grain was picked up by a different node? We were able to prevent the error by not calling message() (used “test message” instead), so it seems that is the culprit.

Why should the func be an issue? It is not async, just a simple call.

I wouldn’t expect it to be a problem either. But not calling it seems to make the errors return consistently. Possibly misleading that it changed the behavior?

I can reproduce it, very strange. Which line do you mean exactly?

Well we found the issue dealing with creating content. That line specifically was https://github.com/Squidex/squidex/blob/b27840be950d4882a7763403b3838f96d1339bc3/src/Squidex.Domain.Apps.Core.Operations/ValidateContent/ContentValidationExtensions.cs#L40

Haven’t dug into the Field validation specifically. It has the same behavior though.

Have you seen another kind of exception in the logs in these cases?

No, that is the tough part to track down. No errors thrown in the logs. Didn’t see any Orleans messages that stood out either.

I think the implementation of the exceptions is wrong because Orleans falls back to BinaryFormatter for exceptions

Check out this commit please: https://github.com/Squidex/squidex/commit/b2001e6c7bb25242913b82b29dc6bada319a300e

Was hoping you understood how Orleans was handling that better than me! Testing out changes now.

It works! Appreciate the quick fix! And I have not forgot about submitting a testimonial, it is on my todo list.

Great :slight_smile: … Have to publish it immediately