-
Notifications
You must be signed in to change notification settings - Fork 79
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
GDAL-level SystemError
for some users
#1167
Comments
I'm hoping that this will allow us to capture more information about what's going on. RE:natcap#1167
I wrote back to the latest thread with a development build that uses GDAL's logging handler instead of the one that we've been using. A big apparent advantage of GDAL's handler is that they've (optionally) enabled their own internal debug logging to be exposed through the python logging, just at the |
Also adding CPL_DEBUG (copied from GDAL logging example) to increase verbosity of the gdal logging, and mirroring the log levels that GDAL has. RE:natcap#1167
The user is re-running the model on the same workspace and while the error message is consistent, I'm not getting it in the same point of execution in the model. RE:natcap#1167
There is a possibility that the issue here is UTF-16 strings being provided to GDAL. RE:natcap#1167
Observation: When converting a >>> len('foo'.encode('utf-16').decode('utf-8'))
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
UnicodeDecodeError: 'utf-8' codec can't decode byte 0xff in position 0: invalid start byte The forums posts linked have a variety of different specific exceptions. Maybe this is related to one or more of them? dba6ab4 tests this suspicion by examining the file encoding of any files provided by the user in an args dict. |
Now we don't return if there are an invalid number of parameters, just log what we know and put in an obvious placeholder on what we don't know. RE:natcap#1167
It turns out this can be configured via an environment variable. RE:natcap#1167
After some digging into the python documentation and some trial-and-error, I believe this exception is being caused by how python is handling the user's default locale and filesystem encoding. The solution (PR coming soon) is to force python to use UTF-8 strings. Since GDAL expects UTF-8 filepaths, this is the most natural solution and should guarantee that we are working with UTF-8 paths at all times. A few further notes from discovery and repair, for future us:
For anyone experiencing this issue on InVEST < 3.13.1 (I'm guessing that this will be the next release), setting the environment variable This environment variable will be necessary for at least the next 4 years, until Python 3.15 makes UTF-8 mode the default. |
Refactor of how we create the arguments for spawning the InVEST process for clarity and brevity. RE:natcap#1167 Co-authored-by: Emily Soth <[email protected]>
This will fix the tests hanging. RE:natcap#1167
OK, I don't have a solution, exactly, but I have been able to reproduce this on a Windows VM using Windows 10 insider edition, from the UK and German versions of Windows. The errors are the same in both, but the UK one is much easier for me to navigate :) Here's what I've gathered so far:
Furthermore:
WorkaroundInstall InVEST for all users at install time. |
Mamba isn't able to resolve our builds with python 3.11. RE:natcap#1167
This is on hold because I haven't had a chance to dig into it for a while, and is mitigated by being sure to install InVEST for all users on the computer. |
I haven't thought about this issue in about a year, and in that time I seem to have deleted the Windows VM I was using for testing. But looking back on this issue, this is really looking like a core GDAL issue and not something that's strictly wrong with InVEST. If this is true, then we should be able to reproduce this by:
If this still fails, it'd be a great minimum, reproducible example for the GDAL devs. |
We have had a couple of issues on the forums now involving some kind of low-level exception in GDAL where we have almost no extra information. Examples include:
The issue appears to be happening at various times, including while reading a raster and while registering drivers.
The text was updated successfully, but these errors were encountered: