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

Remote extract generation timeout results in error with db connection #17

Open
spwoodcock opened this issue Feb 26, 2024 · 0 comments
Open
Labels
bug Something isn't working

Comments

@spwoodcock
Copy link
Member

Describe the bug

  File "/opt/app/projects/project_crud.py", line 531, in <lambda>
    lambda: split_by_sql(
            └ <function split_by_sql at 0x7f0a75496680>

  File "/home/appuser/.local/lib/python3.10/site-packages/fmtm_splitter/splitter.py", line 494, in split_by_sql
    featcol = splitter.splitBySQL(query, db, num_buildings, osm_extract=extract_geojson)
              │        │          │      │   │                          └ {'type': 'FeatureCollection', 'features': [{'type': 'Feature', 'geometry': {'type': 'LineString', 'coordinates': [[-10.791561...
              │        │          │      │   └ 5
              │        │          │      └ <sqlalchemy.orm.session.Session object at 0x7f0a7214bfd0>
              │        │          └ 'DROP TABLE IF EXISTS polygonsnocount;\n-- Create a new polygon layer of splits by lines\n\nCREATE TABLE polygonsnocount AS (...
              │        └ <function FMTMSplitter.splitBySQL at 0x7f0a754964d0>
              └ <fmtm_splitter.splitter.FMTMSplitter object at 0x7f0a72b618d0>
  File "/home/appuser/.local/lib/python3.10/site-packages/fmtm_splitter/splitter.py", line 234, in splitBySQL
    create_tables(conn)
    │             └ <sqlalchemy.pool.base._ConnectionFairy object at 0x7f0a721ea2c0>
    └ <function create_tables at 0x7f0a75495f30>
  File "/home/appuser/.local/lib/python3.10/site-packages/fmtm_splitter/db.py", line 87, in create_tables
    drop_tables(conn)
    │           └ <sqlalchemy.pool.base._ConnectionFairy object at 0x7f0a721ea2c0>
    └ <function drop_tables at 0x7f0a75495fc0>
  File "/home/appuser/.local/lib/python3.10/site-packages/fmtm_splitter/db.py", line 136, in drop_tables
    cur = conn.cursor()
          │    └ <function _ConnectionFairy.cursor at 0x7f0a8a760c10>
          └ <sqlalchemy.pool.base._ConnectionFairy object at 0x7f0a721ea2c0>
  File "/home/appuser/.local/lib/python3.10/site-packages/sqlalchemy/pool/base.py", line 1490, in cursor
    assert self.dbapi_connection is not None
           │    └ <member 'dbapi_connection' of '_ConnectionFairy' objects>
           └ <sqlalchemy.pool.base._ConnectionFairy object at 0x7f0a721ea2c0>

AssertionError: assert self.dbapi_connection is not None

To Reproduce

  • Occurs occasionally when the data extract generation / polling times out in FMTM.

Expected behavior

  • There should be handling for the self.dbapi_connection.
  • It should not error if self.dbapi_connection is not None.
@spwoodcock spwoodcock added the bug Something isn't working label Feb 26, 2024
@spwoodcock spwoodcock changed the title Remote extract generation timeout results in error Remote extract generation timeout results in error with db connection Aug 5, 2024
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

1 participant