Error when running the examples on macOS

What is the issue or question you have?

I am trying to run inVEST with example data in the Mac. Some models (see below) work fine. However, the model of “Annual Water Yield” and “Sediment Delivery Rate” return errors. Apparently, both errors are in the same step (“build shapely polygon list”).

  • InVEST 3.14.0
  • Macbook Intel-based (i5)
  • macOS Monterey (12.7)

Would anyone have any suggestions as to what could be happening?

Thanks in advance. Vanderlei

What have you tried so far?

The carbon storage model using example data runs without any problem, but the carbon model doesn’t seem to have this step.

Attach the logfile here:

2023-11-13 17:11:25,781 (natcap.invest.utils) utils.prepare_workspace(161) Level 100 Writing log messages to […/inVEST_TESTES/DroughtRegulation/InVEST-natcap.invest.annual_water_yield-log-2023-11-13–17_11_25.txt]
2023-11-13 17:11:25,782 (main) cli.main(459) Level 100 Starting model with parameters:
Arguments for InVEST natcap.invest.annual_water_yield 3.14.0:
biophysical_table_path …/inVEST/Annual_Water_Yield/biophysical_table_gura.csv
demand_table_path
depth_to_root_rest_layer_path …/inVEST/Annual_Water_Yield/depth_to_root_restricting_layer_gura.tif
eto_path …/inVEST/Annual_Water_Yield/reference_ET_gura.tif
lulc_path …/inVEST/Annual_Water_Yield/land_use_gura.tif
n_workers -1
pawc_path …/inVEST/Annual_Water_Yield/plant_available_water_fraction_gura.tif
precipitation_path …/inVEST/Annual_Water_Yield/precipitation_gura.tif
results_suffix gura
seasonality_constant 5
sub_watersheds_path
valuation_table_path
watersheds_path …/inVEST/Annual_Water_Yield/watershed_gura.shp
workspace_dir …/inVEST_TESTES/DroughtRegulation

