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

More relevant error message when a file to be registered is not located in the SAFE_DIR #6700

Open
3 tasks
mkutouski opened this issue Aug 29, 2024 · 0 comments

Comments

@mkutouski
Copy link
Contributor

Description
One needs to provide more relevant error message when the file an user trying to register in the DS is not located in any of the directories listed in the SAFE_DIR attribute.

To Reproduce

$ ls -al /home/test/test.sh 
-rwxrwxr-x 1 test test 223 Aug 29 07:53 /home/test/test.sh

$ oneimage create --name test.sh --path test.sh --datastore files --type CONTEXT
[one.image.allocate] Cannot parse image SIZE: File not found

Expected behavior
The error message should be more clear when the file the user is trying to register in the DS is NOT located in any of allowed dirs listed in the SAFE_DIR attributes. It may be worth to provide a recommendation on possible actions. So the full error message might be e.g. as below:

The file $file you are trying to register in the $DS datastore is NOT located in any of allowed directories listed in the SAFE_DIR attribute: <list all allowed dirs here>. Please, either copy/move your file to one of the SAFE_DIR or contact cloud system administrator to extend the list of safe directories with one you are trying to register the file from.

Details

  • Affected Component: Datastore
  • Version: 6.8.3

Progress Status

  • Code committed
  • Testing - QA
  • Documentation (Release notes - resolved issues, compatibility, known issues)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants