zalando-stups / fullstop

Audit reporting: collect violations across all AWS accounts
https://docs.stups.io/en/latest/components/fullstop.html
Apache License 2.0
40 stars 14 forks source link

types param not working #553

Closed patandrick closed 6 years ago

patandrick commented 6 years ago

Expected behavior

The endpoint /api/violations?types=WRONG_AMI&types=OUTDATED_TAUPAGE should return all violations with the specified types.

Exception

Response Code

500

Response Body

{ "timestamp": "2018-05-22T08:09:45Z", "status": 500, "error": "Internal Server Error", "exception": "org.springframework.dao.InvalidDataAccessApiUsageException", "message": "Parameter value element [null] did not match expected type [java.lang.String (n/a)]; nested excepti#va.lang.String (n/a)]", "path": "/api/violations" }

harti2006 commented 6 years ago

Exception Stacktrace:

ERROR [http-nio-8080-exec-15] o.a.c.c.C.[.[.[.[dispatcherServlet] - Servlet.service() for servlet [dispatcherServlet] in context with path [] threw exception [Request processing failed; nested exception is org.springframework.dao.InvalidDataAccessApiUsageException: Parameter value element [null] did not match expected type [java.lang.String (n/a)]; nested exception is java.lang.IllegalArgumentException: Parameter value element [null] did not match expected type [java.lang.String (n/a)]] with root cause
java.lang.IllegalArgumentException: Parameter value element [null] did not match expected type [java.lang.String (n/a)]
at org.hibernate.jpa.spi.BaseQueryImpl.validateCollectionValuedParameterBinding(BaseQueryImpl.java:920) ~[hibernate-entitymanager-5.0.12.Final.jar!/:5.0.12.Final]
at org.hibernate.jpa.spi.BaseQueryImpl.validateBinding(BaseQueryImpl.java:889) ~[hibernate-entitymanager-5.0.12.Final.jar!/:5.0.12.Final]
at org.hibernate.jpa.internal.QueryImpl.access$000(QueryImpl.java:61) ~[hibernate-entitymanager-5.0.12.Final.jar!/:5.0.12.Final]
at org.hibernate.jpa.internal.QueryImpl$ParameterRegistrationImpl.bindValue(QueryImpl.java:235) ~[hibernate-entitymanager-5.0.12.Final.jar!/:5.0.12.Final]
at org.hibernate.jpa.internal.QueryImpl$JpaPositionalParameterRegistrationImpl.bindValue(QueryImpl.java:371) ~[hibernate-entitymanager-5.0.12.Final.jar!/:5.0.12.Final]
at org.hibernate.jpa.spi.BaseQueryImpl.setParameter(BaseQueryImpl.java:692) ~[hibernate-entitymanager-5.0.12.Final.jar!/:5.0.12.Final]
at org.hibernate.jpa.spi.AbstractQueryImpl.setParameter(AbstractQueryImpl.java:181) ~[hibernate-entitymanager-5.0.12.Final.jar!/:5.0.12.Final]
at org.hibernate.jpa.spi.AbstractQueryImpl.setParameter(AbstractQueryImpl.java:32) ~[hibernate-entitymanager-5.0.12.Final.jar!/:5.0.12.Final]
at com.querydsl.jpa.impl.JPAUtil.setConstants(JPAUtil.java:56) ~[querydsl-jpa-4.1.4.jar!/:?]
at com.querydsl.jpa.impl.AbstractJPAQuery.createQuery(AbstractJPAQuery.java:102) ~[querydsl-jpa-4.1.4.jar!/:?]
at com.querydsl.jpa.impl.AbstractJPAQuery.fetchCount(AbstractJPAQuery.java:81) ~[querydsl-jpa-4.1.4.jar!/:?]
at org.zalando.stups.fullstop.violation.repository.impl.ViolationRepositoryImpl.queryViolations(ViolationRepositoryImpl.java:108) ~[fullstop-violation-jpa-1.2.0-SNAPSHOT.jar!/:?]
at org.zalando.stups.fullstop.violation.repository.impl.ViolationRepositoryImpl$$FastClassBySpringCGLIB$$80de5971.invoke(<generated>) ~[fullstop-violation-jpa-1.2.0-SNAPSHOT.jar!/:?]
at org.springframework.cglib.proxy.MethodProxy.invoke(MethodProxy.java:204) ~[spring-core-4.3.8.RELEASE.jar!/:4.3.8.RELEASE]
at org.springframework.aop.framework.CglibAopProxy$CglibMethodInvocation.invokeJoinpoint(CglibAopProxy.java:738) ~[spring-aop-4.3.8.RELEASE.jar!/:4.3.8.RELEASE]
at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:157) ~[spring-aop-4.3.8.RELEASE.jar!/:4.3.8.RELEASE]
at org.springframework.dao.support.PersistenceExceptionTranslationInterceptor.invoke(PersistenceExceptionTranslationInterceptor.java:136) ~[spring-tx-4.3.8.RELEASE.jar!/:4.3.8.RELEASE]
at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:179) ~[spring-aop-4.3.8.RELEASE.jar!/:4.3.8.RELEASE]
at org.springframework.aop.framework.CglibAopProxy$DynamicAdvisedInterceptor.intercept(CglibAopProxy.java:673) ~[spring-aop-4.3.8.RELEASE.jar!/:4.3.8.RELEASE]
at org.zalando.stups.fullstop.violation.repository.impl.ViolationRepositoryImpl$$EnhancerBySpringCGLIB$$ca2ee86d.queryViolations(<generated>) ~[fullstop-violation-jpa-1.2.0-SNAPSHOT.jar!/:?]
at sun.reflect.GeneratedMethodAccessor311.invoke(Unknown Source) ~[?:?]
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) ~[?:1.8.0_151]
at java.lang.reflect.Method.invoke(Method.java:498) ~[?:1.8.0_151]
...