2023-11-13 17:11:25,979 (pygeoprocessing.geoprocessing) geoprocessing.align_and_resize_raster_stack(996) INFO 1 of 5 aligned: eto_gura.tif
2023-11-13 17:11:26,122 (pygeoprocessing.geoprocessing) geoprocessing.align_and_resize_raster_stack(996) INFO 2 of 5 aligned: precip_gura.tif
2023-11-13 17:11:26,174 (pygeoprocessing.geoprocessing) geoprocessing.align_and_resize_raster_stack(996) INFO 3 of 5 aligned: depth_to_root_rest_layer_gura.tif
2023-11-13 17:11:26,271 (pygeoprocessing.geoprocessing) geoprocessing.align_and_resize_raster_stack(996) INFO 4 of 5 aligned: pawc_gura.tif
2023-11-13 17:11:26,416 (pygeoprocessing.geoprocessing) geoprocessing.align_and_resize_raster_stack(996) INFO 5 of 5 aligned: clipped_lulc_gura.tif
2023-11-13 17:11:26,416 (pygeoprocessing.geoprocessing) geoprocessing.align_and_resize_raster_stack(1000) INFO aligned all 5 rasters.
2023-11-13 17:11:26,445 (natcap.invest.annual_water_yield) annual_water_yield.execute(695) INFO Reclassifying temp_Kc raster
2023-11-13 17:11:26,455 (pygeoprocessing.geoprocessing) geoprocessing.raster_calculator(470) INFO starting stats_worker
2023-11-13 17:11:26,455 (pygeoprocessing.geoprocessing) geoprocessing.raster_calculator(476) INFO started stats_worker <Thread(Thread-1 (stats_worker), started daemon 123145601925120)>
2023-11-13 17:11:26,519 (pygeoprocessing.geoprocessing) geoprocessing.raster_calculator(555) INFO 100.0% complete
2023-11-13 17:11:26,520 (pygeoprocessing.geoprocessing) geoprocessing.raster_calculator(558) INFO Waiting for raster stats worker result.
2023-11-13 17:11:26,557 (natcap.invest.annual_water_yield) annual_water_yield.execute(707) INFO Reclassifying tmp_root raster
2023-11-13 17:11:26,570 (pygeoprocessing.geoprocessing) geoprocessing.raster_calculator(470) INFO starting stats_worker
2023-11-13 17:11:26,571 (pygeoprocessing.geoprocessing) geoprocessing.raster_calculator(476) INFO started stats_worker <Thread(Thread-2 (stats_worker), started daemon 123145601925120)>
2023-11-13 17:11:26,625 (pygeoprocessing.geoprocessing) geoprocessing.raster_calculator(555) INFO 100.0% complete
2023-11-13 17:11:26,625 (pygeoprocessing.geoprocessing) geoprocessing.raster_calculator(558) INFO Waiting for raster stats worker result.
2023-11-13 17:11:26,665 (natcap.invest.annual_water_yield) annual_water_yield.execute(721) INFO Reclassifying tmp_veg raster
2023-11-13 17:11:26,674 (pygeoprocessing.geoprocessing) geoprocessing.raster_calculator(470) INFO starting stats_worker
2023-11-13 17:11:26,675 (pygeoprocessing.geoprocessing) geoprocessing.raster_calculator(476) INFO started stats_worker <Thread(Thread-3 (stats_worker), started daemon 123145601925120)>
2023-11-13 17:11:26,731 (pygeoprocessing.geoprocessing) geoprocessing.raster_calculator(555) INFO 100.0% complete
2023-11-13 17:11:26,732 (pygeoprocessing.geoprocessing) geoprocessing.raster_calculator(558) INFO Waiting for raster stats worker result.
2023-11-13 17:11:26,774 (natcap.invest.annual_water_yield) annual_water_yield.execute(734) INFO Calculate PET from Ref Evap times Kc
2023-11-13 17:11:26,792 (pygeoprocessing.geoprocessing) geoprocessing.raster_calculator(470) INFO starting stats_worker
2023-11-13 17:11:26,792 (pygeoprocessing.geoprocessing) geoprocessing.raster_calculator(476) INFO started stats_worker <Thread(Thread-4 (stats_worker), started daemon 123145601925120)>
2023-11-13 17:11:26,862 (pygeoprocessing.geoprocessing) geoprocessing.raster_calculator(555) INFO 100.0% complete
2023-11-13 17:11:26,863 (pygeoprocessing.geoprocessing) geoprocessing.raster_calculator(558) INFO Waiting for raster stats worker result.
2023-11-13 17:11:26,928 (pygeoprocessing.geoprocessing) geoprocessing.raster_calculator(470) INFO starting stats_worker
2023-11-13 17:11:26,929 (pygeoprocessing.geoprocessing) geoprocessing.raster_calculator(476) INFO started stats_worker <Thread(Thread-5 (stats_worker), started daemon 123145601925120)>
2023-11-13 17:11:27,106 (pygeoprocessing.geoprocessing) geoprocessing.raster_calculator(555) INFO 100.0% complete
2023-11-13 17:11:27,106 (pygeoprocessing.geoprocessing) geoprocessing.raster_calculator(558) INFO Waiting for raster stats worker result.
2023-11-13 17:11:27,174 (natcap.invest.annual_water_yield) annual_water_yield.execute(765) INFO Performing wyield operation
2023-11-13 17:11:27,186 (pygeoprocessing.geoprocessing) geoprocessing.raster_calculator(470) INFO starting stats_worker
2023-11-13 17:11:27,186 (pygeoprocessing.geoprocessing) geoprocessing.raster_calculator(476) INFO started stats_worker <Thread(Thread-6 (stats_worker), started daemon 123145601925120)>
2023-11-13 17:11:27,262 (pygeoprocessing.geoprocessing) geoprocessing.raster_calculator(555) INFO 100.0% complete
2023-11-13 17:11:27,263 (pygeoprocessing.geoprocessing) geoprocessing.raster_calculator(558) INFO Waiting for raster stats worker result.
2023-11-13 17:11:27,341 (pygeoprocessing.geoprocessing) geoprocessing.raster_calculator(470) INFO starting stats_worker
2023-11-13 17:11:27,342 (pygeoprocessing.geoprocessing) geoprocessing.raster_calculator(476) INFO started stats_worker <Thread(Thread-7 (stats_worker), started daemon 123145601925120)>
2023-11-13 17:11:27,401 (pygeoprocessing.geoprocessing) geoprocessing.raster_calculator(555) INFO 100.0% complete
2023-11-13 17:11:27,402 (pygeoprocessing.geoprocessing) geoprocessing.raster_calculator(558) INFO Waiting for raster stats worker result.
2023-11-13 17:11:27,585 (pygeoprocessing.geoprocessing) geoprocessing.align_and_resize_raster_stack(996) INFO 1 of 1 aligned: clipped_raster.tif
2023-11-13 17:11:27,585 (pygeoprocessing.geoprocessing) geoprocessing.align_and_resize_raster_stack(1000) INFO aligned all 1 rasters.
2023-11-13 17:11:27,586 (pygeoprocessing.geoprocessing) geoprocessing.zonal_statistics(1524) INFO build a lookup of aggregate field value to FID
2023-11-13 17:11:27,586 (pygeoprocessing.geoprocessing) geoprocessing.zonal_statistics(1531) INFO creating disjoint polygon set
2023-11-13 17:11:27,586 (pygeoprocessing.geoprocessing) geoprocessing.calculate_disjoint_polygon_set(2554) INFO build shapely polygon list

