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

VerifyError on Datastore Protobuf #411

Closed
masoudsc opened this issue Jan 24, 2017 · 2 comments
Closed

VerifyError on Datastore Protobuf #411

masoudsc opened this issue Jan 24, 2017 · 2 comments
Labels
bug Something isn't working

Comments

@masoudsc
Copy link

My code is simply reading from one entity in Datastore. It works fine in V2.8 but I get this error when in 2.11


Exception in thread "main" java.lang.VerifyError: Bad type on operand stack
Exception Details:
  Location:
    com/google/datastore/v1/Query$Builder.setLimit(Lcom/google/protobuf/Int32Value$Builder;)Lcom/google/datastore/v1/Query$Builder; @30: invokevirtual
  Reason:
    Type 'com/google/protobuf/Int32Value' (current frame, stack[1]) is not assignable to 'com/google/protobuf/GeneratedMessage'
  Current Frame:
    bci: @30
    flags: { }
    locals: { 'com/google/datastore/v1/Query$Builder', 'com/google/protobuf/Int32Value$Builder' }
    stack: { 'com/google/protobuf/SingleFieldBuilder', 'com/google/protobuf/Int32Value' }
  Bytecode:
    0x0000000: 2ab4 0023 c700 122a 2bb6 009e b500 122a
    0x0000010: b600 3fa7 000f 2ab4 0023 2bb6 009e b600
    0x0000020: 8557 2ab0
  Stackmap Table:
    same_frame(@22)
    same_frame(@34)

        at com.google.datastore.v1.Query.toBuilder(Query.java:667)
        at com.google.datastore.v1.Query.newBuilder(Query.java:661)
        at com.snapchat.datastore.entity.DataStoreEntity$class.queryAll(DataStoreEntity.scala:20)
        at com.snapchat.datastore.entity.FriendLink$.queryAll(FriendLink.scala:7)
        at com.snapchat.dataflow.friendgraph.DumpFriendLinksFromDataStore.build(DumpFriendLinksFromDataStore.scala:50)
        at com.snapchat.dataflow.friendgraph.DumpFriendLinksFromDataStore$.main(DumpFriendLinksFromDataStore.scala:90)
        at com.snapchat.dataflow.friendgraph.DumpFriendLinksFromDataStore.main(DumpFriendLinksFromDataStore.scala)
@nevillelyh nevillelyh added the bug Something isn't working label Jan 24, 2017
@nevillelyh
Copy link
Contributor

Can't reproduce with this snippet:

import com.google.common.collect.ImmutableMap
import com.google.datastore.v1.Entity
import com.google.datastore.v1.client.DatastoreHelper.{makeKey, makeValue}
import org.scalatest._

class DatastoreTest extends FlatSpec with Matchers {

  "Datastore" should "work" in {
    noException should be thrownBy {
      Entity.newBuilder()
        .setKey(makeKey("key"))
        .putAllProperties(ImmutableMap.of(
          "content", makeValue("value").build(),
          "int", makeValue(10).build()
        ))
        .build()
    }
  }

}

Can you provide one that causes the problem? Do you have a protobuf dependency conflict in your project?

@nevillelyh
Copy link
Contributor

Gonna close this for now. Feel free to re-open if you can provide a reproducible snippet.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants