Habitat Quality: An error occured while writing a dirty block

Hello! I’ve been running the HQ model and this error appears thousands of times: An error occured while writing a dirty block. I’m attaching the log. I have no idea what this error means or how I can fix it.
Thank you so much in advance for your help.

Hi @Lara, could you attach the logfile from your model run so we can take a look? It will help a lot with debugging.


Apparently I can’t upload the file, I don’t know why, I have tried several times and it’s not working… How can I deliver the log to you?

Curious! If you could email it to me (jdouglass@stanford.edu, and please be sure to include a link to this post for reference), I’ll be able to take a look.


@Lara, thanks for sending your logfile! So, based on the logfile, there are a couple things I’d suggest:

The first thing I notice is:

08/26/2019 18:18:53  root               INFO     Running InVEST version "3.3.3"

InVEST 3.3.3 is pretty old and it’s quite likely that we’ve fixed a variety of issues with the model (possibly even including this one). If possible, I’d strongly suggest upgrading to the latest development version (download here).

There’s another line, though, that I think is related to the raster creation error messages:

08/26/2019 18:18:58  natcap.invest.habitat_quality DEBUG    Max distance in pixels: 17500000.000000

That’s a lot of pixels! So many, in fact, that it looks like it’s overflowed the integer counter that GDAL is using internally. Could you make sure that the threat rasters are all projected in meters and that they all have the same projection as the lulc raster? I’ve seen similarly large pixel distances appear when the threat rasters are unprojected.

Let us know how this goes!

Ach, I just realized I attached the wrong development build in my last post … could you try this development build instead?

Download link: https://storage.googleapis.com/releases.naturalcapitalproject.org/invest/3.7.0.post366+hc94dfedffddd/InVEST_3.7.0.post366+hc94dfedffddd_x86_Setup.exe

Thanks, and sorry about the confusion!

Hi! So I just updated my InVEST version and all my theat rasters have the same projection. Now I have a new error…InVEST-Habitat-Quality-log-2019-09-04–14_41_04.txt (1.5 KB)

Hmm … another user just posted this same error. I suspect it has to do with the formatting of your sensitivity table, so could you attach your sensitivity table so we can take a look?

Sure! Here it is:
sensitivity.csv (495 Bytes)

Ah! Ok, that’s really helpful … thank you! It turns out that there’s a bug early on in Habitat Quality that’s causing this error (due to an assumption it makes about the structure of the sensitivity table). Could you try this development build and make sure it runs through for you?