question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Investigate errors in SQLAlchemy 1.3

See original GitHub issue

After bringing in #6, we’ve had reports of unreliability with some tests:

@charness thank you for the fix, I couldn’t trace this down for a long time!

However, it introduced some flakiness in our test suite for several tests that do a commit and then check if the attribute changes. Have you had anything like it?

The code is similar to this:

def test_should_confirm_account(db_session, app_client):
    user = UserFactory()
    token = user.generate_token_and_save_timestamp()

    db_session.add(user)
    # First commit or flush in some cases
    db_session.commit()

    # One more commit here:
    response = app_client.post("/account/confirm", json={"token": token})
    assert response.status_code == 200

    # Fails with:
    # Instance <User at 0x108bf1d30> is not bound to a Session; attribute refresh operation cannot proceed (Background on this error at: http://sqlalche.me/e/bhk3 
    assert user.is_confirmed()

Check to see if this example can be reproduced, and if so, investigate the root cause of the problem.

Edit 3/12: This appears to be a problem with SQLAlchemy 1.3. Pinning your SQLAlchemy version to <1.3 should fix any errors in the meantime while we figure out what exactly is going on.

Issue Analytics

  • State:closed
  • Created 5 years ago
  • Comments:12 (4 by maintainers)

github_iconTop GitHub Comments

1reaction
jeancochranecommented, Apr 4, 2019

Just published v1.0.2 providing support for SQLAlchemy 1.3. Thanks for the help figuring this out, all!

0reactions
killthekittencommented, Apr 4, 2019

@jeancochrane you’re amazing!

Read more comments on GitHub >

github_iconTop Results From Across the Web

Error Messages - SQLAlchemy 1.4 Documentation
Exception raised for programming errors, e.g. table not found or already exists, syntax error in the SQL statement, wrong number of parameters specified,...
Read more >
ORM Exceptions — SQLAlchemy 1.3 Documentation
A SELECT is emitted for the target row based on primary key; if no row is returned, this exception is raised.
Read more >
SQLAlchemy 1.3 Documentation
A high level view and getting set up. Overview | Installation Guide | Frequently Asked Questions | Migration from 1.2 | Glossary |...
Read more >
SQLAlchemy error: An attempt to complete a transaction has ...
SQLAlchemy (1.3.5); Pandas (0.24.2). and I want to create just a proof of concept using SQLAlchemy with an Azure SQL Data Warehouse.
Read more >
Connection Pooling - SQLAlchemy 1.1 Documentation
SQLAlchemy includes several connection pool implementations which ... system called is_disconnect() which will examine the contents of an exception object, ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found