scar
scar copied to clipboard
Unmanaged exception in upload_file when attempting to upload non-existent file
Trying to upload a non-existent file through scar put
yields the following error:
There was an unmanaged exception in upload_file
while the $HOME/.scar/scar.log
file clearly indicates the error:
2018-11-21 17:06:46,225 - root - INFO - SCAR execution finished with errors
FileNotFoundError: [Errno 2] No such file or directory: '../ffmpeg/seq2.avi'
with open(file_path, mode) as content_file:
File "/Users/gmolto/Documents/GitHub/grycap/scar/src/utils.py", line 152, in read_file
kwargs['Body'] = utils.read_file(file_path, 'rb')
File "/Users/gmolto/Documents/GitHub/grycap/scar/src/providers/aws/s3.py", line 102, in upload_file
return func(*args, **kwargs)
File "/Users/gmolto/Documents/GitHub/grycap/scar/src/exceptions.py", line 29, in wrapper
Traceback (most recent call last):
2018-11-21 17:06:46,220 - root - ERROR - [Errno 2] No such file or directory: '../ffmpeg/seq2.avi'
Expected behaviour: Indicate that the file does not exist.
Related to this, it would be convenient to have the following syntax:
scar put -f function.yaml -p /path/to/file.txt
This way, the input bucket and input folder would be obtained from the function description in order to reduce verbosity when dealing with Amazon S3.
Same for scar get
and scar ls
:-D
I've created a new issue #292 regarding the last part of your message.
Bug fixed in PR #294 We can continue the enhancement discussion in Issue #292
The same obscure error is obtained when trying to create a function out of a file that references a non-existent file:
unctions:
scar-alpine:
image: alpine
memory: 128
init_script: non-existent-file.sh
scar init -f scar-function.yaml
Info: installing 1.1.3 Packing udocker files There was an unmanaged exception in prepare_lambda_code
Expected behaviour: Output the error message from the exception (which is included in the log): 2018-11-23 13:27:35,333 - root - ERROR - [Errno 2] No such file or directory: 'non-existent-file.sh'