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

EntityAlreadyExistsException AssignDs to target #1660

Open
meladon1337 opened this issue Feb 21, 2024 · 1 comment
Open

EntityAlreadyExistsException AssignDs to target #1660

meladon1337 opened this issue Feb 21, 2024 · 1 comment

Comments

@meladon1337
Copy link

I have Hawkbit running with a Azure SQL Database connected.
When i call the Target API with:

curl --location 'https://URL/rest/v1/targets/TARGET_ID/assignedDS'
--header 'Content-Type: application/json'
--header 'Authorization: Basic TOKEN'
--data '[
{
"id": ID
}
]'

I get the following error. I dont see any problems in the Database and the error does not help.
{
"exceptionClass": "org.eclipse.hawkbit.repository.exception.EntityAlreadyExistsException",
"errorCode": "hawkbit.server.error.repo.entitiyAlreayExists",
"message": "The given entity already exists in database"
}

I also set the log to Trace, so i can see more output, but still not more detail:
Feb 15 14:55:09 java[1661112]: 2024-02-15 14:55:09.473 TRACE 1661112 --- [nio-8443-exec-3] o.s.t.i.TransactionInterceptor : Completing transaction for [org.eclipse.hawkbit.repository.jpa.management.JpaDeploymentManagement.assignDistributionSets]
Feb 15 14:55:09 java[1661112]: 2024-02-15 14:55:09.484 DEBUG 1661112 --- [nio-8443-exec-3] o.s.j.s.SQLStateSQLExceptionTranslator : Extracted SQL state class '23' from value '23000'
Feb 15 14:55:09 java[1661112]: 2024-02-15 14:55:09.485 DEBUG 1661112 --- [nio-8443-exec-3] .m.m.a.ExceptionHandlerExceptionResolver : Using @ExceptionHandler org.eclipse.hawkbit.rest.exception.ResponseExceptionHandler#handleSpServerRtExceptions(HttpServletRequest, Exception)
Feb 15 14:55:09 java[1661112]: 2024-02-15 14:55:09.485 TRACE 1661112 --- [nio-8443-exec-3] o.s.web.method.HandlerMethod : Arguments: [SecurityContextHolderAwareRequestWrapper[ org.springframework.security.web.header.HeaderWriterFilter$HeaderWriterRequest@268c859d], org.eclipse.hawkbit.repository.exception.EntityAlreadyExistsException: The given entity already exists in database]
Feb 15 14:55:09 java[1661112]: 2024-02-15 14:55:09.485 DEBUG 1661112 --- [nio-8443-exec-3] o.s.w.s.m.m.a.HttpEntityMethodProcessor : Using 'application/json', given [/] and supported [application/json, application/+json, application/json, application/+json, application/cbor]
Feb 15 14:55:09 java[1661112]: 2024-02-15 14:55:09.486 TRACE 1661112 --- [nio-8443-exec-3] o.s.w.s.m.m.a.HttpEntityMethodProcessor : Writing [org.eclipse.hawkbit.rest.json.model.ExceptionInfo@3bb3da5a]
Feb 15 14:55:09 java[1661112]: 2024-02-15 14:55:09.486 DEBUG 1661112 --- [nio-8443-exec-3] .m.m.a.ExceptionHandlerExceptionResolver : Resolved [org.eclipse.hawkbit.repository.exception.EntityAlreadyExistsException: The given entity already exists in database]
Feb 15 14:55:09 java[1661112]: 2024-02-15 14:55:09.486 TRACE 1661112 --- [nio-8443-exec-3] o.s.web.servlet.DispatcherServlet : No view rendering, null ModelAndView returned.
Feb 15 14:55:09 java[1661112]: 2024-02-15 14:55:09.487 DEBUG 1661112 --- [nio-8443-exec-3] o.j.s.OpenEntityManagerInViewInterceptor : Closing JPA EntityManager in OpenEntityManagerInViewInterceptor
Feb 15 14:55:09 java[1661112]: 2024-02-15 14:55:09.487 DEBUG 1661112 --- [nio-8443-exec-3] o.s.web.servlet.DispatcherServlet : Completed 409 CONFLICT, headers={}
Feb 15 14:55:09 java[1661112]: 2024-02-15 14:55:09.487 DEBUG 1661112 --- [nio-8443-exec-3] s.s.w.c.SecurityContextPersistenceFilter : Cleared SecurityContextHolder to complete request
Feb 15 14:55:09 java[1661112]: 2024-02-15 14:55:09.488 TRACE 1661112 --- [nio-8443-exec-3] o.s.b.w.s.f.OrderedRequestContextFilter : Cleared thread-bound request context: org.apache.catalina.connector.RequestFacade@28daa682
Feb 15 14:55:09 java[1661112]: 2024-02-15 14:55:09.488 DEBUG 1661112 --- [nio-8443-exec-3] o.a.tomcat.util.net.SocketWrapperBase : Socket: [org.apache.tomcat.util.net.NioEndpoint$NioSocketWrapper@98b6818:org.apache.tomcat.util.net.SecureNioChannel@4b23caf2:java.nio.channels.SocketChannel[connected local=/10.0.0.4:8443 remote=/87.153.114.212:53188]], Read from buffer: [0]
Feb 15 14:55:09 java[1661112]: 2024-02-15 14:55:09.488 DEBUG 1661112 --- [nio-8443-exec-3] org.apache.tomcat.util.net.NioEndpoint : Socket: [org.apache.tomcat.util.net.NioEndpoint$NioSocketWrapper@98b6818:org.apache.tomcat.util.net.SecureNioChannel@4b23caf2:java.nio.channels.SocketChannel[connected local=/10.0.0.4:8443 remote=/87.153.114.212:53188]], Read direct from socket: [0]

Any ideas?

@matkomilovich
Copy link

hi @meladon1337, were you able to solve it? I'm having the same issue and I'm not sure what it could be due to. I don't have any distribution set or rollout associated with the target (I created both with the Management API), but I still get the 409 error.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants