System.ArgumentException: '"UTF-8"' is not a supported encoding name

Hi Support,

We’re using Octopus 3.17.2 and running an old job fails:

Starting: Publish octopus package

Task : Push Package(s) to Octopus
Description : There is a later version of this task, we recommend using the latest version. Push your NuGet or Zip package to your Octopus Deploy Server
Version : 4.3.134
Author : Octopus Deploy
Help : Version: 5.2.134. More Information
==============================================================================
##[warning]There is a later version of this task, we recommend using the latest version.
C:\WINDOWS\system32\cmd.exe /D /S /C “C:\agent_work_tool\octo\7.4.3663\x64\octo.cmd version”

Detected automation environment: “AzureDevOps”
System.InvalidOperationException: The character set provided in ContentType is invalid. Cannot read content as string using an invalid character set. —> System.ArgumentException: ‘“UTF-8”’ is not a supported encoding name. For information on defining a custom encoding, see the documentation for the Encoding.RegisterProvider method.
Parameter name: name
at System.Globalization.EncodingTable.internalGetCodePageFromName(String name)
at System.Globalization.EncodingTable.GetCodePageFromName(String name)
at System.Text.Encoding.GetEncoding(String name)
at System.Net.Http.HttpContent.ReadBufferAsString(ArraySegment`1 buffer, HttpContentHeaders headers)

It ran last time succeeding with:

Starting: Publish octopus package

Task : Push Package(s) to Octopus
Description : Push your NuGet or Zip package to your Octopus Deploy Server
Version : 4.2.492
Author : Octopus Deploy

Detected automation environment: “AzureDevOps”
Process will run in backwards compatible mode for older versions of Octopus Server
Handshaking with Octopus Server: http://mp-cd-01/
Handshake successful. Octopus version: 3.17.2; API version: 3.0.0
Authenticated as:
Pushing package: C:\agent_work\5\a\drop\ProfileUpdate.20211125.1.zip…
Server does not support delta compression for package push
Falling back to pushing the complete package to the server
Push successful

I’ve found similar issues:

Is there a way to revert back to 4.2, or is it possible to update octo.cmd without upgrading?

We’d really appreciate advice on a way forward to overcome this error? Thanks. Any more info please let me know.

Hi @MeaningOfLights1,

Thanks for reaching out, sorry to hear you’re hitting this issue with the ContentType!

The error message is certainly implying that there is an issue with UTF-8 being used, but I’d like to narrow down on differences between the last successful run and this failing one. I have a feeling it might be due to the version of Octo CLI being used.

Would you be able to please send through the full build logs for both runs? I’m also curious if this error occurs for any other tasks or just this one?

You should be able to upload any files securely here, let me know how you get on or if you have any issues or questions!

Best Regards,

Thank you, I uploaded the logs working vs non-working.

AFAIK there’s been no changes to config, network or environment. Hopefully there’s a clue to help narrow it down. Thanks.

1 Like

Hi @MeaningOfLights1,

Thanks for that, confirming I’ve received them ok!

I can see that the CLI version is slightly different so it might be worth testing if using version 7.4.3473 rather than 7.4.3663 will allow it to work. You should be able to specify the exact version in the Octopus CLI Installer step, which is just before the Publish octopus package task.

Let me know if that helps or if you have any issues at all, I’ll keep digging and see if I can spot any other potential causes!

Best Regards,