Crop Pollination error "utf-8"

Dear community
I am running the Crop Pollination model using the sample data for Pollination (pollination_Willamette.invs.json)

error
03/16/2023 19:24:36 natcap.invest.utils ERROR Exception while executing natcap.invest.pollination
UnicodeDecodeError: ‘utf-8’ codec can’t decode byte 0xf6 in position 60: invalid start byte

Hi @sibylles , this sounds like a problem that has been very hard for us to debug. If you don’t mind helping us, please follow the instructions in this post:

Thank you!

2 Likes

Dear Dave
Yes for sure. However I am sure it is because the „ö“ in my Name an so Problem to find link to Input folder. I remember similar Problem with R packages.

Unfortunately i was not able to change the Name of the User Account on my pc

Sibylle

Dear Dave
I installed the new InVest from theh link. See the error. However, I will contact an IT to change my “user” name. I changed it but it still remains on the link.
03/17/2023 06:51:45 natcap.invest.utils Level 100 Writing log messages to [C:\Users\Sibylle St�ckli\Desktop\InVEST\InVEST_output\InVEST-natcap.invest.pollination-log-2023-03-17–06_51_45.txt]
03/17/2023 06:51:45 main Level 100 Starting model with parameters:
Arguments for InVEST natcap.invest.pollination 3.12.1.post14+g725c2c5b5:
farm_vector_path C:\Users\Sibylle St�ckli\Desktop\InVEST\InVEST_Sampledata\pollination\farms.shp
guild_table_path C:\Users\Sibylle St�ckli\Desktop\InVEST\InVEST_Sampledata\pollination\guild_table.csv
landcover_biophysical_table_path C:\Users\Sibylle St�ckli\Desktop\InVEST\InVEST_Sampledata\pollination\landcover_biophysical_table.csv
landcover_raster_path C:\Users\Sibylle St�ckli\Desktop\InVEST\InVEST_Sampledata\pollination\landcover.tif
n_workers -1
results_suffix
workspace_dir C:\Users\Sibylle St�ckli\Desktop\InVEST\InVEST_output

03/17/2023 06:51:45 natcap.invest.pollination INFO Checking to make sure guild table has all expected headers
03/17/2023 06:51:45 natcap.invest.pollination INFO Checking that farm polygon has expected headers
03/17/2023 06:51:45 natcap.invest.utils ERROR Exception while executing natcap.invest.pollination
TypeError: _pylog_handler() missing 3 required positional arguments: ‘err_level’, ‘err_no’, and ‘err_msg’

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

Traceback (most recent call last):
File “natcap\invest\utils.py”, line 168, in prepare_workspace
File “invest\cli.py”, line 486, in main
File “natcap\invest\pollination.py”, line 383, in execute
File “pygeoprocessing\geoprocessing.py”, line 1660, in get_raster_info
SystemError: _PyEval_EvalFrameDefault returned a result with an exception set
03/17/2023 06:51:45 natcap.invest.utils INFO Elapsed time: 0.05s
03/17/2023 06:51:45 natcap.invest.utils INFO Execution finished

Dear Dave
Probably we can solve the problem

  • I changed my name in “system” - “user-account” to sibyllestoeckli.
  • However, in pc-system(c:)- user the name is still “Sibylle Stöckli” → the problem. How can I change the name in system (c:)?
    Sibylle

Hi @sibylles Thanks for trying that new version. If you don’t mind trying it one more time, but first changing one of the Settings to enable “DEBUG” logging:


Then, after running the model, Open Workspace to find the logfile (*.txt) and upload that file here. Thanks again!

We’re hoping we can find a way to fix this that will not involve you having to change your username. Though it is good to know that will work in the meantime.

I’m not sure, maybe your IT contact person can help with that?

1 Like

Dear Dave

Find enclosed the DEBUG

03/18/2023 08:29:38 natcap.invest.utils Level 100 Writing log messages to [C:\Users\Sibylle Stckli\Desktop\InVEST\InVEST_output\InVEST-natcap.invest.pollination-log-2023-03-18–08_29_38.txt]

