Closed ferozed closed 2 years ago
FYI... this does not happen in 1.5.0
version. So looks like something broke in 1.6.1
Hi @ferozed, could you check if any other dependency is pulling in protobuf (com.google.protobuf:protobuf-java)? Tink 1.6.1 requires com.google.protobuf:protobuf-java:3.14.0
No, there is no other dependency pulling in protobuf. I verified it using gradle dependencies
Added output of gradle dependencies
This is very weird then -- if you look at the error there must be some protobuf version conflict. Remember that Protobuf creates some code from the ".proto" files in Tink, and then uses it. If these files are created with a different version then the protobuf library used, then such mistakes happen.
Maybe there is some leftover in your installation from Tink 1.5.0?
No.. originally i was using 1.6.1 and it occurs. Move to 1.5.0 and it doesnt. Move back to 1.6.1 and it does.
It happens in IntelliJ as well as when running using gradle.
If there was a mixed version conflict, it should show up in gradle dependencies
right?
Is there any compile time action running? Meaning is it trying to use .proto
files and generate java classes? Maybe it is ending up using a different version of protobuf?
I have protobuf 3.19.4
installed systemwide
$ protoc --version
libprotoc 3.19.4
nvm... my intellij project import was corrupted. reimporting the project fixed it.
Just a note for posterity: including avro-tools
in a project that uses tink
1.7.0
causes problems because avro-tools
is a "fat jar" that includes its own dependencies - including com/google/protobuf
- in its jar. At runtime, tink
may load up the protobuf classes from the avro-tools
jar rather than its own protobuf
dependency, leading to compatibility issues.
Our solution was to remove avro-tools
from dependencies, as it's not appropriate unless you're really using the jar file as an executable on the command line.
Help us help you
We’d like to know more about your Tink deployment.
Describe the bug:
I am trying to write a kafka message encryption/decryption mechanism using Tink. I followed the docs, and tried to initialize it.
Provide a clear and concise description of the bug.
Calling
register()
method throws an exception:What was the expected behavior?
Did not expect an exception.
How can we reproduce the bug?
I use IntelliJ IDEA to write up a unit test.
Here is build.gradle
Do you have any debugging information?
Provide your version information:
Is there anything else you’d like to add?
None.