Visitation server: RuntimeError: OGR Error: Corrupt data

Hi,

I am trying to run the visitation model to get results from a map, but I keep encountering these errors, and I’m not sure why. I’m including a file folder that includes all the data input, the log text, and other files that resulted from it. Let me know if there’s anything you might need!

Thanks!

invest_recreation_datastack.tgz (3.3 KB)

Hello @Isabella_Smith and welcome back! Could you also provide the logfile from your model run? That will help us determine whether the issue is in the data, on the server, or somewhere in between.

Hi,

Yes, I’m attaching it here!

InVEST-coastal_blue_carbon-log-2026-10-20–15_55_09.txt (48.6 KB)

It looks like this logfile is from a Coastal Blue Carbon model run, which won’t match the Recreation model issue that you mentioned. Could you try uploading the Recreation logfile?

Thanks!

Oh sorry! I accidentally sent the wrong one. Here’s the right one.

InVEST-recreation-log-2026-10-20–15_41_31.txt (7.3 KB)

Got it, thanks! This is an interesting error that I don’t think I’ve seen before. I’m looking into it.

Okay, thank you very much for being willing to help!

Hello @jdouglass,

I am getting what looks like the same error as in this topic. Every Recreation run I tried today (23 Oct 2026, InVEST 3.20.2, Windows) fails on the server right after the AOI upload, both with my own AOI (Illas Atlánticas, Spain) and with the official sample data (andros_aoi.shp, 2012-2017, no regression), so it does not seem to depend on the input data.

The AOI is accepted and decompressed on the server (PUD and TUD start “running calc user days”), and then both fail with RuntimeError: OGR Error: Corrupt data in recmodel_server._calc_aggregated_points_in_aoi → pygeoprocessing.transform_bounding_box → target_ref.ImportFromWkt(target_projection_wkt). The WKT that fails is the target one (lat_lng_ref.ExportToWkt()), not the AOI’s, so the server seems unable to build its WGS84 reference (maybe a missing PROJ database in the invest_3_19_0 environment).

I could not attach the files (new account), so I paste both logs below. The second one is shortened because its traceback is identical to the first.

Log with the sample data (andros_aoi.shp)
2026-10-23 12:16:43  natcap.invest.utils Level 100 Writing log messages to [G:\Mi unidad\Islas\InVEST-recreation-log-2026-10-23--12_16_43.txt]
2026-10-23 12:16:43  natcap.invest.spec Level 100 Starting model with parameters:
Arguments for InVEST recreation 3.20.2:
aoi_path           G:\Mi unidad\Islas\EXTERNAL\INVEST\Recreation\recreation\andros_aoi.shp
compute_regression False
end_year           2017
grid_aoi           False
n_workers          -1
results_suffix     Text_data_example
start_year         2012
workspace_dir      G:\Mi unidad\Islas

2026-10-23 12:16:44  natcap.invest.recreation.recmodel_client INFO     PYRO:natcap.invest.recreation@34.56.65.180:54323
2026-10-23 12:16:44  natcap.invest.recreation.recmodel_client INFO     Contacting server, please wait.
2026-10-23 12:16:45  natcap.invest.recreation.recmodel_client INFO     flickr server supports year queries between 2005 and 2017
2026-10-23 12:16:45  natcap.invest.recreation.recmodel_client INFO     AOI accepted. Fewer than 105563 flickr points found within AOI extent: [-78.80246553844518, 23.303864467695696, -76.90482755985715, 25.620871797981472]
2026-10-23 12:16:45  natcap.invest.recreation.recmodel_client INFO     twitter server supports year queries between 2012 and 2022
2026-10-23 12:16:45  natcap.invest.recreation.recmodel_client INFO     AOI accepted. Fewer than 2527427 twitter points found within AOI extent: [-78.80246553844518, 23.303864467695696, -76.90482755985715, 25.620871797981472]
2026-10-23 12:16:45  natcap.invest.recreation.recmodel_client INFO     archiving G:\Mi unidad\Islas\intermediate\aoi_Text_data_example.gpkg
2026-10-23 12:16:45  natcap.invest.recreation.recmodel_client INFO     Please wait for server to calculate PUD and TUD...
2026-10-23 12:16:52  PUD                INFO     decompress zip file AOI
2026-10-23 12:16:52  PUD                INFO     running calc user days on /usr/local/recreation-server/invest_3_15_0/server/flickr/local/cae0378b-115c-4589-8d52-d198f7e94d78
2026-10-23 12:16:52  TUD                INFO     decompress zip file AOI
2026-10-23 12:16:52  TUD                INFO     running calc user days on /usr/local/recreation-server/invest_3_15_0/server/twitter/local/ca0f38a0-9ebf-4d9d-b522-3b603e0650f9
2026-10-23 12:16:54  natcap.invest.recreation.recmodel_client INFO     connection release
2026-10-23 12:16:54  natcap.invest.recreation.recmodel_client ERROR    concurrent.futures.process._RemoteTraceback:
"""
Traceback (most recent call last):
  File "/usr/local/recreation-server/invest_3_15_0/invest_3_19_0/env/lib/python3.13/concurrent/futures/process.py", line 254, in _process_worker
    r = call_item.fn(*call_item.args, **call_item.kwargs)
  File "/usr/local/recreation-server/invest_3_15_0/invest_3_19_0/src/natcap/invest/recreation/recmodel_server.py", line 455, in calc_user_days_in_aoi
    self._calc_aggregated_points_in_aoi(
    ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^
        aoi_path, workspace_path, start_year, end_year,
        ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
        target_filename, logger))
        ^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/recreation-server/invest_3_15_0/invest_3_19_0/src/natcap/invest/recreation/recmodel_server.py", line 551, in _calc_aggregated_points_in_aoi
    global_b_box = pygeoprocessing.transform_bounding_box(
        local_b_box, aoi_info['projection_wkt'], lat_lng_ref.ExportToWkt())
  File "/usr/local/recreation-server/invest_3_15_0/invest_3_19_0/env/lib/python3.13/site-packages/pygeoprocessing/utils.py", line 32, in wrapper
    return func(*args, **kwargs)
  File "/usr/local/recreation-server/invest_3_15_0/invest_3_19_0/env/lib/python3.13/site-packages/pygeoprocessing/geoprocessing.py", line 3652, in transform_bounding_box
    target_ref.ImportFromWkt(target_projection_wkt)
    ~~~~~~~~~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/recreation-server/invest_3_15_0/invest_3_19_0/env/lib/python3.13/site-packages/osgeo/osr.py", line 1703, in ImportFromWkt
    return _osr.SpatialReference_ImportFromWkt(self, *args)
           ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^^^^^^^^^^^^^
RuntimeError: OGR Error: Corrupt data
"""

