Skip to content

HTTP 500 when trying to filter vulnerabilities by tag #2994

@0x6675636b796f75676974687562

Description

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)

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't workinggood first issueGood for newcomers

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions