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 cannot create "settings.json" #239

Closed
hewag1975 opened this issue Mar 30, 2022 · 4 comments
Closed

Whitebox cannot create "settings.json" #239

hewag1975 opened this issue Mar 30, 2022 · 4 comments
Labels
R repo This is better suited for the whiteboxR repository

Comments

@hewag1975
Copy link

Hi,
we are using whitebox-tools through the R-client from within a shiny-application.
Installation on our shiny-server was performed as documented here by

  • running install.packages("whitebox") as root (package directory is "/usr/local/lib/R/site-library")
  • running whitebox::install_whitebox() likewise as root which installs the WBT executable into the folder of the R-package

So far it was possible to use the app as a non-root user.
Today when calling wbt_slope (or any other function) the app crashed with the following error message in the log:
thread 'main' panicked at 'Error creating output settings.json file.: Os { code: 13, kind: PermissionDenied, message: "Permission denied" }', whitebox-common/src/configs/mod.rs:57:46 note: run with RUST_BACKTRACE=1 environment variable to display a backtrace

Error running WhiteboxTools (slope) whitebox.exe_path: '/usr/local/lib/R/site-library/whitebox/WBT/whitebox_tools'; File exists? TRUE Arguments: --run=slope --dem='' --output='/home/shiny/slope.tif' --units=degrees --compress_rasters=FALSE -v --max_procs=-1

To make sure that this is not related to the application itself I executed the code below on the same server in an R session as root user and in another session as non-root user (typically shiny users do not have root privileges) outside the application.

library(whitebox)
dem <- system.file("ex", "elev.tif", package="terra")
wbt_slope(dem, "/home/shiny/slope.tif")

In root mode the code calculates slope as expected and produces the output file.
In user mode I get the same error as when running the application.

I do not know if this is related to a recent update (the app was tested and running stable so far) and I am also not sure if it is related to the R-client or the exe.
Thankful for any hints on this.
Best,
Hendrik

@hewag1975
Copy link
Author

Ok, I just came across the NEWS of the R-client.
For version 2.1.1 it states:
Updated how --compress_rasters parameter is passed via command line. Now the flag is added to all commands regardless of whether the value is TRUE or FALSE. This allows update of settings.json accordingly when --compress_rasters=FALSE. RE: https://github.com/jblindsay/whitebox-tools/issues/233#issuecomment-1065955783

This causes the issue. I downgraded the R-package to version 2.1.0 which resolves the issue. Should the issue stay here or be moved to the R client?

@giswqs
Copy link
Contributor

giswqs commented Mar 30, 2022

Please open an issue on the whiteboxR repo.

@Afrancioni Afrancioni added the R repo This is better suited for the whiteboxR repository label Mar 30, 2022
@Afrancioni
Copy link
Collaborator

Thanks for your question @hewag1975 but I would agree with @giswqs .. this is better for the whiteboxR repo. The link can be found here https://github.com/giswqs/whiteboxR

I will keep this issue open for the time being.

@hewag1975
Copy link
Author

Ok, moved the issue to here

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
R repo This is better suited for the whiteboxR repository
Projects
None yet
Development

No branches or pull requests

3 participants