syndesisio / syndesis-verifier

Syndesis Verifier Service
Apache License 2.0
2 stars 8 forks source link

Connection with invalid creds lead to an "internal error" #43

Closed zregvart closed 7 years ago

zregvart commented 7 years ago

@rhuss commented on Wed Oct 11 2017

When using a Salesforce connection with invalid configuration the UI presents this error:

image

This originates from the verifier which has this error:

error trace ``` org.jboss.resteasy.spi.UnhandledException: java.lang.IllegalStateException: Unable to fetch and process metadata   | at org.jboss.resteasy.core.ExceptionHandler.handleApplicationException(ExceptionHandler.java:78) ~[resteasy-jaxrs-3.1.0.Final.jar!/:3.1.0.Final]   | at org.jboss.resteasy.core.ExceptionHandler.handleException(ExceptionHandler.java:222) ~[resteasy-jaxrs-3.1.0.Final.jar!/:3.1.0.Final]   | at org.jboss.resteasy.core.SynchronousDispatcher.writeException(SynchronousDispatcher.java:171) ~[resteasy-jaxrs-3.1.0.Final.jar!/:3.1.0.Final]   | at org.jboss.resteasy.core.SynchronousDispatcher.invoke(SynchronousDispatcher.java:414) ~[resteasy-jaxrs-3.1.0.Final.jar!/:3.1.0.Final]   | at org.jboss.resteasy.core.SynchronousDispatcher.invoke(SynchronousDispatcher.java:205) ~[resteasy-jaxrs-3.1.0.Final.jar!/:3.1.0.Final]   | at org.jboss.resteasy.plugins.server.servlet.ServletContainerDispatcher.service(ServletContainerDispatcher.java:221) ~[resteasy-jaxrs-3.1.0.Final.jar!/:3.1.0.Final]   | at org.jboss.resteasy.plugins.server.servlet.HttpServletDispatcher.service(HttpServletDispatcher.java:56) ~[resteasy-jaxrs-3.1.0.Final.jar!/:3.1.0.Final]   | at org.jboss.resteasy.plugins.server.servlet.HttpServletDispatcher.service(HttpServletDispatcher.java:51) ~[resteasy-jaxrs-3.1.0.Final.jar!/:3.1.0.Final]   | at javax.servlet.http.HttpServlet.service(HttpServlet.java:790) ~[javax.servlet-api-3.1.0.jar!/:3.1.0]   | at io.undertow.servlet.handlers.ServletHandler.handleRequest(ServletHandler.java:85) ~[undertow-servlet-1.4.11.Final.jar!/:1.4.11.Final]   | at io.undertow.servlet.handlers.FilterHandler$FilterChainImpl.doFilter(FilterHandler.java:129) ~[undertow-servlet-1.4.11.Final.jar!/:1.4.11.Final]   | at org.springframework.boot.web.filter.ApplicationContextHeaderFilter.doFilterInternal(ApplicationContextHeaderFilter.java:55) ~[spring-boot-1.5.2.RELEASE.jar!/:1.5.2.RELEASE]   | at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:107) ~[spring-web-4.3.7.RELEASE.jar!/:4.3.7.RELEASE]   | at io.undertow.servlet.core.ManagedFilter.doFilter(ManagedFilter.java:61) ~[undertow-servlet-1.4.11.Final.jar!/:1.4.11.Final]   | at io.undertow.servlet.handlers.FilterHandler$FilterChainImpl.doFilter(FilterHandler.java:131) ~[undertow-servlet-1.4.11.Final.jar!/:1.4.11.Final]   | at org.springframework.boot.actuate.trace.WebRequestTraceFilter.doFilterInternal(WebRequestTraceFilter.java:108) ~[spring-boot-actuator-1.5.2.RELEASE.jar!/:1.5.2.RELEASE]   | at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:107) ~[spring-web-4.3.7.RELEASE.jar!/:4.3.7.RELEASE]   | at io.undertow.servlet.core.ManagedFilter.doFilter(ManagedFilter.java:61) ~[undertow-servlet-1.4.11.Final.jar!/:1.4.11.Final]   | at io.undertow.servlet.handlers.FilterHandler$FilterChainImpl.doFilter(FilterHandler.java:131) ~[undertow-servlet-1.4.11.Final.jar!/:1.4.11.Final]   | at org.springframework.web.filter.RequestContextFilter.doFilterInternal(RequestContextFilter.java:99) ~[spring-web-4.3.7.RELEASE.jar!/:4.3.7.RELEASE]   | at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:107) ~[spring-web-4.3.7.RELEASE.jar!/:4.3.7.RELEASE]   | at io.undertow.servlet.core.ManagedFilter.doFilter(ManagedFilter.java:61) ~[undertow-servlet-1.4.11.Final.jar!/:1.4.11.Final]   | at io.undertow.servlet.handlers.FilterHandler$FilterChainImpl.doFilter(FilterHandler.java:131) ~[undertow-servlet-1.4.11.Final.jar!/:1.4.11.Final]   | at org.springframework.web.filter.HttpPutFormContentFilter.doFilterInternal(HttpPutFormContentFilter.java:105) ~[spring-web-4.3.7.RELEASE.jar!/:4.3.7.RELEASE]   | at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:107) ~[spring-web-4.3.7.RELEASE.jar!/:4.3.7.RELEASE]   | at io.undertow.servlet.core.ManagedFilter.doFilter(ManagedFilter.java:61) ~[undertow-servlet-1.4.11.Final.jar!/:1.4.11.Final]   | at io.undertow.servlet.handlers.FilterHandler$FilterChainImpl.doFilter(FilterHandler.java:131) ~[undertow-servlet-1.4.11.Final.jar!/:1.4.11.Final]   | at org.springframework.web.filter.HiddenHttpMethodFilter.doFilterInternal(HiddenHttpMethodFilter.java:81) ~[spring-web-4.3.7.RELEASE.jar!/:4.3.7.RELEASE]   | at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:107) ~[spring-web-4.3.7.RELEASE.jar!/:4.3.7.RELEASE]   | at io.undertow.servlet.core.ManagedFilter.doFilter(ManagedFilter.java:61) ~[undertow-servlet-1.4.11.Final.jar!/:1.4.11.Final]   | at io.undertow.servlet.handlers.FilterHandler$FilterChainImpl.doFilter(FilterHandler.java:131) ~[undertow-servlet-1.4.11.Final.jar!/:1.4.11.Final]   | at org.springframework.web.filter.CharacterEncodingFilter.doFilterInternal(CharacterEncodingFilter.java:197) ~[spring-web-4.3.7.RELEASE.jar!/:4.3.7.RELEASE]   | at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:107) ~[spring-web-4.3.7.RELEASE.jar!/:4.3.7.RELEASE]   | at io.undertow.servlet.core.ManagedFilter.doFilter(ManagedFilter.java:61) ~[undertow-servlet-1.4.11.Final.jar!/:1.4.11.Final]   | at io.undertow.servlet.handlers.FilterHandler$FilterChainImpl.doFilter(FilterHandler.java:131) ~[undertow-servlet-1.4.11.Final.jar!/:1.4.11.Final]   | at org.springframework.boot.actuate.autoconfigure.MetricsFilter.doFilterInternal(MetricsFilter.java:106) ~[spring-boot-actuator-1.5.2.RELEASE.jar!/:1.5.2.RELEASE]   | at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:107) ~[spring-web-4.3.7.RELEASE.jar!/:4.3.7.RELEASE]   | at io.undertow.servlet.core.ManagedFilter.doFilter(ManagedFilter.java:61) ~[undertow-servlet-1.4.11.Final.jar!/:1.4.11.Final]   | at io.undertow.servlet.handlers.FilterHandler$FilterChainImpl.doFilter(FilterHandler.java:131) ~[undertow-servlet-1.4.11.Final.jar!/:1.4.11.Final]   | at io.undertow.servlet.handlers.FilterHandler.handleRequest(FilterHandler.java:84) ~[undertow-servlet-1.4.11.Final.jar!/:1.4.11.Final]   | at io.undertow.servlet.handlers.security.ServletSecurityRoleHandler.handleRequest(ServletSecurityRoleHandler.java:62) ~[undertow-servlet-1.4.11.Final.jar!/:1.4.11.Final]   | at io.undertow.servlet.handlers.ServletDispatchingHandler.handleRequest(ServletDispatchingHandler.java:36) ~[undertow-servlet-1.4.11.Final.jar!/:1.4.11.Final]   | at io.undertow.servlet.handlers.security.SSLInformationAssociationHandler.handleRequest(SSLInformationAssociationHandler.java:131) ~[undertow-servlet-1.4.11.Final.jar!/:1.4.11.Final]   | at io.undertow.servlet.handlers.security.ServletAuthenticationCallHandler.handleRequest(ServletAuthenticationCallHandler.java:57) ~[undertow-servlet-1.4.11.Final.jar!/:1.4.11.Final]   | at io.undertow.server.handlers.PredicateHandler.handleRequest(PredicateHandler.java:43) ~[undertow-core-1.4.11.Final.jar!/:1.4.11.Final]   | at io.undertow.security.handlers.AbstractConfidentialityHandler.handleRequest(AbstractConfidentialityHandler.java:46) ~[undertow-core-1.4.11.Final.jar!/:1.4.11.Final]   | at io.undertow.servlet.handlers.security.ServletConfidentialityConstraintHandler.handleRequest(ServletConfidentialityConstraintHandler.java:64) ~[undertow-servlet-1.4.11.Final.jar!/:1.4.11.Final]   | at io.undertow.security.handlers.AuthenticationMechanismsHandler.handleRequest(AuthenticationMechanismsHandler.java:60) ~[undertow-core-1.4.11.Final.jar!/:1.4.11.Final]   | at io.undertow.servlet.handlers.security.CachedAuthenticatedSessionHandler.handleRequest(CachedAuthenticatedSessionHandler.java:77) ~[undertow-servlet-1.4.11.Final.jar!/:1.4.11.Final]   | at io.undertow.security.handlers.AbstractSecurityContextAssociationHandler.handleRequest(AbstractSecurityContextAssociationHandler.java:43) ~[undertow-core-1.4.11.Final.jar!/:1.4.11.Final]   | at io.undertow.server.handlers.PredicateHandler.handleRequest(PredicateHandler.java:43) ~[undertow-core-1.4.11.Final.jar!/:1.4.11.Final]   | at io.undertow.server.handlers.PredicateHandler.handleRequest(PredicateHandler.java:43) ~[undertow-core-1.4.11.Final.jar!/:1.4.11.Final]   | at io.undertow.servlet.handlers.ServletInitialHandler.handleFirstRequest(ServletInitialHandler.java:292) ~[undertow-servlet-1.4.11.Final.jar!/:1.4.11.Final]   | at io.undertow.servlet.handlers.ServletInitialHandler.access$100(ServletInitialHandler.java:81) ~[undertow-servlet-1.4.11.Final.jar!/:1.4.11.Final]   | at io.undertow.servlet.handlers.ServletInitialHandler$2.call(ServletInitialHandler.java:138) ~[undertow-servlet-1.4.11.Final.jar!/:1.4.11.Final]   | at io.undertow.servlet.handlers.ServletInitialHandler$2.call(ServletInitialHandler.java:135) ~[undertow-servlet-1.4.11.Final.jar!/:1.4.11.Final]   | at io.undertow.servlet.core.ServletRequestContextThreadSetupAction$1.call(ServletRequestContextThreadSetupAction.java:48) [undertow-servlet-1.4.11.Final.jar!/:1.4.11.Final]   | at io.undertow.servlet.core.ContextClassLoaderSetupAction$1.call(ContextClassLoaderSetupAction.java:43) [undertow-servlet-1.4.11.Final.jar!/:1.4.11.Final]   | at io.undertow.servlet.handlers.ServletInitialHandler.dispatchRequest(ServletInitialHandler.java:272) ~[undertow-servlet-1.4.11.Final.jar!/:1.4.11.Final]   | at io.undertow.servlet.handlers.ServletInitialHandler.access$000(ServletInitialHandler.java:81) ~[undertow-servlet-1.4.11.Final.jar!/:1.4.11.Final]   | at io.undertow.servlet.handlers.ServletInitialHandler$1.handleRequest(ServletInitialHandler.java:104) [undertow-servlet-1.4.11.Final.jar!/:1.4.11.Final]   | at io.undertow.server.Connectors.executeRootHandler(Connectors.java:211) [undertow-core-1.4.11.Final.jar!/:1.4.11.Final]   | at io.undertow.server.HttpServerExchange$1.run(HttpServerExchange.java:809) [undertow-core-1.4.11.Final.jar!/:1.4.11.Final]   | at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142) [na:1.8.0_111]   | at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617) [na:1.8.0_111]   | at java.lang.Thread.run(Thread.java:745) [na:1.8.0_111]   | Caused by: java.lang.IllegalStateException: Unable to fetch and process metadata   | at io.syndesis.verifier.v1.MetadataEndpoint.fetchMetadata(MetadataEndpoint.java:67) ~[classes!/:na]   | at io.syndesis.verifier.v1.ActionDefinitionEndpoint.definition(ActionDefinitionEndpoint.java:43) ~[classes!/:na]   | at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[na:1.8.0_111]   | at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) ~[na:1.8.0_111]   | at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) ~[na:1.8.0_111]   | at java.lang.reflect.Method.invoke(Method.java:498) ~[na:1.8.0_111]   | at org.jboss.resteasy.core.MethodInjectorImpl.invoke(MethodInjectorImpl.java:140) ~[resteasy-jaxrs-3.1.0.Final.jar!/:3.1.0.Final]   | at org.jboss.resteasy.core.ResourceMethodInvoker.invokeOnTarget(ResourceMethodInvoker.java:294) ~[resteasy-jaxrs-3.1.0.Final.jar!/:3.1.0.Final]   | at org.jboss.resteasy.core.ResourceMethodInvoker.invoke(ResourceMethodInvoker.java:248) ~[resteasy-jaxrs-3.1.0.Final.jar!/:3.1.0.Final]   | at org.jboss.resteasy.core.ResourceLocatorInvoker.invokeOnTargetObject(ResourceLocatorInvoker.java:138) ~[resteasy-jaxrs-3.1.0.Final.jar!/:3.1.0.Final]   | at org.jboss.resteasy.core.ResourceLocatorInvoker.invoke(ResourceLocatorInvoker.java:101) ~[resteasy-jaxrs-3.1.0.Final.jar!/:3.1.0.Final]   | at org.jboss.resteasy.core.SynchronousDispatcher.invoke(SynchronousDispatcher.java:398) ~[resteasy-jaxrs-3.1.0.Final.jar!/:3.1.0.Final]   | ... 62 common frames omitted   | Caused by: org.apache.camel.RuntimeCamelException: java.lang.IllegalArgumentException: The provided authentication configuration can be used in multiple ways for instance both with username/password and refresh_token. Either remove some of the configuration options, so that authentication method can be auto-determined or explicitly set the authentication type.   | at org.apache.camel.util.ObjectHelper.wrapRuntimeCamelException(ObjectHelper.java:1828) ~[camel-core-2.20.0.fuse-000101.jar!/:2.20.0.fuse-000101]   | at org.apache.camel.component.salesforce.SalesforceMetaDataExtension.schemaFor(SalesforceMetaDataExtension.java:73) ~[camel-salesforce-2.20.0.fuse-000101.jar!/:2.20.0.fuse-000101]   | at org.apache.camel.component.salesforce.SalesforceMetaDataExtension.meta(SalesforceMetaDataExtension.java:51) ~[camel-salesforce-2.20.0.fuse-000101.jar!/:2.20.0.fuse-000101]   | at io.syndesis.verifier.v1.MetadataEndpoint.fetchMetadata(MetadataEndpoint.java:59) ~[classes!/:na]   | ... 73 common frames omitted   | Caused by: java.lang.IllegalArgumentException: The provided authentication configuration can be used in multiple ways for instance both with username/password and refresh_token. Either remove some of the configuration options, so that authentication method can be auto-determined or explicitly set the authentication type.   | at org.apache.camel.component.salesforce.SalesforceLoginConfig.getType(SalesforceLoginConfig.java:162) ~[camel-salesforce-2.20.0.fuse-000101.jar!/:2.20.0.fuse-000101]   | at org.apache.camel.component.salesforce.SalesforceLoginConfig.validate(SalesforceLoginConfig.java:217) ~[camel-salesforce-2.20.0.fuse-000101.jar!/:2.20.0.fuse-000101]   | at org.apache.camel.component.salesforce.internal.SalesforceSession.(SalesforceSession.java:94) ~[camel-salesforce-2.20.0.fuse-000101.jar!/:2.20.0.fuse-000101]   | at org.apache.camel.component.salesforce.SalesforceComponent.createRestClient(SalesforceComponent.java:687) ~[camel-salesforce-2.20.0.fuse-000101.jar!/:2.20.0.fuse-000101]   | at org.apache.camel.component.salesforce.SalesforceClientTemplate.lambda$static$0(SalesforceClientTemplate.java:39) ~[camel-salesforce-2.20.0.fuse-000101.jar!/:2.20.0.fuse-000101]   | at org.apache.camel.component.salesforce.SalesforceClientTemplate.invoke(SalesforceClientTemplate.java:48) ~[camel-salesforce-2.20.0.fuse-000101.jar!/:2.20.0.fuse-000101]   | at org.apache.camel.component.salesforce.SalesforceMetaDataExtension.allObjectsSchema(SalesforceMetaDataExtension.java:62) ~[camel-salesforce-2.20.0.fuse-000101.jar!/:2.20.0.fuse-000101]   | at org.apache.camel.component.salesforce.SalesforceMetaDataExtension.schemaFor(SalesforceMetaDataExtension.java:71) ~[camel-salesforce-2.20.0.fuse-000101.jar!/:2.20.0.fuse-000101]   | ... 75 common frames omitted   ```

Leading to a 500 error in syndesis-rest.

Thinking again, its probably more an issue for syndesis-verifier, or ?


@zregvart commented on Wed Oct 11 2017

Thinking again, its probably more an issue for syndesis-verifier, or ?

I think so, we should handle exceptions in the verifier and just return error JSONs.

zregvart commented 7 years ago

With #46 and https://github.com/syndesisio/syndesis-rest/pull/702 the new error message should look like:

screenshot from 2017-10-12 14-08-20

rhuss commented 7 years ago

much better, thanks !