akamai / akamai/PowerShell

Uploading an Edgeworker with -CodeDirectory fails on MacOS when it has subdirectories

Open
#33 1 comment 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
PowerShell
Stars
10
Forks
7
Avg merge
2m
Merged PRs (30d)
4

Description

I am uploading a code directory with the following command:

$ New-EdgeWorkerVersion -section mysection -EdgeWorkerID 123456 -CodeDirectory ./dist

This has been working fine. But as soon as I create a subdirectory (in this case dist/utils). The tarball fails to upload.

$ New-EdgeWorkerVersion -section mysection -EdgeWorkerID 123456 -CodeDirectory ./dist
Invoke-AkamaiRequest: /Users/user/.local/share/powershell/Modules/Akamai.EdgeWorkers/2.3.2/Functions/Public/New-EdgeWorkerVersion.ps1:90
Line |
  90 |      $Response = Invoke-AkamaiRequest @RequestParams
     |                  ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
     | HTTP 400 - Invalid Argument - Tarball validation failed: Invalid file permission : The ._utils file cannot be executable. See $Error[0].exception.data for more information

As a workaround I have kept the files in the root, without subdirectories.

I am on MacOS.

In contrast, the Akamai CLI (not powershell) does succeed to upload it.

$ akamai --section mysection edgeworkers upload --codeDir ./dist 123456
Running edgeworkers command... [          ]Created tarball at /Users/user/.akamai-cli/cache/edgeworkers-cli/edgeworkers/123456/ew_0.0.38_1777548546650.tgz
------------------------------------------------------
--- New version uploaded for EdgeWorker Id: 123456 ---
------------------------------------------------------
┌─────────┬──────────────┬──────────┬────────────────────────────────────────────────────────────────────┬────────────────────────────┬────────────────────────┐
│ (index) │ edgeWorkerId │ version  │ checksum                                                           │ createdBy                  │ createdTime            │
├─────────┼──────────────┼──────────┼────────────────────────────────────────────────────────────────────┼────────────────────────────┼────────────────────────┤
│ 0       │ 123456       │ '0.0.38' │ 'checksum_removed' │ 'user@domain.be' │ '2026-04-30T11:29:10Z' │
└─────────┴──────────────┴──────────┴────────────────────────────────────────────────────────────────────┴────────────────────────────┴────────────────────────┘
Running edgeworkers command... [OK]

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start at Functions/Public/New-EdgeWorkerVersion.ps1:90 and trace how the -CodeDirectory ./dist input is turned into the uploaded tarball. Reproduce the failure on macOS with a nested dist/utils directory, then compare the resulting archive behavior with the successful Akamai CLI upload. Done means nested directories upload without invalid executable metadata files.

Written by the indexing model from the issue text.

Assessment

Tech stack
powershell
Domain
tooling
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Quiet
Clarity
Mostly clear
Newbie friendliness
55/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.