microsoft/aspire · error · InvalidDataException

Aspire skills archive entry

Error message

Aspire skills archive entry '{0}' has unsupported type '{1}'.

What it means

When extracting a tar archive, ExtractTarball handles only regular files, directories, symlinks/hardlinks it accepts, and skips metadata entry types (GlobalExtendedAttributes, ExtendedAttributes). Any other entry type (e.g. block/char devices, FIFOs, sockets) is unexpected in a skills bundle and throws this InvalidDataException.

Solutions

  1. Repackage the archive with only regular files and directories (e.g. tar --format=pax excluding special files)
  2. Remove device/FIFO/socket entries from the archive
  3. Download the official archive again instead of a locally rebuilt one

Example fix

// before (creating the archive)
tar czf skills.tar.gz ./skills /dev/null-device
// after
tar czf skills.tar.gz ./skills
Defensive patterns

Strategy: try-catch

Validate before calling

using var archive = TarFile.OpenRead(archivePath);
while (archive.GetNextEntry() is { } e)
    if (e.EntryType is not (TarEntryType.RegularFile or TarEntryType.Directory
        or TarEntryType.HardLink or TarEntryType.SymbolicLink
        or TarEntryType.GlobalExtendedAttributes or TarEntryType.ExtendedAttributes))
        throw new Exception($"Entry '{e.Name}' has unsupported type {e.EntryType}.");

Try / catch

try { await provider.CreateAsync(...); }
catch (InvalidDataException ex) when (ex.Message.Contains("unsupported type")) { /* repackage archive without special entries */ }

Prevention

When it happens

Trigger: ExtractArchive processes a .tar.gz skills package containing a tar entry whose EntryType is a special type (device node, FIFO, socket) rather than a file, directory, or accepted link type.

Common situations: A tampered or mispackaged archive created with unusual entry types; archiving from /dev with special files included; a tool producing PAX/GNU entries the parser does not recognize.

Related errors


AI-assisted analysis of microsoft/aspire@25830f84bd (2026-09-16). Data as JSON: /api/errors/e8e009fc2b07b21c. Report an issue: GitHub.

Appendix: source

Thrown at src/Aspire.Cli/Agents/AspireSkills/AspireSkillsBundleProvider.cs:519

                    break;

                case TarEntryType.RegularFile:
                case TarEntryType.V7RegularFile:
                    var destinationFileDirectory = Path.GetDirectoryName(destinationPath);
                    if (!string.IsNullOrEmpty(destinationFileDirectory))
                    {
                        Directory.CreateDirectory(destinationFileDirectory);
                    }

                    entry.ExtractToFile(destinationPath, overwrite: false);
                    break;

                case TarEntryType.GlobalExtendedAttributes:
                case TarEntryType.ExtendedAttributes:
                    break;

                default:
                    throw new InvalidDataException(string.Format(CultureInfo.InvariantCulture, "Aspire skills archive entry '{0}' has unsupported type '{1}'.", entry.Name, entry.EntryType));
            }
        }
    }

    private static void ExtractZipArchive(string archivePath, string destinationDirectory)
    {
        var destinationRoot = Path.GetFullPath(destinationDirectory);
        Directory.CreateDirectory(destinationRoot);

        using var archive = ZipFile.OpenRead(archivePath);
        foreach (var entry in archive.Entries)
        {
            if (string.IsNullOrWhiteSpace(entry.FullName))
            {
                continue;
            }

            var destinationPath = GetSafeArchiveDestinationPath(destinationRoot, entry.FullName);

View on GitHub (pinned to 25830f84bd)