GithubHelp home page GithubHelp logo

spanner: InvalidArgument: 400 Previously received a different request with this seqno. seqno=4 with no concurrency applied about python-spanner HOT 2 CLOSED

odeke-em avatar odeke-em commented on September 18, 2024
spanner: InvalidArgument: 400 Previously received a different request with this seqno. seqno=4 with no concurrency applied

from python-spanner.

Comments (2)

larkee avatar larkee commented on September 18, 2024 1

I have managed to run into this same error without concurrency:

from google.cloud import spanner

client = spanner.Client()
instance = client.instance(INSTANCE)
database = instance.database(DATABASE)

sess = database.session()
sess.create()

txn = sess.transaction()

txn.begin()
try:
    txn.execute_update(
        "INSERT Singers (SingerId, FirstName, LastName) VALUES "
        "(10, 'Taylor', 'Swift'),"
    )
except Exception as e:
    print("error:")
    print(e)

txn.execute_update(
    "INSERT Singers (SingerId, FirstName, LastName) VALUES "
    "(10, 'Taylor', 'Swift')"
)

txn.commit()

The output is:

error:
400 Syntax error: Expected \"(\" but got end of statement [at 1:79]\nINSERT Singers (SingerId, FirstName, LastName) VALUES (10, \'Taylor\', \'Swift\'),\n   

and raises:

google.api_core.exceptions.InvalidArgument: 400 Previously received a different request with this seqno. seqno=0

The problem seems to arise when a execute_sql, execute_batch_dml, or execute_streaming_sql call made by a Transaction or Snapshot raises an exception as it fails to increment _execute_sql_count. I am looking into a possible fix.

Thanks for finding this!

from python-spanner.

odeke-em avatar odeke-em commented on September 18, 2024

@skuruppu @larkee I am getting this error quite a lot with the spanner-django project as per https://travis-ci.com/orijtech/spanner-orm/jobs/283644877#L611 which you have access to with your Github accounts.

from python-spanner.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.