getOctD error when executing the module Biomass_borealDataPrep (development version) with

Skip to first unread message

Louis-Etienne Robert

Jan 8, 2020, 3:27:25 PM1/8/20
to SpaDES Users

I am running a clean version of Spades and all biomass module (development branch) using default values and I am running into an error when the kNN-species.tar file is being built. The invalid octal digit error usually mean that the .tar is empty or corrupted so the module doesn't seem to be downloading the proper NFI modis files from the ftp repository (49kb is very small for modis raster layers)  Does anybody have the same problem or know what could be the problem?

I have tried investigating the problem and I think it might reside in the sppEquivalencies_CA table where there is mismatch between file names for species modis file and table content (see code below). I do not know how the loadkNNSpeciesLayers function handle missing file from its sppEquiv argument upon connection to the ftp site, but an error there could explain why the results is an empty .tar. 

Entries from the Boreal column of sppEquivalencies_CA table that are not present on the ftp site.

+ other, I stopped trying at this point

I am open to suggestions....


######### Error log
Spade core v2.0.7
Biomass_borealDataPrep v1.4.0.9000 (development, Downloaded Jan 6 2020)

To reproduce download and execute the .rmd file of the biomass_borealDataPrep module (development branch) 

Terminal Log:

There is no 'sppEquiv' table supplied; will attempt to use species listed under 'Boreal' in the 'LandR::sppEquivalencies_CA' table
Preparing: kNN-Species.tar
Checking local files...
Finished checking local files.
Downloading: 49 kB     Checking local files...
Finished checking local files.
Downloaded file has no extension: both targetFile and archive are provided.
 Downloaded file will be considered as the archive.
Error in getOctD(x, offset, len) : invalid octal digit
In addition: Warning messages:
1: In .inputObjects(sim) : studyArea and rasterToMatch projections differ.
studyArea will be projected to match rasterToMatch
2: In .inputObjects(sim) :
 Error in getOctD(x, offset, len) : invalid octal digit 

#Problem line
Cache(loadkNNSpeciesLayers, dPath = dPath, rasterToMatch = sim$rasterToMatchLarge, 
    studyArea = sim$studyAreaLarge, sppEquiv = sim$sppEquiv, 
    knnNamesCol = "KNN", sppEquivCol = P(sim)$sppEquivCol, thresh = 10, 
    url = extractURL("speciesLayers"), userTags = c(cacheTags,  ... at Biomass_borealDataPrep.R#895

##### Spp equiv table dowloand code

#Using same code logic as the module

fileNames <- getHTMLLinks(dataurl)

#filter table
b<-b[!"", on = "Boreal"]

#download data and save
for (i in 1:nrow(b)){
  spfilename <- grep(paste0(spname,".*.tif$"), fileNames, value = TRUE)
  download.file(sppURL,paste0("YOURDIRECTORY", spfilename))

Ceres Barros

Jan 8, 2020, 5:11:51 PM1/8/20
to SpaDES Users

Hi Louis,


I’ve never had this problem, but we did update the KNN species cover data URLs recently. This could be causing your issue if you don’t have the last development version of the LandR package installed. Please try:

And try to re-run again.


I also have a another question regarding your issue. You said you’re running all biomass modules, but I only saw “Biomass_borealDataPrep” in your log. Is this the only module you’re attempting to run? If not, what other modules are you running?

Let me know if this helps.


Louis-Etienne Robert

Jan 10, 2020, 4:14:28 PM1/10/20
to SpaDES Users
Thanks for the help.

Problems updating LandR to a new version lead me to reinstall R, Rstudio, Spades and LandR. LandR refused to update itself because of a failed update of a dependencies (library map). After reinstalling everything from scratch,  I was successful at processing the Biomass DataPrep module

To answer your question. I certainly was unclear so I apologize for that, I am aiming at using all module but the starting point is the DataPreparation module. So yes it is currently the only module I am trying to run.


Ceres Barros

Jan 10, 2020, 6:35:28 PM1/10/20
to Louis-Etienne Robert, SpaDES Users

Wonderful, I’m glad it all worked!



You received this message because you are subscribed to the Google Groups "SpaDES Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to
To view this discussion on the web visit

Reply all
Reply to author
0 new messages