CodePipeline Deployment error "Invalid argument @ rb_sysopen - C:\ProgramData/Amazon/CodeDeploy/xxxxxxxx/xxxxxx/deployment-archive\*.*"

I am struggling to troubleshoot my CodePipeline that fails in Install event of Deployment stage with the following error:

Invalid argument @ rb_sysopen - C:\ProgramData/Amazon/CodeDeploy/0df66877-d62c-49b0-81b6-a2b98509ed51/d-DC1Q553XH/deployment-archive*.*

enter image description here

I can see that all my app artifacts have been successfully dowloaded and unzipped from CodeBuild artifacts S3 bucket to my EC2 instance (Windows Server 2019) directory: enter image description here

All artifacts match to the latest CideBuild run output. I assume that the @ rb_sysopen argument is related to Ruby unzip program but am not too sure. Considering that the artifacts zip file has been already unzipped in the C:\ProgramData/Amazon/CodeDeploy/... direcory, the error seems weird. This is my appspec.yml file:

 version: 0.0 
 os: windows 
 files: 
    - source:\*.* 
      destination:C:\Webapps\TestWebAPIForCodeBuild

This is a fragment of CodeDeploy log file found in my target EC2 instance:

2022-07-28T03:48:35 DEBUG [codedeploy-agent(5272)]: InstanceAgent::Plugins::CodeDeployPlugin::Installer: generating instructions for copying \*.* to C:\Webapps\TestWebAPIForCodeBuild
2022-07-28T03:48:35 DEBUG [codedeploy-agent(5272)]: InstanceAgent::Plugins::CodeDeployPlugin::Installer: generating instructions for copying \*.* to C:\Webapps\TestWebAPIForCodeBuild
2022-07-28T03:48:35 DEBUG [codedeploy-agent(5272)]: InstanceAgent::Plugins::CodeDeployPlugin::Installer: generating instructions for copying \*.* to C:\Webapps\TestWebAPIForCodeBuild
2022-07-28T03:48:35 DEBUG [codedeploy-agent(5272)]: InstanceAgent::Plugins::CodeDeployPlugin::CommandBuilder: Copying C:\ProgramData/Amazon/CodeDeploy/0df66877-d62c-49b0-81b6-a2b98509ed51/d-DC1Q553XH/deployment-archive\*.* to C:/Webapps/TestWebAPIForCodeBuild/*.*
2022-07-28T03:48:35 DEBUG [codedeploy-agent(5272)]: InstanceAgent::Plugins::CodeDeployPlugin::CommandBuilder: Copying C:\ProgramData/Amazon/CodeDeploy/0df66877-d62c-49b0-81b6-a2b98509ed51/d-DC1Q553XH/deployment-archive\*.* to C:/Webapps/TestWebAPIForCodeBuild/*.*
2022-07-28T03:48:35 DEBUG [codedeploy-agent(5272)]: InstanceAgent::Plugins::CodeDeployPlugin::CommandPoller: Calling PutHostCommandComplete: "Code Error" 
2022-07-28T03:48:35 DEBUG [codedeploy-agent(5272)]: InstanceAgent::Plugins::CodeDeployPlugin::CommandPoller: Calling PutHostCommandComplete: "Code Error" 
2022-07-28T03:48:35 INFO  [codedeploy-agent(5272)]: Version file found in C:/ProgramData/Amazon/CodeDeploy/.version with agent version OFFICIAL_1.3.2.1902_msi.
2022-07-28T03:48:35 INFO  [codedeploy-agent(5272)]: Version file found in C:/ProgramData/Amazon/CodeDeploy/.version with agent version OFFICIAL_1.3.2.1902_msi.
2022-07-28T03:48:36 INFO  [codedeploy-agent(5272)]:[Aws::CodeDeployCommand::Client 200 0.065898 0 retries]   put_host_command_complete(command_status:"Failed",diagnostics:format:"JSON",payload:"\"error_code\":5,\"script_name\":\"\",\"message\":\"Invalid argument @ rb_sysopen - C:\\\\ProgramData/Amazon/CodeDeploy/0df66877-d62c-49b0-81b6-a2b98509ed51/d-DC1Q553XH/deployment-archive\\\\*.*\",\"log\":\"\"}"},host_command_identifier:"eyJiYXRjaElkIjoiN2MzMDJmY2U1YmIzNDVjYThjNGQ5YWI0MzMyMDhiMjkvcHVibGljMDA3IiwiZGVwbG95bWVudElkIjoiQ29kZURlcGxveS9hcC1zb3V0aGVhc3QtMi9wcm9kL29ycGhldXM6cHVibGljMDA1LzgwOTMyNTEwODEzMTpkLURDMVE1NTNYSCIsImhvc3RJZCI6ImFybjphd3M6ZWMyOmFwLXNvdXRoZWFzdC0yOjgwOTMyNTEwODEzMTppbnN0YW5jZS9pLTAxY2U5NmE0MDM2NDJiMzAyIiwiY29tbWFuZElkIjoiQXBvbGxvRGVwbG95Q29udHJvbFNlcnZpY2V8YXJuOmF3czplYzI6YXAtc291dGhlYXN0LTI6ODA5MzI1MTA4MTMxOmluc3RhbmNlL2ktMDFjZTk2YTQwMzY0MmIzMDJ8NHwwIiwiY29tbWFuZE5hbWUiOiJJbnN0YWxsIiwiY29tbWFuZEluZGV4Ijo0LCJhdHRlbXB0SW5kZXgiOjF9")  
2022-07-28T03:48:36 INFO  [codedeploy-agent(5272)]:[Aws::CodeDeployCommand::Client 200 0.065898 0 retries] put_host_command_complete(command_status:"Failed",diagnostics:{format:"JSON",payload:"{\"error_code\":5,\"script_name\":\"\",\"message\":\"Invalid argument @ rb_sysopen - C:\\\\ProgramData/Amazon/CodeDeploy/0df66877-d62c-49b0-81b6-a2b98509ed51/d-DC1Q553XH/deployment-archive\\\\*.*\",\"log\":\"\"}"},host_command_identifier:"eyJiYXRjaElkIjoiN2MzMDJmY2U1YmIzNDVjYThjNGQ5YWI0MzMyMDhiMjkvcHVibGljMDA3IiwiZGVwbG95bWVudElkIjoiQ29kZURlcGxveS9hcC1zb3V0aGVhc3QtMi9wcm9kL29ycGhldXM6cHVibGljMDA1LzgwOTMyNTEwODEzMTpkLURDMVE1NTNYSCIsImhvc3RJZCI6ImFybjphd3M6ZWMyOmFwLXNvdXRoZWFzdC0yOjgwOTMyNTEwODEzMTppbnN0YW5jZS9pLTAxY2U5NmE0MDM2NDJiMzAyIiwiY29tbWFuZElkIjoiQXBvbGxvRGVwbG95Q29udHJvbFNlcnZpY2V8YXJuOmF3czplYzI6YXAtc291dGhlYXN0LTI6ODA5MzI1MTA4MTMxOmluc3RhbmNlL2ktMDFjZTk2YTQwMzY0MmIzMDJ8NHwwIiwiY29tbWFuZE5hbWUiOiJJbnN0YWxsIiwiY29tbWFuZEluZGV4Ijo0LCJhdHRlbXB0SW5kZXgiOjF9")  

2022-07-28T03:48:36 ERROR [codedeploy-agent(5272)]: InstanceAgent::Plugins::CodeDeployPlugin::CommandPoller: Error during perform: Errno::EINVAL - Invalid argument @ rb_sysopen - C:\ProgramData/Amazon/CodeDeploy/0df66877-d62c-49b0-81b6-a2b98509ed51/d-DC1Q553XH/deployment-archive\*.* - C:/Windows/TEMP/ocrAF4E.tmp/lib/ruby/2.3.0/fileutils.rb:1392:in `initialize'
C:/Windows/TEMP/ocrAF4E.tmp/lib/ruby/2.3.0/fileutils.rb:1392:in `open'
C:/Windows/TEMP/ocrAF4E.tmp/lib/ruby/2.3.0/fileutils.rb:1392:in `copy_file'
C:/Windows/TEMP/ocrAF4E.tmp/lib/ruby/2.3.0/fileutils.rb:486:in `copy_file'
C:/Windows/TEMP/ocrAF4E.tmp/lib/ruby/2.3.0/fileutils.rb:403:in `block in cp'
C:/Windows/TEMP/ocrAF4E.tmp/lib/ruby/2.3.0/fileutils.rb:1571:in `block in fu_each_src_dest'
C:/Windows/TEMP/ocrAF4E.tmp/lib/ruby/2.3.0/fileutils.rb:1587:in `fu_each_src_dest0'
C:/Windows/TEMP/ocrAF4E.tmp/lib/ruby/2.3.0/fileutils.rb:1569:in `fu_each_src_dest'
C:/Windows/TEMP/ocrAF4E.tmp/lib/ruby/2.3.0/fileutils.rb:402:in `cp'
C:/Windows/TEMP/ocrAF4E.tmp/src/opt/codedeploy-agent/lib/instance_agent/plugins/codedeploy/install_instruction.rb:237:in `execute'
C:/Windows/TEMP/ocrAF4E.tmp/src/opt/codedeploy-agent/lib/instance_agent/plugins/codedeploy/installer.rb:49:in `block (2 levels) in install'
C:/Windows/TEMP/ocrAF4E.tmp/src/opt/codedeploy-agent/lib/instance_agent/plugins/codedeploy/installer.rb:48:in `each'
C:/Windows/TEMP/ocrAF4E.tmp/src/opt/codedeploy-agent/lib/instance_agent/plugins/codedeploy/installer.rb:48:in `block in install'
C:/Windows/TEMP/ocrAF4E.tmp/src/opt/codedeploy-agent/lib/instance_agent/plugins/codedeploy/installer.rb:47:in `open'
C:/Windows/TEMP/ocrAF4E.tmp/src/opt/codedeploy-agent/lib/instance_agent/plugins/codedeploy/installer.rb:47:in `install'
C:/Windows/TEMP/ocrAF4E.tmp/src/opt/codedeploy-agent/lib/instance_agent/plugins/codedeploy/command_executor.rb:138:in `block in <class:CommandExecutor>'
C:/Windows/TEMP/ocrAF4E.tmp/src/opt/codedeploy-agent/lib/instance_agent/plugins/codedeploy/command_executor.rb:70:in `execute_command'
C:/Windows/TEMP/ocrAF4E.tmp/src/opt/codedeploy-agent/lib/instance_agent/plugins/codedeploy/command_poller.rb:115:in `process_command'
C:/Windows/TEMP/ocrAF4E.tmp/src/opt/codedeploy-agent/lib/instance_agent/plugins/codedeploy/command_poller.rb:97:in `acknowledge_and_process_command'
C:/Windows/TEMP/ocrAF4E.tmp/src/opt/codedeploy-agent/lib/instance_agent/plugins/codedeploy/command_poller.rb:76:in `block in perform'
C:/Windows/Temp/ocrAF4E.tmp/gemhome/gems/concurrent-ruby-1.0.5/lib/concurrent/executor/ruby_thread_pool_executor.rb:348:in `run_task'
C:/Windows/Temp/ocrAF4E.tmp/gemhome/gems/concurrent-ruby-1.0.5/lib/concurrent/executor/ruby_thread_pool_executor.rb:337:in `block (3 levels) in create_worker'
C:/Windows/Temp/ocrAF4E.tmp/gemhome/gems/concurrent-ruby-1.0.5/lib/concurrent/executor/ruby_thread_pool_executor.rb:320:in `loop'
C:/Windows/Temp/ocrAF4E.tmp/gemhome/gems/concurrent-ruby-1.0.5/lib/concurrent/executor/ruby_thread_pool_executor.rb:320:in `block (2 levels) in create_worker'
C:/Windows/Temp/ocrAF4E.tmp/gemhome/gems/concurrent-ruby-1.0.5/lib/concurrent/executor/ruby_thread_pool_executor.rb:319:in `catch'
C:/Windows/Temp/ocrAF4E.tmp/gemhome/gems/concurrent-ruby-1.0.5/lib/concurrent/executor/ruby_thread_pool_executor.rb:319:in `block in create_worker'

Could anyone please help?



Comments

Popular posts from this blog

Today Walkin 14th-Sept

Spring Elasticsearch Operations

Hibernate Search - Elasticsearch with JSON manipulation