Skip to content
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

Whitebox will not run any tools with error thread 'main' panicked #62

Closed
EmFidan opened this issue Feb 24, 2022 · 3 comments
Closed

Whitebox will not run any tools with error thread 'main' panicked #62

EmFidan opened this issue Feb 24, 2022 · 3 comments

Comments

@EmFidan
Copy link

EmFidan commented Feb 24, 2022

I have been using WhiteBox through the R interface for a while now. I haven't had any issues with running wbt functions before, except this week.
I have been trying to run simple DEM processing and watershed commands such as:

watersheds_r <- wbt_watershed(d8_pntr = "~/Desktop/NC_Processed_Geospatial_Data/Elevation/FlowDir_D8.tif", 
pour_pts = "~/Desktop/Projects/Flood_WQ_Modeling/Data/GIS/R_Outputs/snapped_pour_points.shp", 
output = "~/Desktop/Projects/Flood_WQ_Modeling/Data/GIS/R_Outputs/watersheds.tif")

The error I have been receiving is:

thread 'main' panicked at 'No such file or directory (os error 2)', whitebox-tools-app/src/main.rs:72:21
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace

Error running WhiteboxTools (watershed)
  whitebox.exe_path: '/Library/Frameworks/R.framework/Versions/4.1/Resources/library/whitebox/WBT/whitebox_tools'; File exists? TRUE
  Arguments: --run=watershed  --d8_pntr=~/Desktop/NC_Processed_Geospatial_Data/Elevation/FlowDir_D8.tif --pour_pts=~/Desktop/Projects/Flood_WQ_Modeling/Data/GIS/R_Outputs/snapped_pour_points.shp --output=~/Desktop/Projects/Flood_WQ_Modeling/Data/GIS/R_Outputs/watersheds.tif -v

System command had status 101
watershed - Elapsed Time: NA [did not run]

I have the executable files present, thanks to the install_whitebox function, and I have trying to debug with no luck. The DEM is pretty large but I used Whitebox tools to previously process this same DEM with no issues. Any ideas what might be causing this?

@brownag
Copy link
Member

brownag commented Feb 24, 2022

I think the issue is use of ~ to refer to your home directory. Currently there is no path expansion of the tilde with e.g. path.expand() call wrapping input/output paths, so you either need to set your WBT working directory to (full path of) your home directory and use relative paths (starting with "./") or use the full file paths.

@EmFidan
Copy link
Author

EmFidan commented Feb 25, 2022

It appears that was the issue. Coincidentally, that was the one thing I had not tested. Thank you for catching that!

@EmFidan EmFidan closed this as completed Feb 25, 2022
@brownag
Copy link
Member

brownag commented Feb 25, 2022

I will look into an update that can make path expansion work with the various wbt_ functions. I think it is reasonable to expect R functions with file path arguments to do path expansion. Thanks for reporting the issue.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants