Remote file cannot download zip file

We our currently trying to converge our winlogbeat chef recipe on a windows VM. We're running into an issue with the remote_file resource where it is unable to download the zip file specified in source.

Our winlogbeat recipe looks like this

#
# Cookbook:: soc2
# Recipe:: winlogbeat


  directory 'C:/Program Files/winlogbeat' do
    rights :full_control, 'Administrators'
    action :create
  end

  windows_service 'winlogbeat' do
    action :stop
    ignore_failure true
  end

  remote_file 'C:/Program Files/winlogbeat.zip' do
    source 'https://artifacts.elastic.co/downloads/beats/winlogbeat/winlogbeat-7.8.0-windows-x86_64.zip'
    action :create
  end

  archive_file 'winlogbeat' do
    path 'C:/Program Files/winlogbeat.zip'
    destination 'C:/Program Files/'
    overwrite :auto
  end

  powershell_script 'copy winlog files' do
    code <<-EOH
    Copy-Item -Path "C:/Program Files/winlogbeat-7.8.0-windows-x86_64/*" -Destination "C:/Program Files/winlogbeat/" -Recurse -Force
    EOH
  end
  
  cookbook_file 'C:/Program Files/winlogbeat/winlogbeat.yml' do
    source 'winlogbeat.yml'
    action :create
  end

  directory 'C:/Program Files/winlogbeat/ssl' do
    rights :full_control, 'Administrators'
    action :create
  end

  cookbook_file 'C:/Program Files/winlogbeat/ssl/cert.pem' do
    source 'cert.pem'
    action :create
  end

  cookbook_file 'C:/Program Files/winlogbeat/ssl/key.pem' do
    source 'key.pem'
    action :create
  end

  cookbook_file 'C:/Program Files/winlogbeat/install-service-winlogbeat.ps1' do
    source 'install-service-winlogbeat.ps1'
    action :create
  end

  execute 'winlogbeat_install' do
    command 'powershell -noexit "& ""C:/Program Files/winlogbeat/install-service-winlogbeat.ps1"""  '
  end

  powershell_script 'Delete winlog directory' do
    code <<-EOH
    Remove-Item 'C:/Program Files/winlogbeat-7.8.0-windows-x86_64/' -Recurse                   
    EOH
  end

  windows_service 'winlogbeat' do
    action :start
  end

This is the error were recieving.

WARN: remote_file[C:/Program Files/winlogbeat.zip] cannot be downloaded from https://artifacts.elastic.co/downloads/beats/winlogbeat/winlogbeat-7.8.0-windows-x86_64.zip: No such file or directory @ rb_sysopen - c:/apps/devlab/configuration.azeastus.chef/0.1.0-207801-customer-service-import-webroot.225+20230426.1/.chef/local-mode-cache/cache/remote_file/https___artifacts_elastic_co_downloads_beats_winlogbeat_winlogbe-9fecb7a7b5e7477c814881d9a8aec73c.json

Error executing action create on resource 'remote_file[C:/Program Files/winlogbeat.zip]'

No such file or directory @ rb_sysopen - c:/apps/devlab/configuration.azeastus.chef/0.1.0-207801-customer-service-import-webroot.225+20230426.1/.chef/local-mode-cache/cache/remote_file/https___artifacts_elastic_co_downloads_beats_winlogbeat_winlogbe-9fecb7a7b5e7477c814881d9a8aec73c.json

Any ideas on what is causing this error and how to fix?

We figured it out, our path where chef was trying to execute was 262 characters long which was over the windows limit of 256. We lowered that path number by shortening our release name length and it was able to download the zip file after that.