Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

HTTP 500 when trying to filter vulnerabilities by tag #2994

Open
0x6675636b796f75676974687562 opened this issue Nov 11, 2024 · 0 comments
Open
Labels
bug Something isn't working good first issue Good for newcomers

Comments

@0x6675636b796f75676974687562
Copy link
Member

0x6675636b796f75676974687562 commented Nov 11, 2024

Example URL: http://localhost:8081/vuln/list?tag=AlmaLinux:8.

The UI displays the "Nothing was found" label:

image

THe back-end responds with HTTP 500 at http://localhost:5700/api/v1/vulnerabilities/by-filter?page=0&size=7 (POST) for the following payload:

{"statuses":["APPROVED","AUTO_APPROVED"],"tags":["AlmaLinux:8"]}

Stack trace:

18:24:22.553 [boundedElastic-1058] ERROR o.s.b.a.w.r.e.AbstractErrorWebExceptionHandler - [86e3a5a7-213]  500 Server Error for HTTP POST "/api/v1/vulnerabilities/by-filter?page=0&size=7" org.springframework.dao.InvalidDataAccessApiUsageException: Unable to locate Attribute  with the the given name [tag] on this ManagedType [com.saveourtool.common.spring.entity.BaseEntity]; nested exception is java.lang.IllegalArgumentException: Unable to locate Attribute  with the the given name [tag] on this ManagedType [com.saveourtool.common.spring.entity.BaseEntity]
	at org.springframework.orm.jpa.EntityManagerFactoryUtils.convertJpaAccessExceptionIfPossible(EntityManagerFactoryUtils.java:374)
	Suppressed: reactor.core.publisher.FluxOnAssembly$OnAssemblyException: 
Error has been observed at the following site(s):
	*__checkpoint ⇢ Handler com.saveourtool.cosv.backend.controllers.VulnerabilityController#getAllVulnerabilities(int, int, VulnerabilityFilter, Authentication) [DispatcherHandler]
	*__checkpoint ⇢ org.springframework.security.web.server.authentication.AuthenticationWebFilter [DefaultWebFilterChain]
	*__checkpoint ⇢ org.springframework.security.web.server.authorization.AuthorizationWebFilter [DefaultWebFilterChain]
	*__checkpoint ⇢ org.springframework.security.web.server.authorization.ExceptionTranslationWebFilter [DefaultWebFilterChain]
	*__checkpoint ⇢ org.springframework.security.web.server.savedrequest.ServerRequestCacheWebFilter [DefaultWebFilterChain]
	*__checkpoint ⇢ org.springframework.security.web.server.context.SecurityContextServerWebExchangeWebFilter [DefaultWebFilterChain]
	*__checkpoint ⇢ org.springframework.security.web.server.authentication.AuthenticationWebFilter [DefaultWebFilterChain]
	*__checkpoint ⇢ org.springframework.security.web.server.context.ReactorContextWebFilter [DefaultWebFilterChain]
	*__checkpoint ⇢ org.springframework.security.web.server.header.HttpHeaderWriterWebFilter [DefaultWebFilterChain]
	*__checkpoint ⇢ org.springframework.security.config.web.server.ServerHttpSecurity$ServerWebExchangeReactorContextWebFilter [DefaultWebFilterChain]
	*__checkpoint ⇢ org.springframework.security.web.server.WebFilterChainProxy [DefaultWebFilterChain]
	*__checkpoint ⇢ org.springframework.boot.actuate.metrics.web.reactive.server.MetricsWebFilter [DefaultWebFilterChain]
	*__checkpoint ⇢ HTTP POST "/api/v1/vulnerabilities/by-filter?page=0&size=7" [ExceptionHandlingWebHandler]
Original Stack Trace:
		at org.springframework.orm.jpa.EntityManagerFactoryUtils.convertJpaAccessExceptionIfPossible(EntityManagerFactoryUtils.java:374)
		at org.springframework.orm.jpa.vendor.HibernateJpaDialect.translateExceptionIfPossible(HibernateJpaDialect.java:235)
		at org.springframework.orm.jpa.AbstractEntityManagerFactoryBean.translateExceptionIfPossible(AbstractEntityManagerFactoryBean.java:551)
		at org.springframework.dao.support.ChainedPersistenceExceptionTranslator.translateExceptionIfPossible(ChainedPersistenceExceptionTranslator.java:61)
		at org.springframework.dao.support.DataAccessUtils.translateIfNecessary(DataAccessUtils.java:243)
Caused by: java.lang.IllegalArgumentException: Unable to locate Attribute  with the the given name [tag] on this ManagedType [com.saveourtool.common.spring.entity.BaseEntity]
	at org.hibernate.metamodel.model.domain.internal.AbstractManagedType.checkNotNull(AbstractManagedType.java:148)
	at org.hibernate.metamodel.model.domain.internal.AbstractManagedType.getAttribute(AbstractManagedType.java:119)
	at org.hibernate.metamodel.model.domain.internal.AbstractManagedType.getAttribute(AbstractManagedType.java:117)
	at org.hibernate.metamodel.model.domain.internal.AbstractManagedType.getAttribute(AbstractManagedType.java:44)
	at org.hibernate.query.criteria.internal.path.AbstractFromImpl.locateAttributeInternal(AbstractFromImpl.java:111)
@0x6675636b796f75676974687562 0x6675636b796f75676974687562 added bug Something isn't working good first issue Good for newcomers labels Nov 11, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working good first issue Good for newcomers
Projects
None yet
Development

No branches or pull requests

1 participant