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

Can not delete entity if id is UUID #777

Closed
qUser13 opened this issue Apr 4, 2023 · 4 comments
Closed

Can not delete entity if id is UUID #777

qUser13 opened this issue Apr 4, 2023 · 4 comments
Labels
type: regression A regression from a previous release
Milestone

Comments

@qUser13
Copy link

qUser13 commented Apr 4, 2023

I use org.springframework.vault:spring-vault-core:3.0.2 and have faced an issue that if entity uses UUID as key then it can not be deleted.
The exception -

org.springframework.data.keyvalue.core.UncategorizedKeyValueException: class java.util.UUID cannot be cast to class java.lang.String (java.util.UUID and java.lang.String are in module java.base of loader 'bootstrap')
	at org.springframework.data.keyvalue.core.KeyValuePersistenceExceptionTranslator.translateExceptionIfPossible(KeyValuePersistenceExceptionTranslator.java:51)
	at org.springframework.data.keyvalue.core.KeyValueTemplate.resolveExceptionIfPossible(KeyValueTemplate.java:405)
	at org.springframework.data.keyvalue.core.KeyValueTemplate.execute(KeyValueTemplate.java:316)
	at org.springframework.data.keyvalue.core.KeyValueTemplate.delete(KeyValueTemplate.java:293)
	at org.springframework.data.keyvalue.repository.support.SimpleKeyValueRepository.deleteById(SimpleKeyValueRepository.java:133)
	at java.base/jdk.internal.reflect.DirectMethodHandleAccessor.invoke(DirectMethodHandleAccessor.java:104)
	at java.base/java.lang.reflect.Method.invoke(Method.java:578)
...
Caused by: java.lang.ClassCastException: class java.util.UUID cannot be cast to class java.lang.String (java.util.UUID and java.lang.String are in module java.base of loader 'bootstrap')
	at org.springframework.vault.repository.convert.SecretDocumentAccessor.put(SecretDocumentAccessor.java:86)
	at org.springframework.vault.repository.convert.MappingVaultConverter.writeInternal(MappingVaultConverter.java:420)
	at org.springframework.vault.repository.convert.MappingVaultConverter.writeInternal(MappingVaultConverter.java:406)
	at org.springframework.vault.repository.convert.MappingVaultConverter.write(MappingVaultConverter.java:368)
	at org.springframework.vault.repository.convert.MappingVaultConverter.write(MappingVaultConverter.java:57)
	at org.springframework.vault.repository.core.VaultKeyValueAdapter.deleteEntity(VaultKeyValueAdapter.java:145)
	at org.springframework.vault.repository.core.VaultKeyValueAdapter.delete(VaultKeyValueAdapter.java:139)```


@mp911de mp911de added the type: bug A general bug label Apr 6, 2023
@mp911de
Copy link
Member

mp911de commented Apr 6, 2023

We should apply a converter to convert identifiers to String and vice versa.

@adamzr
Copy link

adamzr commented Apr 10, 2023

Note: This is a regression. It worked in previous versions. This is blocking the Spring Boot 3 upgrade for us.

@mp911de mp911de added type: regression A regression from a previous release and removed type: bug A general bug labels Apr 11, 2023
@mp911de mp911de added this to the 3.0.3 milestone Apr 19, 2023
mp911de added a commit that referenced this issue Apr 19, 2023
We now properly convert the identifier value into String before writing it to SecretDocument.

Closes gh-777
@qUser13
Copy link
Author

qUser13 commented Jun 13, 2023

@mp911de could you give us ETA for release with this fix? It is blocking Spring Boot 3 upgrade for us.

@mp911de
Copy link
Member

mp911de commented Jun 13, 2023

I've scheduled a release for next week Monday.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type: regression A regression from a previous release
Projects
None yet
Development

No branches or pull requests

3 participants