kamax-matrix / mxisd

Federated Matrix Identity Server
GNU Affero General Public License v3.0
220 stars 112 forks source link

Properties configuration failed validation for session.validation #160

Closed vioBF closed 5 years ago

vioBF commented 5 years ago

Hello,

I recently set up the mxisd server by installing the Debian package. Now I wanted to test how I can edit the e-mail templates using this doc. However, I always get an error when I start the server. As soon as I delete the line with "validation" the server starts normally. Is this a known problem or do I just act stupid?

My configuration for the corresponding section:

threepid:
  medium:
    email:
      generators:
        template:
          invite: "/etc/mxisd/invite-template.eml"
          session:
            validation: "/etc/mxisd/validate-template.eml"
            unbind:
              fraudulent: "/etc/mxisd/fraudulent-template.eml"
          generic:
            matrixId: "/etc/mxisd/matrixId-template.eml"

The syslog looks like this:

Apr 17 09:38:08 matrix mxisd[21166]: .620  INFO [           main]     i.k.m.c.t.c.EmailSendGridConfig : --- Email SendGrid connector config ---
Apr 17 09:38:08 matrix mxisd[21166]: .624  INFO [           main]     i.k.m.c.t.c.EmailSendGridConfig : API key configured?: false
Apr 17 09:38:08 matrix mxisd[21166]: .627  INFO [           main]     i.k.m.c.t.c.EmailSendGridConfig : Identity: {"from":"","name":""}
Apr 17 09:38:08 matrix mxisd[21166]: .628  INFO [           main]     i.k.m.c.t.c.EmailSendGridConfig : Templates: {"invite":{"subject":"","body":{"text":"","html":""}},"session":{"local":{"body":{}},"remote":{"body":{}}}}
Apr 17 09:38:09 matrix mxisd[21166]: .228  INFO [           main]     i.k.m.c.t.m.EmailTemplateConfig : --- SMS Generator templates config ---
Apr 17 09:38:09 matrix mxisd[21166]: .232  INFO [           main]     i.k.m.c.t.m.EmailTemplateConfig : Invite: Built-in (threepids/sms/invite-template.txt)
Apr 17 09:38:09 matrix mxisd[21166]: .233  INFO [           main]     i.k.m.c.t.m.EmailTemplateConfig : Session validation:
Apr 17 09:38:09 matrix mxisd[21166]: .233  INFO [           main]     i.k.m.c.t.m.EmailTemplateConfig : #011Local: Built-in (threepids/sms/validate-local-template.txt)
Apr 17 09:38:09 matrix mxisd[21166]: .237  INFO [           main]     i.k.m.c.t.m.EmailTemplateConfig : #011Remote: Built-in (threepids/sms/validate-remote-template.txt)
Apr 17 09:38:09 matrix mxisd[21166]: .281  INFO [           main]        i.k.m.c.t.medium.PhoneConfig : --- Phone config ---
Apr 17 09:38:09 matrix mxisd[21166]: .282  INFO [           main]        i.k.m.c.t.medium.PhoneConfig : Generator: template
Apr 17 09:38:09 matrix mxisd[21166]: .283  INFO [           main]        i.k.m.c.t.medium.PhoneConfig : Connector: twilio
Apr 17 09:38:09 matrix mxisd[21166]: .350 ERROR [           main] .b.b.PropertiesConfigurationFactory : Properties configuration failed validation
Apr 17 09:38:09 matrix mxisd[21166]: .351 ERROR [           main] .b.b.PropertiesConfigurationFactory : Field error in object 'threepid.medium.email.generators.template' on field 'session.validation': rejected value [/etc/mxisd/validate-template.eml]; codes [typeMismatch.threepid.medium.email.generators.template.session.validation,typeMismatch.session.validation,typeMismatch.validation,typeMismatch.io.kamax.mxisd.config.threepid.medium.GenericTemplateConfig$Session$SessionValidation,typeMismatch]; arguments [org.springframework.context.support.DefaultMessageSourceResolvable: codes [threepid.medium.email.generators.template.session.validation,session.validation]; arguments []; default message [session.validation]]; default message [Failed to convert property value of type 'java.lang.String' to required type 'io.kamax.mxisd.config.threepid.medium.GenericTemplateConfig$Session$SessionValidation' for property 'session.validation'; nested exception is java.lang.IllegalStateException: Cannot convert value of type 'java.lang.String' to required type 'io.kamax.mxisd.config.threepid.medium.GenericTemplateConfig$Session$SessionValidation' for property 'validation': no matching editors or conversion strategy found]
Apr 17 09:38:09 matrix mxisd[21166]: .353  WARN [           main] ConfigEmbeddedWebApplicationContext : Exception encountered during context initialization - cancelling refresh attempt: org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'emailNotificationGenerator' defined in URL [jar:file:/usr/lib/mxisd/mxisd.jar!/BOOT-INF/classes!/io/kamax/mxisd/threepid/notification/email/EmailNotificationGenerator.class]: Unsatisfied dependency expressed through constructor parameter 0; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'emailTemplateConfig': Could not bind properties to EmailTemplateConfig (prefix=threepid.medium.email.generators.template, ignoreInvalidFields=false, ignoreUnknownFields=true, ignoreNestedProperties=false); nested exception is org.springframework.validation.BindException: org.springframework.boot.bind.RelaxedDataBinder$RelaxedBeanPropertyBindingResult: 1 errors
Apr 17 09:38:09 matrix mxisd[21166]: Field error in object 'threepid.medium.email.generators.template' on field 'session.validation': rejected value [/etc/mxisd/validate-template.eml]; codes [typeMismatch.threepid.medium.email.generators.template.session.validation,typeMismatch.session.validation,typeMismatch.validation,typeMismatch.io.kamax.mxisd.config.threepid.medium.GenericTemplateConfig$Session$SessionValidation,typeMismatch]; arguments [org.springframework.context.support.DefaultMessageSourceResolvable: codes [threepid.medium.email.generators.template.session.validation,session.validation]; arguments []; default message [session.validation]]; default message [Failed to convert property value of type 'java.lang.String' to required type 'io.kamax.mxisd.config.threepid.medium.GenericTemplateConfig$Session$SessionValidation' for property 'session.validation'; nested exception is java.lang.IllegalStateException: Cannot convert value of type 'java.lang.String' to required type 'io.kamax.mxisd.config.threepid.medium.GenericTemplateConfig$Session$SessionValidation' for property 'validation': no matching editors or conversion strategy found]
Apr 17 09:38:09 matrix mxisd[21166]: .399 ERROR [           main] .b.d.LoggingFailureAnalysisReporter :
Apr 17 09:38:09 matrix mxisd[21166]: ***************************
Apr 17 09:38:09 matrix mxisd[21166]: APPLICATION FAILED TO START
Apr 17 09:38:09 matrix mxisd[21166]: ***************************
Apr 17 09:38:09 matrix mxisd[21166]: Description:
Apr 17 09:38:09 matrix mxisd[21166]: Binding to target io.kamax.mxisd.config.threepid.medium.EmailTemplateConfig$$EnhancerBySpringCGLIB$$57c2f6e7@74589991 failed:
Apr 17 09:38:09 matrix mxisd[21166]:     Property: threepid.medium.email.generators.template.session.validation
Apr 17 09:38:09 matrix mxisd[21166]:     Value: /etc/mxisd/validate-template.eml
Apr 17 09:38:09 matrix mxisd[21166]:     Reason: Failed to convert property value of type 'java.lang.String' to required type 'io.kamax.mxisd.config.threepid.medium.GenericTemplateConfig$Session$SessionValidation' for property 'session.validation'; nested exception is java.lang.IllegalStateException: Cannot convert value of type 'java.lang.String' to required type 'io.kamax.mxisd.config.threepid.medium.GenericTemplateConfig$Session$SessionValidation' for property 'validation': no matching editors or conversion strategy found
Apr 17 09:38:09 matrix mxisd[21166]: Action:
Apr 17 09:38:09 matrix mxisd[21166]: Update your application's configuration
Apr 17 09:38:09 matrix systemd[1]: mxisd.service: Main process exited, code=exited, status=1/FAILURE
Apr 17 09:38:09 matrix systemd[1]: mxisd.service: Unit entered failed state.
Apr 17 09:38:09 matrix systemd[1]: mxisd.service: Failed with result 'exit-code'.
maxidorius commented 5 years ago

You are trying to use the documentation of a newer version than what you have installed. Either update mxisd or read the docs at the corresponding tag.

vioBF commented 5 years ago

Thanks for your answer. The update fixed it.