Error encountered:Line contains NULL byte

Hi,

I am trying to run the carbon sequestration model and I keep getting the

error encountered: line contains NULL byte message

what does this mean ?

Tagged:

Comments

  • swolnyswolny Member, NatCap Staff
    Hi @hildegaardl -

    Which version of InVEST are you running? 

    To help us troubleshoot, it's always useful for you to post your whole logfile that's generated when the model is run, then we can see where your error is happening - thanks!

    Offhand, I wonder if you have a blank line at the bottom of your carbon pool .csv file. If that's the case, try deleting it and rerunning. I might be able to help more after seeing the logfile.

    ~ Stacie


  • Hi ,



    I got a chance to look at your excellent tutorial on
    carbon sequestration this morning. I managed to generate a couple of maps
    making sure that my carbon pool table was in CSV format. Yay ! the most recent
    data run produced a map but had one error message. The run log is attached and
    below. It looks as though there is  a
    problem with my "c_above" column My carbon pool csv is also attached.



    Can you help me figure out where I have goofed ?



    Also



    Is it possible to get an error message that is trivial to
    the value of the output ? kind of like your oil light is on but when you look
    at the dipstick your oil reservoir is full ?



    Thanks



    Hildegaard



     



    12/29/2017 19:42:20 
    natcap.invest.utils INFO    
    Writing log messages to C:\Users\Hildegaard\OneDrive\Dissertation\Q2
    modeling,data,maps\NYS watershed data\InVEST-InVEST-Carbon-Model-log-2017-12-29--19_42_20.txt



    12/29/2017 19:42:20 
    natcap.invest.ui.model Level 100 Starting model with parameters:



    Arguments for InVEST natcap.invest.carbon 3.4.0:



    calc_sequestration False



    carbon_pools_path 
    C:/Users/Hildegaard/Dropbox/Dissertation/DisQ2/CarbonPoolEstimatesInvestNodoc.csv



    do_redd           
    False



    do_valuation      
    False



    lulc_cur_path     
    C:/Users/Hildegaard/OneDrive/Dissertation/Q2 modeling,data,maps/NYS
    watershed data/NYCwatershedscratch/nycwat4ershedprorasclip.tif



    results_suffix    
    hope2



    workspace_dir     
    C:\Users\Hildegaard\OneDrive\Dissertation\Q2 modeling,data,maps\NYS
    watershed data



     



    12/29/2017 19:42:20 
    natcap.invest.carbon INFO    
    Building file registry



    12/29/2017 19:42:21 
    natcap.invest.carbon INFO     Map
    all carbon pools to carbon storage rasters.



    12/29/2017 19:42:21 
    natcap.invest.ui.model ERROR   
    Exception while executing <function execute at 0x0E510570>



    Traceback (most recent call last):



      File
    "c:\users\natcap-servers\jenkins-home\workspace\natcap.invest\label\gce-windows-1\release_env\lib\site-packages\natcap\invest\ui\model.py",
    line 1496, in _logged_target



      File
    "c:\users\natcap-servers\jenkins-home\workspace\natcap.invest\label\gce-windows-1\release_env\lib\site-packages\natcap\invest\carbon.py",
    line 151, in execute



    KeyError: 'c_above'



    12/29/2017 19:42:21 
    natcap.invest.ui.model INFO    
    Execution finished



    12/29/2017 19:42:21 
    natcap.invest.utils INFO    
    Elapsed time: 1.0s



    here
    is the Log file
  • swolnyswolny Member, NatCap Staff
    edited December 2017
    Hi Hildegaard -

    I see that you're running InVEST 3.4.0. Would you mind trying the latest (3.4.2) and see if it still happens? Several bugs were fixed between these versions, I'm not sure if this is one, but let's just make sure. 

    Also, I don't see the carbon pool table attached - please try again - thanks!

    ~ Stacie

    Post edited by swolny on
  • HI thanks for your response, I tried to up load my carbon pol csv and the tool says uploaded file type is not allowed ? Grrrr

    HDL

  • swolnyswolny Member, NatCap Staff
    Shoot, that's right, and unfortunate. You can send it directly to me - swolny at stanford.edu.

    Or, you could have the carbon model app bundle up your data and send me the whole thing so I can try reproducing the error. Go to File -> Save as, then Datastack type "data archive". This is a new feature in InVEST 3.4 that it would be great to try out.

    ~ Stacie

  • swolnyswolny Member, NatCap Staff
    Thanks for sending me the data, Hildegaard. When I ran it on InVEST 3.4.2, I got the same error that you did. Everything looked ok in your carbon pool table, but Excel seemed to think that it was a "unicode .txt" file and not CSV. So I didn't change anything in the table, just re-saved as a "CSV comma-delimited" and no error.

    However, I did get a different error, indicating that there is a Value of 420 in your LULC raster that does not have a corresponding value in the carbon pool table. And sure enough, lucode 420 is missing in the .csv. So try changing the table format, and add a value for 420 to the .csv and see if that helps.

    ~ Stacie



Sign In or Register to comment.