1 Like

Hello @vanderleidebastiani and welcome to the forum!

It doesn’t look like the entire log file was posted. Either that, or the model had not finished running yet. The best thing to do is upload the log file as an attachment, so the whole thing is included.

If you’re concerned about the last line that you posted (“INFO build shapely polygon list”), that is not an error, it is just providing information about which calculation the model is doing. Hopefully the model finished successfully after that.

~ Stacie

1 Like

Hi @swolny,

It is the entire log available at the moment. The InVEST stop in this step and show me the error (I uploaded a print screen). I waited about 20 minutes without progress.

I downloaded the exact same example and tested it on Windows 11 (in fact the Windows was installed in a virtual machine using the Parallels on the same Mac). The same example finished in 1m 19s

InVEST-natcap.invest.annual_water_yield-log-2023-11-14–08_37_09.txt (7.5 KB)

Best, Vanderlei

Interesting that it’s behaving differently on Mac vs Windows. I don’t have an explanation for that, so will punt to the software team - @jdouglass perhaps?

~ Stacie

@vanderleidebastiani , could you do us a favor and send us yet another logfile?

If you go to the Workbench’s About > Report a Problem page, there will be a button to “Find my logs”. Those files may have more info about what went wrong here. Please attach them here if you can. Thank you,

1 Like

@dave I found this button, but it doesn’t open anything. Could you tell me where I can find these logfiles manually?

Best, Vanderlei

@vanderleidebastiani , oh, that’s a problem. The logs should be here:

/Users/<your username>/Library/Application Support/invest-workbench/logs/

@dave I only found the invest-workbench folder, but not a logs folder. However, I found some logfiles attached (.zip).

IndexedDB, Local Storage and Session Storage
Archive.zip (21.8 KB)

Best, Vanderlei

@vanderleidebastiani , my apologies, I steered you in the wrong direction. The MacOS logs should actually be at,

~/Library/Logs/invest-workbench/

@dave No problem.

main.log.txt (355.3 KB)

Thanks again, @vanderleidebastiani ,

It’s not obvious what is going wrong here, but we think it’s likely a very hard crash that is causing the model to exit without any errors from Python in the model’s log. Probably this is happening during a Shapely operation, as you suggested. We have a development build of InVEST that includes an updated version of Shapely. Could you try installing this and see what happens? https://github.com/natcap/invest/suites/18285780100/artifacts/1057380920

If the problem persists, it seems likely due to conflicting installations of GEOS - a C library used by Shapely. That could happen if you have installed other libraries on your system that also include GEOS (via homebrew, etc). But if you’re not in the habit of doing things like that, I would ignore this idea for now.

Please let us know if that development build works or not. (Also the “Find my Logs” button should be fixed in that version.)

Thanks,

1 Like

Hi @dave

Sorry for the late reply. The link does not open, page is not found. I tried installing via source files, but I don’t have much knowledge of installing this way (I had installed via the standard way, by clicking). In fact, I won’t need this model soon, so I could wait for the next update and be ready when it comes out (Any prevision?).

If you give me the correct link I can try installing again.

Thanks for your patience. Best, Vanderlei

Sorry about that link!

Here’s a new one: https://storage.googleapis.com/releases.naturalcapitalproject.org/invest/3.14.0.post155+g49990e06d/workbench/invest_3.14.0.post155+g49990e06d_workbench_darwin_x64.dmg

We appreciate you trying it since we’re not able to reproduce the problem on any of our hardware.

Hi @dave

This version works fine! I have run the models “Annual Water Yield” and “Sediment Delivery Rate” with example data and now this is finished without any problem. I just installed the version from the link, and made no other changes to the computer (macOS, or GEOS).

Thanks so much. Best, Vanderlei

1 Like

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.