javax.validation.ValidationException: HV000028: Unexpected exception during isValid call.

Atlassian JIRA | Radosław Antoniuk | 2 years ago
  1. 0

    Steps to reproduce: 1. Go into user settings 2. Find a user and go to SSH keys tab 3. Try to paste in an SSH public key with a couple of spaces in the middle. 2014-08-13 10:20:41,501 ERROR [http-bio-7990-exec-4] @QB1BG0x620x117677x0 108aiad 95.175.4.101,127.0.0.1 "POST /mvc/error500 HTTP/1.1" c.a.s. i.web.ErrorPageController There was an unhandled exception loading [/stash/plugins/servlet/ssh/admin/users/zzz.xxxx/keys/add] javax.validation.ValidationException: HV000028: Unexpected exception during isValid call. at org.hibernate.validator.internal.engine.ConstraintTree.validateSingleConstraint(ConstraintTree.java:311) ~[hibernate-validator-4.3 .1.Final.jar:4.3.1.Final] at org.hibernate.validator.internal.engine.ConstraintTree.validateConstraints(ConstraintTree.java:180) ~[hibernate-validator-4.3.1.Fi nal.jar:4.3.1.Final] at org.hibernate.validator.internal.engine.ConstraintTree.validateConstraints(ConstraintTree.java:124) ~[hibernate-validator-4.3.1.Fi nal.jar:4.3.1.Final] at org.hibernate.validator.internal.metadata.core.MetaConstraint.validateConstraint(MetaConstraint.java:86) ~[hibernate-validator-4.3 .1.Final.jar:4.3.1.Final] at org.hibernate.validator.internal.engine.ValidatorImpl.validateConstraint(ValidatorImpl.java:442) ~[hibernate-validator-4.3.1.Final .jar:4.3.1.Final] at org.hibernate.validator.internal.engine.ValidatorImpl.validateConstraintsForDefaultGroup(ValidatorImpl.java:387) ~[hibernate-valid ator-4.3.1.Final.jar:4.3.1.Final] at org.hibernate.validator.internal.engine.ValidatorImpl.validateConstraintsForCurrentGroup(ValidatorImpl.java:351) ~[hibernate-valid ator-4.3.1.Final.jar:4.3.1.Final] at org.hibernate.validator.internal.engine.ValidatorImpl.validateInContext(ValidatorImpl.java:303) ~[hibernate-validator-4.3.1.Final. jar:4.3.1.Final] at org.hibernate.validator.internal.engine.ValidatorImpl.validate(ValidatorImpl.java:133) ~[hibernate-validator-4.3.1.Final.jar:4.3.1 .Final] at org.springframework.validation.beanvalidation.SpringValidatorAdapter.validate(SpringValidatorAdapter.java:208) ~[spring-context-4. 0.5.RELEASE.jar:4.0.5.RELEASE] at com.atlassian.stash.util.ValidationUtils.validate(ValidationUtils.java:33) ~[stash-util-3.2.0.jar:na] at com.atlassian.stash.internal.key.ssh.DefaultSshKeyService.internalAddForUser(DefaultSshKeyService.java:293) ~[na:na] at com.atlassian.stash.internal.key.ssh.DefaultSshKeyService.addForUser(DefaultSshKeyService.java:78) ~[na:na] at com.atlassian.stash.internal.ssh.servlet.AddKeyRequestHandler.post(AddKeyRequestHandler.java:103) ~[na:na] at com.atlassian.stash.internal.ssh.servlet.SshKeysController.doPost(SshKeysController.java:111) ~[na:na] at com.atlassian.stash.internal.ssh.servlet.SshKeysController.service(SshKeysController.java:122) ~[na:na] at com.atlassian.applinks.core.rest.context.ContextFilter.doFilter(ContextFilter.java:25) ~[na:na] at com.atlassian.stash.internal.spring.security.StashAuthenticationFilter.doFilter(StashAuthenticationFilter.java:86) ~[StashAuthenti cationFilter.class:na] at com.atlassian.stash.internal.web.auth.BeforeLoginPluginAuthenticationFilter.doInsideSpringSecurityChain(BeforeLoginPluginAuthentic ationFilter.java:111) ~[BeforeLoginPluginAuthenticationFilter.class:na] at com.atlassian.stash.internal.web.auth.BeforeLoginPluginAuthenticationFilter.doFilter(BeforeLoginPluginAuthenticationFilter.java:77 ) ~[BeforeLoginPluginAuthenticationFilter.class:na] at com.atlassian.security.auth.trustedapps.filter.TrustedApplicationsFilter.doFilter(TrustedApplicationsFilter.java:100) ~[atlassian- trusted-apps-core-3.0.6.jar:na] at com.atlassian.oauth.serviceprovider.internal.servlet.OAuthFilter.doFilter(OAuthFilter.java:69) ~[na:na] at com.atlassian.analytics.client.filter.DefaultAnalyticsFilter.doFilter(DefaultAnalyticsFilter.java:33) ~[na:na] at com.atlassian.core.filters.AbstractHttpFilter.doFilter(AbstractHttpFilter.java:31) ~[atlassian-core-4.6.15.jar:na] at com.atlassian.stash.internal.web.auth.BeforeLoginPluginAuthenticationFilter.doBeforeBeforeLoginFilters(BeforeLoginPluginAuthentica tionFilter.java:89) ~[BeforeLoginPluginAuthenticationFilter.class:na] at com.atlassian.stash.internal.web.auth.BeforeLoginPluginAuthenticationFilter.doFilter(BeforeLoginPluginAuthenticationFilter.java:75 ) ~[BeforeLoginPluginAuthenticationFilter.class:na] at com.atlassian.stash.internal.request.DefaultRequestManager.doAsRequest(DefaultRequestManager.java:84) ~[stash-service-impl-3.2.0.j ar:na] at com.hazelcast.web.WebFilter.doFilter(WebFilter.java:446) ~[hazelcast-wm-3.3-RC2.jar:3.3-RC2] at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145) [na:1.7.0_51] at java.lang.Thread.run(Thread.java:744) [na:1.7.0_51] ... 209 frames trimmed Caused by: java.lang.RuntimeException: java.io.EOFException: Length to read: 257 actual: 146 at com.atlassian.stash.ssh.utils.KeyUtils$SimpleDataReader.readBytes(KeyUtils.java:193) ~[na:na] at com.atlassian.stash.ssh.utils.KeyUtils$SimpleDataReader.readBigInteger(KeyUtils.java:202) ~[na:na] at com.atlassian.stash.ssh.utils.KeyUtils$SimpleDataReader.access$300(KeyUtils.java:175) ~[na:na] at com.atlassian.stash.ssh.utils.KeyUtils$RSAKeySpecDecoder.getSpec(KeyUtils.java:151) ~[na:na] at com.atlassian.stash.ssh.utils.KeyUtils$RSAKeySpecDecoder.getSpec(KeyUtils.java:141) ~[na:na] at com.atlassian.stash.ssh.utils.KeyUtils.decodePublicKey(KeyUtils.java:111) ~[na:na] at com.atlassian.stash.ssh.utils.KeyUtils.getPublicKey(KeyUtils.java:68) ~[na:na] at com.atlassian.stash.ssh.validation.PublicKeyValidator.isValid(PublicKeyValidator.java:19) ~[na:na] at com.atlassian.stash.ssh.validation.PublicKeyValidator.isValid(PublicKeyValidator.java:8) ~[na:na] at org.hibernate.validator.internal.engine.ConstraintTree.validateSingleConstraint(ConstraintTree.java:308) ~[hibernate-validator-4.3 .1.Final.jar:4.3.1.Final] ... 30 common frames omitted Caused by: java.io.EOFException: Length to read: 257 actual: 146 at org.apache.commons.io.IOUtils.readFully(IOUtils.java:2539) ~[commons-io-2.4.jar:2.4] at org.apache.commons.io.IOUtils.readFully(IOUtils.java:2558) ~[commons-io-2.4.jar:2.4] at com.atlassian.stash.ssh.utils.KeyUtils$SimpleDataReader.readBytes(KeyUtils.java:189) ~[na:na] ... 39 common frames omitted

    Atlassian JIRA | 2 years ago | Radosław Antoniuk
    javax.validation.ValidationException: HV000028: Unexpected exception during isValid call.
  2. 0

    Steps to reproduce: 1. Go into user settings 2. Find a user and go to SSH keys tab 3. Try to paste in an SSH public key with a couple of spaces in the middle. 2014-08-13 10:20:41,501 ERROR [http-bio-7990-exec-4] @QB1BG0x620x117677x0 108aiad 95.175.4.101,127.0.0.1 "POST /mvc/error500 HTTP/1.1" c.a.s. i.web.ErrorPageController There was an unhandled exception loading [/stash/plugins/servlet/ssh/admin/users/zzz.xxxx/keys/add] javax.validation.ValidationException: HV000028: Unexpected exception during isValid call. at org.hibernate.validator.internal.engine.ConstraintTree.validateSingleConstraint(ConstraintTree.java:311) ~[hibernate-validator-4.3 .1.Final.jar:4.3.1.Final] at org.hibernate.validator.internal.engine.ConstraintTree.validateConstraints(ConstraintTree.java:180) ~[hibernate-validator-4.3.1.Fi nal.jar:4.3.1.Final] at org.hibernate.validator.internal.engine.ConstraintTree.validateConstraints(ConstraintTree.java:124) ~[hibernate-validator-4.3.1.Fi nal.jar:4.3.1.Final] at org.hibernate.validator.internal.metadata.core.MetaConstraint.validateConstraint(MetaConstraint.java:86) ~[hibernate-validator-4.3 .1.Final.jar:4.3.1.Final] at org.hibernate.validator.internal.engine.ValidatorImpl.validateConstraint(ValidatorImpl.java:442) ~[hibernate-validator-4.3.1.Final .jar:4.3.1.Final] at org.hibernate.validator.internal.engine.ValidatorImpl.validateConstraintsForDefaultGroup(ValidatorImpl.java:387) ~[hibernate-valid ator-4.3.1.Final.jar:4.3.1.Final] at org.hibernate.validator.internal.engine.ValidatorImpl.validateConstraintsForCurrentGroup(ValidatorImpl.java:351) ~[hibernate-valid ator-4.3.1.Final.jar:4.3.1.Final] at org.hibernate.validator.internal.engine.ValidatorImpl.validateInContext(ValidatorImpl.java:303) ~[hibernate-validator-4.3.1.Final. jar:4.3.1.Final] at org.hibernate.validator.internal.engine.ValidatorImpl.validate(ValidatorImpl.java:133) ~[hibernate-validator-4.3.1.Final.jar:4.3.1 .Final] at org.springframework.validation.beanvalidation.SpringValidatorAdapter.validate(SpringValidatorAdapter.java:208) ~[spring-context-4. 0.5.RELEASE.jar:4.0.5.RELEASE] at com.atlassian.stash.util.ValidationUtils.validate(ValidationUtils.java:33) ~[stash-util-3.2.0.jar:na] at com.atlassian.stash.internal.key.ssh.DefaultSshKeyService.internalAddForUser(DefaultSshKeyService.java:293) ~[na:na] at com.atlassian.stash.internal.key.ssh.DefaultSshKeyService.addForUser(DefaultSshKeyService.java:78) ~[na:na] at com.atlassian.stash.internal.ssh.servlet.AddKeyRequestHandler.post(AddKeyRequestHandler.java:103) ~[na:na] at com.atlassian.stash.internal.ssh.servlet.SshKeysController.doPost(SshKeysController.java:111) ~[na:na] at com.atlassian.stash.internal.ssh.servlet.SshKeysController.service(SshKeysController.java:122) ~[na:na] at com.atlassian.applinks.core.rest.context.ContextFilter.doFilter(ContextFilter.java:25) ~[na:na] at com.atlassian.stash.internal.spring.security.StashAuthenticationFilter.doFilter(StashAuthenticationFilter.java:86) ~[StashAuthenti cationFilter.class:na] at com.atlassian.stash.internal.web.auth.BeforeLoginPluginAuthenticationFilter.doInsideSpringSecurityChain(BeforeLoginPluginAuthentic ationFilter.java:111) ~[BeforeLoginPluginAuthenticationFilter.class:na] at com.atlassian.stash.internal.web.auth.BeforeLoginPluginAuthenticationFilter.doFilter(BeforeLoginPluginAuthenticationFilter.java:77 ) ~[BeforeLoginPluginAuthenticationFilter.class:na] at com.atlassian.security.auth.trustedapps.filter.TrustedApplicationsFilter.doFilter(TrustedApplicationsFilter.java:100) ~[atlassian- trusted-apps-core-3.0.6.jar:na] at com.atlassian.oauth.serviceprovider.internal.servlet.OAuthFilter.doFilter(OAuthFilter.java:69) ~[na:na] at com.atlassian.analytics.client.filter.DefaultAnalyticsFilter.doFilter(DefaultAnalyticsFilter.java:33) ~[na:na] at com.atlassian.core.filters.AbstractHttpFilter.doFilter(AbstractHttpFilter.java:31) ~[atlassian-core-4.6.15.jar:na] at com.atlassian.stash.internal.web.auth.BeforeLoginPluginAuthenticationFilter.doBeforeBeforeLoginFilters(BeforeLoginPluginAuthentica tionFilter.java:89) ~[BeforeLoginPluginAuthenticationFilter.class:na] at com.atlassian.stash.internal.web.auth.BeforeLoginPluginAuthenticationFilter.doFilter(BeforeLoginPluginAuthenticationFilter.java:75 ) ~[BeforeLoginPluginAuthenticationFilter.class:na] at com.atlassian.stash.internal.request.DefaultRequestManager.doAsRequest(DefaultRequestManager.java:84) ~[stash-service-impl-3.2.0.j ar:na] at com.hazelcast.web.WebFilter.doFilter(WebFilter.java:446) ~[hazelcast-wm-3.3-RC2.jar:3.3-RC2] at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145) [na:1.7.0_51] at java.lang.Thread.run(Thread.java:744) [na:1.7.0_51] ... 209 frames trimmed Caused by: java.lang.RuntimeException: java.io.EOFException: Length to read: 257 actual: 146 at com.atlassian.stash.ssh.utils.KeyUtils$SimpleDataReader.readBytes(KeyUtils.java:193) ~[na:na] at com.atlassian.stash.ssh.utils.KeyUtils$SimpleDataReader.readBigInteger(KeyUtils.java:202) ~[na:na] at com.atlassian.stash.ssh.utils.KeyUtils$SimpleDataReader.access$300(KeyUtils.java:175) ~[na:na] at com.atlassian.stash.ssh.utils.KeyUtils$RSAKeySpecDecoder.getSpec(KeyUtils.java:151) ~[na:na] at com.atlassian.stash.ssh.utils.KeyUtils$RSAKeySpecDecoder.getSpec(KeyUtils.java:141) ~[na:na] at com.atlassian.stash.ssh.utils.KeyUtils.decodePublicKey(KeyUtils.java:111) ~[na:na] at com.atlassian.stash.ssh.utils.KeyUtils.getPublicKey(KeyUtils.java:68) ~[na:na] at com.atlassian.stash.ssh.validation.PublicKeyValidator.isValid(PublicKeyValidator.java:19) ~[na:na] at com.atlassian.stash.ssh.validation.PublicKeyValidator.isValid(PublicKeyValidator.java:8) ~[na:na] at org.hibernate.validator.internal.engine.ConstraintTree.validateSingleConstraint(ConstraintTree.java:308) ~[hibernate-validator-4.3 .1.Final.jar:4.3.1.Final] ... 30 common frames omitted Caused by: java.io.EOFException: Length to read: 257 actual: 146 at org.apache.commons.io.IOUtils.readFully(IOUtils.java:2539) ~[commons-io-2.4.jar:2.4] at org.apache.commons.io.IOUtils.readFully(IOUtils.java:2558) ~[commons-io-2.4.jar:2.4] at com.atlassian.stash.ssh.utils.KeyUtils$SimpleDataReader.readBytes(KeyUtils.java:189) ~[na:na] ... 39 common frames omitted

    Atlassian JIRA | 2 years ago | Radosław Antoniuk
    javax.validation.ValidationException: HV000028: Unexpected exception during isValid call.
  3. 0

    Spring ApplicationContext with AJAX call

    Stack Overflow | 3 years ago | user1482309
    javax.validation.ValidationException: HV000028: Unexpected exception during isValid call.
  4. Speed up your debug routine!

    Automated exception search integrated into your IDE

  5. 0

    I have the following validation rules defined in an interface: {code} @NotNull @DecimalMax(value= "90.0") @DecimalMin(value= "-90.0") Double getLatitude(); {code} In my tests, I also pass unexpected values such as {{Double.NAN}} or {{Double.POSITIVE_INFINITY}}. This triggers an exception: {noformat} javax.validation.ValidationException: HV000028: Unexpected exception during isValid call. at org.hibernate.validator.internal.engine.constraintvalidation.ConstraintTree.validateSingleConstraint(ConstraintTree.java:286) at org.hibernate.validator.internal.engine.constraintvalidation.ConstraintTree.validateConstraints(ConstraintTree.java:133) at org.hibernate.validator.internal.engine.constraintvalidation.ConstraintTree.validateConstraints(ConstraintTree.java:91) at org.hibernate.validator.internal.metadata.core.MetaConstraint.validateConstraint(MetaConstraint.java:83) at org.hibernate.validator.internal.engine.ValidatorImpl.validateConstraint(ValidatorImpl.java:547) at org.hibernate.validator.internal.engine.ValidatorImpl.validateConstraintsForDefaultGroup(ValidatorImpl.java:487) at org.hibernate.validator.internal.engine.ValidatorImpl.validateConstraintsForCurrentGroup(ValidatorImpl.java:451) at org.hibernate.validator.internal.engine.ValidatorImpl.validateInContext(ValidatorImpl.java:403) at org.hibernate.validator.internal.engine.ValidatorImpl.validate(ValidatorImpl.java:206) {noformat} The exception is caused by the call to {{BigDecimal.valueOf(double val)}} in {{org.hibernate.validator.internal.constraintvalidators.bv.DecimalMaxValidatorForNumber}}, which throws an exception if val is infinite or NaN. The issue can be reproduced using the attached project.

    Hibernate JIRA | 2 years ago | Xavier Sosnovsky
    javax.validation.ValidationException: HV000028: Unexpected exception during isValid call.
  6. 0

    I have the following validation rules defined in an interface: {code} @NotNull @DecimalMax(value= "90.0") @DecimalMin(value= "-90.0") Double getLatitude(); {code} In my tests, I also pass unexpected values such as {{Double.NAN}} or {{Double.POSITIVE_INFINITY}}. This triggers an exception: {noformat} javax.validation.ValidationException: HV000028: Unexpected exception during isValid call. at org.hibernate.validator.internal.engine.constraintvalidation.ConstraintTree.validateSingleConstraint(ConstraintTree.java:286) at org.hibernate.validator.internal.engine.constraintvalidation.ConstraintTree.validateConstraints(ConstraintTree.java:133) at org.hibernate.validator.internal.engine.constraintvalidation.ConstraintTree.validateConstraints(ConstraintTree.java:91) at org.hibernate.validator.internal.metadata.core.MetaConstraint.validateConstraint(MetaConstraint.java:83) at org.hibernate.validator.internal.engine.ValidatorImpl.validateConstraint(ValidatorImpl.java:547) at org.hibernate.validator.internal.engine.ValidatorImpl.validateConstraintsForDefaultGroup(ValidatorImpl.java:487) at org.hibernate.validator.internal.engine.ValidatorImpl.validateConstraintsForCurrentGroup(ValidatorImpl.java:451) at org.hibernate.validator.internal.engine.ValidatorImpl.validateInContext(ValidatorImpl.java:403) at org.hibernate.validator.internal.engine.ValidatorImpl.validate(ValidatorImpl.java:206) {noformat} The exception is caused by the call to {{BigDecimal.valueOf(double val)}} in {{org.hibernate.validator.internal.constraintvalidators.bv.DecimalMaxValidatorForNumber}}, which throws an exception if val is infinite or NaN. The issue can be reproduced using the attached project.

    Hibernate JIRA | 2 years ago | Xavier Sosnovsky
    javax.validation.ValidationException: HV000028: Unexpected exception during isValid call.

    4 unregistered visitors
    Not finding the right solution?
    Take a tour to get the most out of Samebug.

    Tired of useless tips?

    Automated exception search integrated into your IDE

    Root Cause Analysis

    1. javax.validation.ValidationException

      HV000028: Unexpected exception during isValid call.

      at org.hibernate.validator.internal.engine.ConstraintTree.validateSingleConstraint()
    2. Hibernate Validator Engine
      ValidatorImpl.validate
      1. org.hibernate.validator.internal.engine.ConstraintTree.validateSingleConstraint(ConstraintTree.java:311)[hibernate-validator-4.3 .1.Final.jar:4.3.1.Final]
      2. org.hibernate.validator.internal.engine.ConstraintTree.validateConstraints(ConstraintTree.java:180)[hibernate-validator-4.3.1.Fi nal.jar:4.3.1.Final]
      3. org.hibernate.validator.internal.engine.ConstraintTree.validateConstraints(ConstraintTree.java:124)[hibernate-validator-4.3.1.Fi nal.jar:4.3.1.Final]
      4. org.hibernate.validator.internal.metadata.core.MetaConstraint.validateConstraint(MetaConstraint.java:86)[hibernate-validator-4.3 .1.Final.jar:4.3.1.Final]
      5. org.hibernate.validator.internal.engine.ValidatorImpl.validateConstraint(ValidatorImpl.java:442)[hibernate-validator-4.3.1.Final .jar:4.3.1.Final]
      6. org.hibernate.validator.internal.engine.ValidatorImpl.validateConstraintsForDefaultGroup(ValidatorImpl.java:387)[hibernate-valid ator-4.3.1.Final.jar:4.3.1.Final]
      7. org.hibernate.validator.internal.engine.ValidatorImpl.validateConstraintsForCurrentGroup(ValidatorImpl.java:351)[hibernate-valid ator-4.3.1.Final.jar:4.3.1.Final]
      8. org.hibernate.validator.internal.engine.ValidatorImpl.validateInContext(ValidatorImpl.java:303)[hibernate-validator-4.3.1.Final. jar:4.3.1.Final]
      9. org.hibernate.validator.internal.engine.ValidatorImpl.validate(ValidatorImpl.java:133)[hibernate-validator-4.3.1.Final.jar:4.3.1 .Final]
      9 frames
    3. Spring Context
      SpringValidatorAdapter.validate
      1. org.springframework.validation.beanvalidation.SpringValidatorAdapter.validate(SpringValidatorAdapter.java:208)[spring-context-4. 0.5.RELEASE.jar:4.0.5.RELEASE]
      1 frame
    4. com.atlassian.stash
      SshKeysController.service
      1. com.atlassian.stash.util.ValidationUtils.validate(ValidationUtils.java:33)[stash-util-3.2.0.jar:na]
      2. com.atlassian.stash.internal.key.ssh.DefaultSshKeyService.internalAddForUser(DefaultSshKeyService.java:293)[na:na]
      3. com.atlassian.stash.internal.key.ssh.DefaultSshKeyService.addForUser(DefaultSshKeyService.java:78)[na:na]
      4. com.atlassian.stash.internal.ssh.servlet.AddKeyRequestHandler.post(AddKeyRequestHandler.java:103)[na:na]
      5. com.atlassian.stash.internal.ssh.servlet.SshKeysController.doPost(SshKeysController.java:111)[na:na]
      6. com.atlassian.stash.internal.ssh.servlet.SshKeysController.service(SshKeysController.java:122)[na:na]
      6 frames
    5. com.atlassian.applinks
      ContextFilter.doFilter
      1. com.atlassian.applinks.core.rest.context.ContextFilter.doFilter(ContextFilter.java:25)[na:na]
      1 frame
    6. com.atlassian.stash
      StashAuthenticationFilter.doFilter
      1. com.atlassian.stash.internal.spring.security.StashAuthenticationFilter.doFilter(StashAuthenticationFilter.java:86)[StashAuthenti cationFilter.class:na]
      1 frame