The above exception was the direct cause of the following exception:

Traceback (most recent call last):
  File "/usr/local/recreation-server/invest_3_15_0/invest_3_19_0/src/natcap/invest/recreation/recmodel_server.py", line 205, in calculate_userdays
    results[label] = future.result()
                     ~~~~~~~~~~~~~^^
  File "/usr/local/recreation-server/invest_3_15_0/invest_3_19_0/env/lib/python3.13/concurrent/futures/_base.py", line 449, in result
    return self.__get_result()
           ~~~~~~~~~~~~~~~~~^^
  File "/usr/local/recreation-server/invest_3_15_0/invest_3_19_0/env/lib/python3.13/concurrent/futures/_base.py", line 401, in __get_result
    raise self._exception
RuntimeError: OGR Error: Corrupt data

2026-10-23 12:16:54  taskgraph.Task     ERROR    Something went wrong when adding task user-day-calculation (1), terminating taskgraph.
Traceback (most recent call last):
  File "taskgraph\Task.py", line 684, in add_task
  File "taskgraph\Task.py", line 1103, in _call
  File "natcap\invest\recreation\recmodel_client.py", line 800, in _retrieve_user_days
RuntimeError: An error occurred on the server.
2026-10-23 12:16:54  natcap.invest.utils ERROR    Exception while executing recreation
Traceback (most recent call last):
  File "natcap\invest\utils.py", line 169, in prepare_workspace
  File "natcap\invest\spec.py", line 2609, in execute
  File "natcap\invest\recreation\recmodel_client.py", line 563, in execute
  File "taskgraph\Task.py", line 684, in add_task
  File "taskgraph\Task.py", line 1103, in _call
  File "natcap\invest\recreation\recmodel_client.py", line 800, in _retrieve_user_days
RuntimeError: An error occurred on the server.
2026-10-23 12:16:54  natcap.invest.utils INFO     Elapsed time: 10.88s
2026-10-23 12:16:54  natcap.invest.utils INFO     Execution finished; version: 3.20.2
Log with my own AOI (zones_Atlanticas.geojson), shortened
2026-10-23 11:58:24  natcap.invest.spec Level 100 Starting model with parameters:
Arguments for InVEST recreation 3.20.2:
aoi_path           G:\Mi unidad\Islas\~AUX\AUX08_Atlanticas\zones_Atlanticas.geojson
compute_regression False
end_year           2017
grid_aoi           False
n_workers          -1
results_suffix     Test_delete
start_year         2012
workspace_dir      G:\Mi unidad\Islas

2026-10-23 11:58:26  natcap.invest.recreation.recmodel_client INFO     AOI accepted. Fewer than 349146 flickr points found within AOI extent: [-9.101601611253699, 41.95367914795743, -8.535256584253185, 42.81081091105713]
2026-10-23 11:58:27  natcap.invest.recreation.recmodel_client INFO     AOI accepted. Fewer than 5574095 twitter points found within AOI extent: [-9.101601611253699, 41.95367914795743, -8.535256584253185, 42.81081091105713]
2026-10-23 11:58:35  PUD                INFO     running calc user days on /usr/local/recreation-server/invest_3_15_0/server/flickr/local/5a87302d-141d-4e6a-8083-6705778dd6ca
2026-10-23 11:58:35  TUD                INFO     running calc user days on /usr/local/recreation-server/invest_3_15_0/server/twitter/local/309966d0-a267-4270-96ca-ecdae4b587e5
2026-10-23 11:58:37  natcap.invest.recreation.recmodel_client ERROR    concurrent.futures.process._RemoteTraceback:
[... identical traceback to the first log: recmodel_server.py line 551 _calc_aggregated_points_in_aoi -> pygeoprocessing.transform_bounding_box -> target_ref.ImportFromWkt(target_projection_wkt) -> RuntimeError: OGR Error: Corrupt data ...]
RuntimeError: An error occurred on the server.
2026-10-23 11:58:37  natcap.invest.utils INFO     Elapsed time: 12.91s
2026-10-23 11:58:37  natcap.invest.utils INFO     Execution finished; version: 3.20.2

Thanks,
Mario

@Isabella_Smith , @marioontiyuelo , thank you for reporting this issue. It seems like something was corrupted on the server. We have switched over to a new server and things should be working as expected now. Please try again. Thanks!

Hi @dave, thank you for your quick response. I can confirm the problem is solved: the model now runs correctly with the sample data.
Hugs!
Mario