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

Unmanaged exception in upload_file when attempting to upload non-existent file #288

Open
gmolto opened this issue Nov 21, 2018 · 3 comments

Comments

@gmolto
Copy link
Member

gmolto commented Nov 21, 2018

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

@alpegon alpegon self-assigned this Nov 21, 2018
@alpegon
Copy link
Collaborator

alpegon commented Nov 22, 2018

I've created a new issue #292 regarding the last part of your message.

alpegon pushed a commit that referenced this issue Nov 22, 2018
alpegon pushed a commit that referenced this issue Nov 22, 2018
@alpegon
Copy link
Collaborator

alpegon commented Nov 22, 2018

Bug fixed in PR #294
We can continue the enhancement discussion in Issue #292

@alpegon alpegon closed this as completed Nov 22, 2018
@gmolto
Copy link
Member Author

gmolto commented Nov 23, 2018

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'

@gmolto gmolto reopened this Nov 23, 2018
@alpegon alpegon removed their assignment Sep 6, 2019
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