aws s3 cp returning `fatal error: [Errno 2] No such file or directory` when run from cloud-init runcmd
Describe the bug
I have the following command on the runcmd section of the cloud-init script
#cloud-config
repo_upgrade: all
repo_update: true
packages:
- python3
- python3-libselinux
- < plus a whole bunch more - not included, not relevent >
runcmd:
- set -x
- aws s3 cp s3://apigw-agents-installs-iacha-XXXXXXXXXXXX/NessusAgent-10.1.3-es8.x86_64.rpm /run/ec2-init/NessusAgent-10.1.3-es8.x86_64.rpm --region us-gov-west-1
- yum install -y /run/ec2-init/NessusAgent-10.1.3-es8.x86_64.rpm --nogpgcheck
Expected Behavior
I would expect the behavior for the download to work such as it does here: In this case I simply copied the line in the cloud-init-output.log and re-ran it and it worked.
# aws s3 cp s3://apigw-agents-installs-iacha-XXXXXXXXXXXX/NessusAgent-10.1.3-es8.x86_64.rpm /run/ec2-init/NessusAgent-10.1.3-es8.x86_64.rpm --region us-gov-west-1
download: s3://apigw-agents-installs-iacha-XXXXXXXXXXXX/NessusAgent-10.1.3-es8.x86_64.rpm to ../../run/ec2-init/NessusAgent-10.1.3-es8.x86_64.rpm
Current Behavior
The install currently returns the error: fatal error: [Errno 2] No such file or directory
+ aws s3 cp s3://apigw-agents-installs-iacha-XXXXXXXXXXXX/NessusAgent-10.1.3-es8.x86_64.rpm /run/ec2-init/NessusAgent-10.1.3-es8.x86_64.rpm --region us-gov-west-1
fatal error: [Errno 2] No such file or directory
If I simply copied the line in the cloud-init-output.log and re-ran it after the provision / boot, it all works.
Reproduction Steps
create a cloud-init.yaml file such as the one above and provision a new VM.
Possible Solution
not sure why
Additional Information/Context
the exact same results occurs on "Amazon Linux 2" as well as RHEL 8.6
CLI version used
aws-cli/2.7.19 Python/3.9.11 Linux/4.18.0-372.9.1.el8.x86_64 exe/x86_64.rhel.8 prompt/off
Environment details (OS name and version, etc.)
Red Hat Enterprise Linux 8.6 (Ootpa)
Hi @hectoralicea thanks for reaching out. Can you confirm that you're referencing the correct path for your file? I noticed the ../../run/ec2-init... path you mentioned is slightly different than the one in your script. You could also try reading through the debug logs to your command using --debug to get more insight into the behavior.
Can you confirm that you're referencing the correct path for your file?
yes, it is. Because I can run it following cloud-init startup and it works. the ../../run/ec2-init... path is only relative from where this command is running from. I'll add --debug to the cloud init script, and provide the results
You could also try reading through the debug logs to your command using
--debugto get more insight into the behavior.
Here you go. Not sure its showing anything interesting. I did change the S3 bucket name for confidentiality purposes, and scrubbed some of the displayed tokens.
+ aws s3 cp s3://apigw-agents-installs-iacha-XXXXXXXXXXXX/NessusAgent-10.1.3-amzn.x86_64.rpm /run/ec2-init/NessusAgent-10.1.3-amzn.x86_64.rpm --region us-go
v-west-1 --debug
2022-08-01 16:46:32,264 - MainThread - awscli.clidriver - DEBUG - CLI version: aws-cli/2.7.20 Python/3.9.11 Linux/5.4.149-73.259.amzn2.x86_64 exe/x86_64.amzn.2
2022-08-01 16:46:32,265 - MainThread - awscli.clidriver - DEBUG - Arguments entered to CLI: ['s3', 'cp', 's3://apigw-agents-installs-iacha-XXXXXXXXXXXX/Ness
usAgent-10.1.3-amzn.x86_64.rpm', '/run/ec2-init/NessusAgent-10.1.3-amzn.x86_64.rpm', '--region', 'us-gov-west-1', '--debug']
2022-08-01 16:46:32,283 - MainThread - botocore.hooks - DEBUG - Event building-command-table.main: calling handler <function add_s3 at 0x7fc26ace8550>
2022-08-01 16:46:32,283 - MainThread - botocore.hooks - DEBUG - Event building-command-table.main: calling handler <function add_ddb at 0x7fc26aec6040>
2022-08-01 16:46:32,284 - MainThread - botocore.hooks - DEBUG - Event building-command-table.main: calling handler <bound method BasicCommand.add_command of <class '
awscli.customizations.configure.configure.ConfigureCommand'>>
2022-08-01 16:46:32,285 - MainThread - botocore.hooks - DEBUG - Event building-command-table.main: calling handler <function change_name at 0x7fc26aee95e0>
2022-08-01 16:46:32,285 - MainThread - botocore.hooks - DEBUG - Event building-command-table.main: calling handler <function change_name at 0x7fc26aeee430>
2022-08-01 16:46:32,286 - MainThread - botocore.hooks - DEBUG - Event building-command-table.main: calling handler <function alias_opsworks_cm at 0x7fc26acf7ee0>
2022-08-01 16:46:32,286 - MainThread - botocore.hooks - DEBUG - Event building-command-table.main: calling handler <function add_history_commands at 0x7fc26ae0bb80>
2022-08-01 16:46:32,287 - MainThread - botocore.hooks - DEBUG - Event building-command-table.main: calling handler <bound method BasicCommand.add_command of <class '
awscli.customizations.devcommands.CLIDevCommand'>>
2022-08-01 16:46:32,287 - MainThread - botocore.hooks - DEBUG - Event building-command-table.main: calling handler <function add_waiters at 0x7fc26acf7160>
2022-08-01 16:46:32,288 - MainThread - botocore.loaders - DEBUG - Loading JSON file: /usr/local/aws-cli/v2/2.7.20/dist/awscli/data/cli.json
2022-08-01 16:46:32,292 - MainThread - botocore.hooks - DEBUG - Event top-level-args-parsed: calling handler <function resolve_types at 0x7fc26adb8e50>
2022-08-01 16:46:32,292 - MainThread - botocore.hooks - DEBUG - Event top-level-args-parsed: calling handler <function no_sign_request at 0x7fc26adbd9d0>
2022-08-01 16:46:32,293 - MainThread - botocore.hooks - DEBUG - Event top-level-args-parsed: calling handler <function resolve_verify_ssl at 0x7fc26adbd940>
2022-08-01 16:46:32,293 - MainThread - botocore.hooks - DEBUG - Event top-level-args-parsed: calling handler <function resolve_cli_read_timeout at 0x7fc26adbdaf0>
2022-08-01 16:46:32,294 - MainThread - botocore.hooks - DEBUG - Event top-level-args-parsed: calling handler <function resolve_cli_connect_timeout at 0x7fc26adbda60>
2022-08-01 16:46:32,295 - MainThread - botocore.hooks - DEBUG - Event top-level-args-parsed: calling handler <built-in method update of dict object at 0x7fc26ac18840
>
2022-08-01 16:46:32,295 - MainThread - botocore.session - DEBUG - Setting config variable for region to 'us-gov-west-1'
2022-08-01 16:46:32,332 - MainThread - awscli.clidriver - DEBUG - CLI version: aws-cli/2.7.20 Python/3.9.11 Linux/5.4.149-73.259.amzn2.x86_64 exe/x86_64.amzn.2 promp
t/off
2022-08-01 16:46:32,332 - MainThread - awscli.clidriver - DEBUG - Arguments entered to CLI: ['s3', 'cp', 's3://apigw-agents-installs-iacha-XXXXXXXXXXXX/Ness
usAgent-10.1.3-amzn.x86_64.rpm', '/run/ec2-init/NessusAgent-10.1.3-amzn.x86_64.rpm', '--region', 'us-gov-west-1', '--debug']
2022-08-01 16:46:32,332 - MainThread - botocore.hooks - DEBUG - Event session-initialized: calling handler <function add_timestamp_parser at 0x7fc26ace8b80>
2022-08-01 16:46:32,332 - MainThread - botocore.hooks - DEBUG - Event session-initialized: calling handler <function register_uri_param_handler at 0x7fc26b730310>
2022-08-01 16:46:32,332 - MainThread - botocore.hooks - DEBUG - Event session-initialized: calling handler <function add_binary_formatter at 0x7fc26ac58430>
2022-08-01 16:46:32,332 - MainThread - botocore.hooks - DEBUG - Event session-initialized: calling handler <function no_pager_handler at 0x7fc26b72b700>
2022-08-01 16:46:32,332 - MainThread - botocore.hooks - DEBUG - Event session-initialized: calling handler <function inject_assume_role_provider_cache at 0x7fc26b712
160>
2022-08-01 16:46:32,333 - MainThread - botocore.utils - DEBUG - IMDS ENDPOINT: http://169.254.169.254/
2022-08-01 16:46:32,335 - MainThread - botocore.hooks - DEBUG - Event session-initialized: calling handler <function attach_history_handler at 0x7fc26ae0ba60>
2022-08-01 16:46:32,336 - MainThread - botocore.hooks - DEBUG - Event session-initialized: calling handler <function inject_json_file_cache at 0x7fc26aec2e50>
2022-08-01 16:46:32,336 - MainThread - botocore.hooks - DEBUG - Event building-command-table.s3: calling handler <function add_waiters at 0x7fc26acf7160>
2022-08-01 16:46:32,342 - MainThread - botocore.hooks - DEBUG - Event load-cli-arg.custom.s3.anonymous: calling handler <awscli.paramfile.URIArgumentHandler object a
t 0x7fc26a1e01c0>
2022-08-01 16:46:32,342 - MainThread - botocore.hooks - DEBUG - Event building-command-table.s3_cp: calling handler <function add_waiters at 0x7fc26acf7160>
2022-08-01 16:46:32,346 - MainThread - botocore.hooks - DEBUG - Event load-cli-arg.custom.cp.paths: calling handler <awscli.paramfile.URIArgumentHandler object at 0x
7fc26a1e01c0>
2022-08-01 16:46:32,346 - MainThread - botocore.hooks - DEBUG - Event load-cli-arg.custom.cp.dryrun: calling handler <awscli.paramfile.URIArgumentHandler object at 0
x7fc26a1e01c0>
2022-08-01 16:46:32,346 - MainThread - botocore.hooks - DEBUG - Event process-cli-arg.custom.cp: calling handler <awscli.argprocess.ParamShorthandParser object at 0x
7fc26f36f5b0>
2022-08-01 16:46:32,347 - MainThread - botocore.hooks - DEBUG - Event load-cli-arg.custom.cp.quiet: calling handler <awscli.paramfile.URIArgumentHandler object at 0x
7fc26a1e01c0>
2022-08-01 16:46:32,347 - MainThread - botocore.hooks - DEBUG - Event process-cli-arg.custom.cp: calling handler <awscli.argprocess.ParamShorthandParser object at 0x
7fc26f36f5b0>
2022-08-01 16:46:32,347 - MainThread - botocore.hooks - DEBUG - Event load-cli-arg.custom.cp.anonymous: calling handler <awscli.paramfile.URIArgumentHandler object a
t 0x7fc26a1e01c0>
2022-08-01 16:46:32,347 - MainThread - botocore.hooks - DEBUG - Event load-cli-arg.custom.cp.acl: calling handler <awscli.paramfile.URIArgumentHandler object at 0x7f
c26a1e01c0>
2022-08-01 16:46:32,347 - MainThread - botocore.hooks - DEBUG - Event load-cli-arg.custom.cp.follow-symlinks: calling handler <awscli.paramfile.URIArgumentHandler ob
ject at 0x7fc26a1e01c0>
2022-08-01 16:46:32,347 - MainThread - botocore.hooks - DEBUG - Event process-cli-arg.custom.cp: calling handler <awscli.argprocess.ParamShorthandParser object at 0x
7fc26f36f5b0>
2022-08-01 16:46:32,347 - MainThread - botocore.hooks - DEBUG - Event load-cli-arg.custom.cp.anonymous: calling handler <awscli.paramfile.URIArgumentHandler object a
t 0x7fc26a1e01c0>
2022-08-01 16:46:32,347 - MainThread - botocore.hooks - DEBUG - Event load-cli-arg.custom.cp.sse: calling handler <awscli.paramfile.URIArgumentHandler object at 0x7f
c26a1e01c0>
2022-08-01 16:46:32,347 - MainThread - botocore.hooks - DEBUG - Event load-cli-arg.custom.cp.sse-c: calling handler <awscli.paramfile.URIArgumentHandler object at 0x
7fc26a1e01c0>
2022-08-01 16:46:32,347 - MainThread - botocore.hooks - DEBUG - Event load-cli-arg.custom.cp.sse-c-key: calling handler <awscli.paramfile.URIArgumentHandler object a
t 0x7fc26a1e01c0>
2022-08-01 16:46:32,347 - MainThread - botocore.hooks - DEBUG - Event load-cli-arg.custom.cp.sse-kms-key-id: calling handler <awscli.paramfile.URIArgumentHandler obj
ect at 0x7fc26a1e01c0>
2022-08-01 16:46:32,348 - MainThread - botocore.hooks - DEBUG - Event load-cli-arg.custom.cp.sse-c-copy-source: calling handler <awscli.paramfile.URIArgumentHandler
object at 0x7fc26a1e01c0>
2022-08-01 16:46:32,348 - MainThread - botocore.hooks - DEBUG - Event load-cli-arg.custom.cp.sse-c-copy-source-key: calling handler <awscli.paramfile.URIArgumentHand
ler object at 0x7fc26a1e01c0>
2022-08-01 16:46:32,348 - MainThread - botocore.hooks - DEBUG - Event load-cli-arg.custom.cp.storage-class: calling handler <awscli.paramfile.URIArgumentHandler obje
ct at 0x7fc26a1e01c0>
2022-08-01 16:46:32,348 - MainThread - botocore.hooks - DEBUG - Event load-cli-arg.custom.cp.grants: calling handler <awscli.paramfile.URIArgumentHandler object at 0
x7fc26a1e01c0>
2022-08-01 16:46:32,348 - MainThread - botocore.hooks - DEBUG - Event load-cli-arg.custom.cp.website-redirect: calling handler <awscli.paramfile.URIArgumentHandler o
bject at 0x7fc26a1e01c0>
2022-08-01 16:46:32,348 - MainThread - botocore.hooks - DEBUG - Event load-cli-arg.custom.cp.content-type: calling handler <awscli.paramfile.URIArgumentHandler objec
t at 0x7fc26a1e01c0>
2022-08-01 16:46:32,348 - MainThread - botocore.hooks - DEBUG - Event load-cli-arg.custom.cp.cache-control: calling handler <awscli.paramfile.URIArgumentHandler obje
ct at 0x7fc26a1e01c0>
2022-08-01 16:46:32,348 - MainThread - botocore.hooks - DEBUG - Event load-cli-arg.custom.cp.content-disposition: calling handler <awscli.paramfile.URIArgumentHandle
r object at 0x7fc26a1e01c0>
2022-08-01 16:46:32,348 - MainThread - botocore.hooks - DEBUG - Event load-cli-arg.custom.cp.content-encoding: calling handler <awscli.paramfile.URIArgumentHandler o
bject at 0x7fc26a1e01c0>
2022-08-01 16:46:32,348 - MainThread - botocore.hooks - DEBUG - Event load-cli-arg.custom.cp.content-language: calling handler <awscli.paramfile.URIArgumentHandler o
bject at 0x7fc26a1e01c0>
2022-08-01 16:46:32,348 - MainThread - botocore.hooks - DEBUG - Event load-cli-arg.custom.cp.expires: calling handler <awscli.paramfile.URIArgumentHandler object at
0x7fc26a1e01c0>
2022-08-01 16:46:32,348 - MainThread - botocore.hooks - DEBUG - Event load-cli-arg.custom.cp.source-region: calling handler <awscli.paramfile.URIArgumentHandler obje
ct at 0x7fc26a1e01c0>
2022-08-01 16:46:32,349 - MainThread - botocore.hooks - DEBUG - Event load-cli-arg.custom.cp.only-show-errors: calling handler <awscli.paramfile.URIArgumentHandler o
bject at 0x7fc26a1e01c0>
2022-08-01 16:46:32,349 - MainThread - botocore.hooks - DEBUG - Event process-cli-arg.custom.cp: calling handler <awscli.argprocess.ParamShorthandParser object at 0x
7fc26f36f5b0>
2022-08-01 16:46:32,349 - MainThread - botocore.hooks - DEBUG - Event load-cli-arg.custom.cp.anonymous: calling handler <awscli.paramfile.URIArgumentHandler object a
t 0x7fc26a1e01c0>
2022-08-01 16:46:32,349 - MainThread - botocore.hooks - DEBUG - Event load-cli-arg.custom.cp.page-size: calling handler <awscli.paramfile.URIArgumentHandler object a
t 0x7fc26a1e01c0>
2022-08-01 16:46:32,349 - MainThread - botocore.hooks - DEBUG - Event load-cli-arg.custom.cp.ignore-glacier-warnings: calling handler <awscli.paramfile.URIArgumentHa
ndler object at 0x7fc26a1e01c0>
2022-08-01 16:46:32,349 - MainThread - botocore.hooks - DEBUG - Event process-cli-arg.custom.cp: calling handler <awscli.argprocess.ParamShorthandParser object at 0x
7fc26f36f5b0>
2022-08-01 16:46:32,349 - MainThread - botocore.hooks - DEBUG - Event load-cli-arg.custom.cp.force-glacier-transfer: calling handler <awscli.paramfile.URIArgumentHan
dler object at 0x7fc26a1e01c0>
2022-08-01 16:46:32,349 - MainThread - botocore.hooks - DEBUG - Event process-cli-arg.custom.cp: calling handler <awscli.argprocess.ParamShorthandParser object at 0x
7fc26f36f5b0>
2022-08-01 16:46:32,349 - MainThread - botocore.hooks - DEBUG - Event load-cli-arg.custom.cp.request-payer: calling handler <awscli.paramfile.URIArgumentHandler obje
ct at 0x7fc26a1e01c0>
2022-08-01 16:46:32,349 - MainThread - botocore.hooks - DEBUG - Event load-cli-arg.custom.cp.metadata: calling handler <awscli.paramfile.URIArgumentHandler object at
0x7fc26a1e01c0>
2022-08-01 16:46:32,349 - MainThread - botocore.hooks - DEBUG - Event load-cli-arg.custom.cp.copy-props: calling handler <awscli.paramfile.URIArgumentHandler object
at 0x7fc26a1e01c0>
2022-08-01 16:46:32,349 - MainThread - botocore.hooks - DEBUG - Event process-cli-arg.custom.cp: calling handler <awscli.argprocess.ParamShorthandParser object at 0x
7fc26f36f5b0>
2022-08-01 16:46:32,350 - MainThread - botocore.hooks - DEBUG - Event load-cli-arg.custom.cp.metadata-directive: calling handler <awscli.paramfile.URIArgumentHandler
object at 0x7fc26a1e01c0>
2022-08-01 16:46:32,350 - MainThread - botocore.hooks - DEBUG - Event load-cli-arg.custom.cp.expected-size: calling handler <awscli.paramfile.URIArgumentHandler obje
ct at 0x7fc26a1e01c0>
2022-08-01 16:46:32,350 - MainThread - botocore.hooks - DEBUG - Event load-cli-arg.custom.cp.anonymous: calling handler <awscli.paramfile.URIArgumentHandler object a
t 0x7fc26a1e01c0>
2022-08-01 16:46:32,352 - MainThread - botocore.credentials - DEBUG - Looking for credentials via: env
2022-08-01 16:46:32,352 - MainThread - botocore.credentials - DEBUG - Looking for credentials via: assume-role
2022-08-01 16:46:32,352 - MainThread - botocore.credentials - DEBUG - Looking for credentials via: assume-role-with-web-identity
2022-08-01 16:46:32,353 - MainThread - botocore.credentials - DEBUG - Looking for credentials via: sso
2022-08-01 16:46:32,353 - MainThread - botocore.credentials - DEBUG - Looking for credentials via: shared-credentials-file
2022-08-01 16:46:32,353 - MainThread - botocore.credentials - DEBUG - Looking for credentials via: custom-process
2022-08-01 16:46:32,353 - MainThread - botocore.credentials - DEBUG - Looking for credentials via: config-file
2022-08-01 16:46:32,353 - MainThread - botocore.credentials - DEBUG - Looking for credentials via: ec2-credentials-file
2022-08-01 16:46:32,353 - MainThread - botocore.credentials - DEBUG - Looking for credentials via: boto-config
2022-08-01 16:46:32,353 - MainThread - botocore.credentials - DEBUG - Looking for credentials via: container-role
2022-08-01 16:46:32,353 - MainThread - botocore.credentials - DEBUG - Looking for credentials via: iam-role
2022-08-01 16:46:32,354 - MainThread - urllib3.connectionpool - DEBUG - Starting new HTTP connection (1): 169.254.169.254:80
2022-08-01 16:46:32,356 - MainThread - urllib3.connectionpool - DEBUG - http://169.254.169.254:80 "PUT /latest/api/token HTTP/1.1" 200 56
2022-08-01 16:46:32,357 - MainThread - urllib3.connectionpool - DEBUG - Resetting dropped connection: 169.254.169.254
2022-08-01 16:46:32,358 - MainThread - urllib3.connectionpool - DEBUG - http://169.254.169.254:80 "GET /latest/meta-data/iam/security-credentials/ HTTP/1.1" 200 19
2022-08-01 16:46:32,359 - MainThread - urllib3.connectionpool - DEBUG - Resetting dropped connection: 169.254.169.254
2022-08-01 16:46:32,360 - MainThread - urllib3.connectionpool - DEBUG - http://169.254.169.254:80 "GET /latest/meta-data/iam/security-credentials/ManagedInstanceRole
HTTP/1.1" 200 1062
2022-08-01 16:46:32,364 - MainThread - botocore.credentials - DEBUG - Found credentials from IAM Role: ManagedInstanceRole
2022-08-01 16:46:32,365 - MainThread - botocore.loaders - DEBUG - Loading JSON file: /usr/local/aws-cli/v2/2.7.20/dist/awscli/botocore/data/endpoints.json
2022-08-01 16:46:32,393 - MainThread - botocore.hooks - DEBUG - Event choose-service-name: calling handler <function handle_service_name_alias at 0x7fc26d4cb550>
2022-08-01 16:46:32,413 - MainThread - botocore.loaders - DEBUG - Loading JSON file: /usr/local/aws-cli/v2/2.7.20/dist/awscli/botocore/data/s3/2006-03-01/service-2.j
son
2022-08-01 16:46:32,435 - MainThread - botocore.hooks - DEBUG - Event creating-client-class.s3: calling handler <function add_generate_presigned_post at 0x7fc26d54df
70>
2022-08-01 16:46:32,435 - MainThread - botocore.hooks - DEBUG - Event creating-client-class.s3: calling handler <function add_generate_presigned_url at 0x7fc26d54dd3
0>
2022-08-01 16:46:32,441 - MainThread - botocore.endpoint - DEBUG - Setting s3 timeout as (60, 60)
2022-08-01 16:46:32,443 - MainThread - botocore.hooks - DEBUG - Event choose-service-name: calling handler <function handle_service_name_alias at 0x7fc26d4cb550>
2022-08-01 16:46:32,445 - MainThread - botocore.hooks - DEBUG - Event creating-client-class.s3: calling handler <function add_generate_presigned_post at 0x7fc26d54df
70>
2022-08-01 16:46:32,445 - MainThread - botocore.hooks - DEBUG - Event creating-client-class.s3: calling handler <function add_generate_presigned_url at 0x7fc26d54dd3
0>
2022-08-01 16:46:32,450 - MainThread - botocore.endpoint - DEBUG - Setting s3 timeout as (60, 60)
2022-08-01 16:46:32,451 - MainThread - botocore.hooks - DEBUG - Event choose-service-name: calling handler <function handle_service_name_alias at 0x7fc26d4cb550>
2022-08-01 16:46:32,461 - MainThread - botocore.hooks - DEBUG - Event creating-client-class.s3: calling handler <function add_generate_presigned_post at 0x7fc26d54df
70>
2022-08-01 16:46:32,461 - MainThread - botocore.hooks - DEBUG - Event creating-client-class.s3: calling handler <function add_generate_presigned_url at 0x7fc26d54dd3
0>
2022-08-01 16:46:32,466 - MainThread - botocore.endpoint - DEBUG - Setting s3 timeout as (60, 60)
2022-08-01 16:46:32,467 - MainThread - awscli.customizations.s3.factory - DEBUG - Using a multipart threshold of 8388608 and a part size of 8388608
2022-08-01 16:46:32,468 - MainThread - botocore.hooks - DEBUG - Event provide-client-params.s3.HeadObject: calling handler <function base64_decode_input_blobs at 0x7
fc26ac58b80>
2022-08-01 16:46:32,469 - MainThread - botocore.hooks - DEBUG - Event before-parameter-build.s3.HeadObject: calling handler <function sse_md5 at 0x7fc26d4e4790>
2022-08-01 16:46:32,469 - MainThread - botocore.hooks - DEBUG - Event before-parameter-build.s3.HeadObject: calling handler <function validate_bucket_name at 0x7fc26
d4e4700>
2022-08-01 16:46:32,469 - MainThread - botocore.hooks - DEBUG - Event before-parameter-build.s3.HeadObject: calling handler <bound method S3RegionRedirector.redirect
_from_cache of <botocore.utils.S3RegionRedirector object at 0x7fc269aca100>>
2022-08-01 16:46:32,469 - MainThread - botocore.hooks - DEBUG - Event before-parameter-build.s3.HeadObject: calling handler <bound method S3ArnParamHandler.handle_ar
n of <botocore.utils.S3ArnParamHandler object at 0x7fc269aca190>>
2022-08-01 16:46:32,469 - MainThread - botocore.hooks - DEBUG - Event before-parameter-build.s3.HeadObject: calling handler <function generate_idempotent_uuid at 0x7
fc26d4e4550>
2022-08-01 16:46:32,470 - MainThread - botocore.hooks - DEBUG - Event before-call.s3.HeadObject: calling handler <function add_expect_header at 0x7fc26d4e4a60>
2022-08-01 16:46:32,470 - MainThread - botocore.hooks - DEBUG - Event before-call.s3.HeadObject: calling handler <bound method S3RegionRedirector.set_request_url of
<botocore.utils.S3RegionRedirector object at 0x7fc269aca100>>
2022-08-01 16:46:32,470 - MainThread - botocore.hooks - DEBUG - Event before-call.s3.HeadObject: calling handler <function inject_api_version_header_if_needed at 0x7
fc26d4e8dc0>
2022-08-01 16:46:32,470 - MainThread - botocore.endpoint - DEBUG - Making request for OperationModel(name=HeadObject) with params: {'url_path': '/apigw-agents-instal
ls-iacha-XXXXXXXXXXXX/NessusAgent-10.1.3-amzn.x86_64.rpm', 'query_string': {}, 'method': 'HEAD', 'headers': {'User-Agent': 'aws-cli/2.7.20 Python/3.9.11 Lin
ux/5.4.149-73.259.amzn2.x86_64 exe/x86_64.amzn.2 prompt/off command/s3.cp'}, 'body': b'', 'url': 'https://s3.us-gov-west-1.amazonaws.com/apigw-agents-installs-iacha-
XXXXXXXXXXXX/NessusAgent-10.1.3-amzn.x86_64.rpm', 'context': {'client_region': 'us-gov-west-1', 'client_config': <botocore.config.Config object at 0x7fc269b
0f580>, 'has_streaming_input': False, 'auth_type': None, 'signing': {'bucket': 'apigw-agents-installs-iacha-XXXXXXXXXXXX'}}}
2022-08-01 16:46:32,471 - MainThread - botocore.hooks - DEBUG - Event request-created.s3.HeadObject: calling handler <bound method RequestSigner.handler of <botocore
.signers.RequestSigner object at 0x7fc269b0f520>>
2022-08-01 16:46:32,471 - MainThread - botocore.hooks - DEBUG - Event choose-signer.s3.HeadObject: calling handler <bound method S3EndpointSetter.set_signer of <boto
core.utils.S3EndpointSetter object at 0x7fc269aca1f0>>
2022-08-01 16:46:32,471 - MainThread - botocore.hooks - DEBUG - Event choose-signer.s3.HeadObject: calling handler <function set_operation_specific_signer at 0x7fc26
d4e4430>
2022-08-01 16:46:32,471 - MainThread - botocore.hooks - DEBUG - Event before-sign.s3.HeadObject: calling handler <bound method S3EndpointSetter.set_endpoint of <boto
core.utils.S3EndpointSetter object at 0x7fc269aca1f0>>
2022-08-01 16:46:32,471 - MainThread - botocore.utils - DEBUG - Defaulting to S3 virtual host style addressing with path style addressing fallback.
2022-08-01 16:46:32,471 - MainThread - botocore.utils - DEBUG - Checking for DNS compatible bucket for: https://s3.us-gov-west-1.amazonaws.com/apigw-agents-installs-
iacha-XXXXXXXXXXXX/NessusAgent-10.1.3-amzn.x86_64.rpm
2022-08-01 16:46:32,471 - MainThread - botocore.utils - DEBUG - URI updated to: https://apigw-agents-installs-iacha-XXXXXXXXXXXX.s3.us-gov-west-1.amazonaws.
com/NessusAgent-10.1.3-amzn.x86_64.rpm
2022-08-01 16:46:32,472 - MainThread - botocore.auth - DEBUG - Calculating signature using v4 auth.
2022-08-01 16:46:32,472 - MainThread - botocore.auth - DEBUG - CanonicalRequest:
HEAD
/NessusAgent-10.1.3-amzn.x86_64.rpm
host:apigw-agents-installs-iacha-XXXXXXXXXXXX.s3.us-gov-west-1.amazonaws.com
x-amz-content-sha256:e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855
x-amz-date:20220801T164632Z
x-amz-security-token:....M4M=
host;x-amz-content-sha256;x-amz-date;x-amz-security-token
e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855
2022-08-01 16:46:32,472 - MainThread - botocore.auth - DEBUG - StringToSign:
AWS4-HMAC-SHA256
20220801T164632Z
20220801/us-gov-west-1/s3/aws4_request
c4f93eba535694a609c0adb7565448617e4c933d79f55976940800dbed056571
2022-08-01 16:46:32,472 - MainThread - botocore.auth - DEBUG - Signature:
e8eca376d563798b719139360c4b55364f13cb4d0a8d1732c69fac825ec1ceae
2022-08-01 16:46:32,472 - MainThread - botocore.endpoint - DEBUG - Sending http request: <AWSPreparedRequest stream_output=False, method=HEAD, url=https://apigw-agen
ts-installs-iacha-XXXXXXXXXXXX.s3.us-gov-west-1.amazonaws.com/NessusAgent-10.1.3-amzn.x86_64.rpm, headers={'User-Agent': b'aws-cli/2.7.20 Python/3.9.11 Linu
x/5.4.149-73.259.amzn2.x86_64 exe/x86_64.amzn.2 prompt/off command/s3.cp', 'X-Amz-Date': b'20220801T164632Z', 'X-Amz-Security-Token': b'....M4M=', 'X-Amz-Content-SHA256': b'e3b0c44298fc1c149
afbf4c8996fb92427ae41e4649b934ca495991b7852b855', 'Authorization': b'AWS4-HMAC-SHA256 Credential=XXXXXX/20220801/us-gov-west-1/s3/aws4_request, SignedH
eaders=host;x-amz-content-sha256;x-amz-date;x-amz-security-token, Signature=e8eca376d563798b719139360c4b55364f13cb4d0a8d1732c69fac825ec1ceae'}>
2022-08-01 16:46:32,473 - MainThread - botocore.httpsession - DEBUG - Certificate path: /usr/local/aws-cli/v2/2.7.20/dist/awscli/botocore/cacert.pem
2022-08-01 16:46:32,473 - MainThread - urllib3.connectionpool - DEBUG - Starting new HTTPS connection (1): apigw-agents-installs-iacha-XXXXXXXXXXXX.s3.us-go
v-west-1.amazonaws.com:443
2022-08-01 16:46:32,817 - MainThread - urllib3.connectionpool - DEBUG - https://apigw-agents-installs-iacha-XXXXXXXXXXXX.s3.us-gov-west-1.amazonaws.com:443
"HEAD /NessusAgent-10.1.3-amzn.x86_64.rpm HTTP/1.1" 200 0
2022-08-01 16:46:32,826 - MainThread - botocore.parsers - DEBUG - Response headers: {'x-amz-id-2': 'WxlTbYipsBoPLuZjTtXqATCALLL0NDjb0I9JkaelUUBPttnae7HrW1AkRjPSdFkY0
oaQNMPQr3A=', 'x-amz-request-id': '18K5VYJ833SF3P3J', 'Date': 'Mon, 01 Aug 2022 16:46:33 GMT', 'Last-Modified': 'Thu, 21 Jul 2022 20:40:43 GMT', 'ETag': '"c20fd13df7
e6579b06a2980e201b6a3e"', 'Accept-Ranges': 'bytes', 'Content-Type': 'binary/octet-stream', 'Server': 'AmazonS3', 'Content-Length': '15154021'}
2022-08-01 16:46:32,844 - MainThread - botocore.parsers - DEBUG - Response body:
b''
2022-08-01 16:46:32,846 - MainThread - botocore.hooks - DEBUG - Event needs-retry.s3.HeadObject: calling handler <bound method RetryHandler.needs_retry of <botocore.
retries.standard.RetryHandler object at 0x7fc269aca070>>
2022-08-01 16:46:32,846 - MainThread - botocore.retries.standard - DEBUG - Not retrying request.
2022-08-01 16:46:32,846 - MainThread - botocore.hooks - DEBUG - Event needs-retry.s3.HeadObject: calling handler <bound method S3RegionRedirector.redirect_from_error
of <botocore.utils.S3RegionRedirector object at 0x7fc269aca100>>
2022-08-01 16:46:32,846 - MainThread - botocore.hooks - DEBUG - Event after-call.s3.HeadObject: calling handler <function enhance_error_msg at 0x7fc26ace8790>
2022-08-01 16:46:32,846 - MainThread - botocore.hooks - DEBUG - Event after-call.s3.HeadObject: calling handler <bound method RetryQuotaChecker.release_retry_quota o
f <botocore.retries.standard.RetryQuotaChecker object at 0x7fc269b0fb20>>
2022-08-01 16:46:32,847 - MainThread - awscli.customizations.s3.results - DEBUG - Exception caught during command execution: [Errno 2] No such file or directory
Traceback (most recent call last):
File "awscli/customizations/s3/s3handler.py", line 152, in call
File "awscli/customizations/s3/s3handler.py", line 202, in submit
File "awscli/customizations/s3/s3handler.py", line 222, in _do_submit
File "awscli/customizations/s3/s3handler.py", line 228, in _get_subscribers
File "awscli/customizations/s3/s3handler.py", line 242, in _get_result_subscriber_kwargs
File "awscli/customizations/s3/s3handler.py", line 412, in _format_src_dest
File "awscli/customizations/s3/s3handler.py", line 332, in _format_local_path
File "awscli/customizations/s3/utils.py", line 362, in relative_path
File "posixpath.py", line 472, in relpath
File "posixpath.py", line 380, in abspath
FileNotFoundError: [Errno 2] No such file or directory
fatal error: [Errno 2] No such file or directory
Hi @hectoralicea apologies for the delay in responding but I was not able to reproduce this issue or find any similar reports of it occurring. Are you still seeing this issue? If so then my suggestion would be to try reinstalling the AWS CLI following the documented steps and try this again on the latest version.
Somehow the issue has gone away. Not sure what I did, whether I just ignored it and move on or I just fix it. I will close this ticket.
⚠️COMMENT VISIBILITY WARNING⚠️
Comments on closed issues are hard for our team to see. If you need more assistance, please open a new issue that references this one. If you wish to keep having a conversation with other community members under this issue feel free to do so.