03/18/2023 08:29:38 main Level 100 Starting model with parameters: Arguments for InVEST natcap.invest.pollination 3.12.1: farm_vector_path C:\Users\Sibylle Stckli\Desktop\InVEST\InVEST_Sampledata\pollination\farms.shp guild_table_path C:\Users\Sibylle Stckli\Desktop\InVEST\InVEST_Sampledata\pollination\guild_table.csv landcover_biophysical_table_path C:\Users\Sibylle Stckli\Desktop\InVEST\InVEST_Sampledata\pollination\landcover_biophysical_table.csv landcover_raster_path C:\Users\Sibylle Stckli\Desktop\InVEST\InVEST_Sampledata\pollination\landcover.tif n_workers -1 results_suffix workspace_dir C:\Users\Sibylle Stckli\Desktop\InVEST\InVEST_output

03/18/2023 08:29:39 natcap.invest.pollination INFO Checking to make sure guild table has all expected headers

03/18/2023 08:29:39 natcap.invest.pollination INFO Checking that farm polygon has expected headers

03/18/2023 08:29:39 natcap.invest.utils ERROR Exception while executing natcap.invest.pollination UnicodeDecodeError: ‘utf-8’ codec can’t decode byte 0xf6 in position 60: invalid start byte The above exception was the direct cause of the following exception: Traceback (most recent call last): File “natcap\invest\utils.py”, line 72, in _log_gdal_errors SystemError: returned a result with an exception set The above exception was the direct cause of the following exception: Traceback (most recent call last): File “natcap\invest\utils.py”, line 72, in _log_gdal_errors SystemError: returned a result with an exception set The above exception was the direct cause of the following exception: Traceback (most recent call last): File “natcap\invest\utils.py”, line 164, in prepare_workspace File “invest\cli.py”, line 486, in main File “natcap\invest\pollination.py”, line 383, in execute File “pygeoprocessing\geoprocessing.py”, line 1660, in get_raster_info SystemError: _PyEval_EvalFrameDefault returned a result with an exception set

03/18/2023 08:29:39 natcap.invest.utils INFO Elapsed time: 0.08s 03/18/2023 08:29:39 natcap.invest.utils INFO Execution finished

Dear Dave

I just installed InVEST on my second computer, a MAC with « sibyllestoeckli ». No problems. So it is definitively an IT problem with my name, not InVEST.

03/20/2023 12:35:21 natcap.invest.utils Level 100 Writing log messages to [/Users/sibyllestockli/Desktop/InVEST-natcap.invest.pollination-log-2023-03-20–12_35_21.txt]

03/20/2023 12:35:21 main Level 100 Starting model with parameters: Arguments for InVEST natcap.invest.pollination 3.13.0: farm_vector_path /Users/sibyllestockli/Desktop/pollination/farms.shp guild_table_path /Users/sibyllestockli/Desktop/pollination/guild_table.csv landcover_biophysical_table_path /Users/sibyllestockli/Desktop/pollination/landcover_biophysical_table.csv landcover_raster_path /Users/sibyllestockli/Desktop/pollination/landcover.tif n_workers -1 results_suffix workspace_dir /Users/sibyllestockli/Desktop

03/20/2023 12:35:21 natcap.invest.pollination INFO Checking to make sure guild table has all expected headers

03/20/2023 12:35:21 natcap.invest.pollination INFO Checking that farm polygon has expected headers

03/20/2023 12:35:21 pygeoprocessing.geoprocessing INFO starting reprojection

03/20/2023 12:35:21 pygeoprocessing.geoprocessing INFO reprojection 100.0% complete on reprojected_farm_vector.shp

Okay, that’s great! Thanks for letting us know. Even so, we still hope to find a way to make InVEST work on Windows for you and other users with non-latin characters in your username.

@sibylles, could you try to use this development build on your windows computer and upload the logfile here? I don’t expect it to work, but it will produce a bunch of extra logging information that I hope will help us identify the root cause.

Here’s the build: https://storage.googleapis.com/natcap-dev-build-artifacts/invest/phargogh/3.12.1.post659%2Bgc85be9a59/workbench/invest_3.12.1.post659%2Bgc85be9a59_workbench_win32_x64.exe

Thank you!
James

1 Like

Dear James
Thanks a lot.
Sibylle
InVEST-natcap.invest.pollination-log-2023-03-21–08_02_03.txt (3.7 KB)

Fantastic, this is extremely helpful @sibylles !

We’re getting closer to the root of the issue, and I think I might have traced it down to a specific function call but I need a little more information about it.

I’ve added some more debug logging (and disabled some other logging) in this development build … could you try running the model and upload the logfile once again?

https://storage.googleapis.com/natcap-dev-build-artifacts/invest/phargogh/3.12.1.post661%2Bg3c399caae/workbench/invest_3.12.1.post661%2Bg3c399caae_workbench_win32_x64.exe

Thank you!
James

Dear James
Thanks a lot. I suppose it is now working. Great. Find enclosed the txt file. Could you please check it if there is still any error?
Sibylle
InVEST-natcap.invest.pollination-log-2023-03-22–07_38_24.txt (52.8 KB)

Dear James
I tried to install xnview ot open tif. files. See error. Maybe linked to the problem?
Sibylle

Yes, there are two issues that we’re trying to work through:

  1. There’s a low-level issue with something related to how GDAL (our raster and vector input/output library) is reading or writing a raster, which is producing some logging
  2. the logging that GDAL is producing is causing an unrelated error to be raised, but we can’t see it because it’s being obscured by a separate error.

So I think this development build linked below can help us get to the bottom of number 2, above, and once we can see number 2, we can address number 1.

Could you run this development build and upload the logfile once again?

https://storage.googleapis.com/natcap-dev-build-artifacts/invest/phargogh/3.12.1.post662%2Bg6d30b2583/workbench/invest_3.12.1.post662%2Bg6d30b2583_workbench_win32_x64.exe

Thank you!
James

Dear James

Hmm now an error, the last time there was no error?

Sibylle

InVEST-natcap.invest.pollination-log-2023-03-23–06_56_53.txt (5.62 KB)

Yes, there was no error before (which was a bug!), but the model outputs aren’t being created as they should be because of a problem in the model. Could you try this workbench build again and upload the logfile?

https://storage.googleapis.com/natcap-dev-build-artifacts/invest/phargogh/3.12.1.post665%2Bgdba6ab42c/workbench/invest_3.12.1.post665%2Bgdba6ab42c_workbench_win32_x64.exe

Thank you!
James

Dear James

Thanks a lot. New version. New error.

Sibylle

InVEST-natcap.invest.pollination-log-2023-03-24–07_41_25.txt (1.77 KB)

Thanks again for continuing to help us try to find the root cause of this, @sibylles !

I inadvertently had a bug in the last one that got in the way, which is fixed in the link below. I think this build might run all the way through, but I still think we have a bug. Could you try this build and attach the logfile once again?

https://storage.googleapis.com/natcap-dev-build-artifacts/invest/phargogh/3.13.0.post24%2Bgf6da8f741/workbench/invest_3.13.0.post24%2Bgf6da8f741_workbench_win32_x64.exe

Also, if you have a chance, could you share your input data with me so I can try running them on my computer and see if there’s anything going on there, just in case? Google drive, Dropbox, OneDrive and similar services are usually easiest, and feel free to send them to my email, jdouglass@stanford.edu.

Thank you!
James

Dear James

Indeed, still a bug.

I am using the InVEST sample data for pollination

«pollination_willamette.invs.json»

Kind regards

Sibylle

InVEST-natcap.invest.pollination-log-2023-03-27–09_12_08.txt (21.6 KB)