System.InvalidOperationException: The character set provided in ContentType is invalid

Hi,

I’m using https://hub.docker.com/r/octopusdeploy/octo on a linux build agent and getting an error that i cannot figure out.

Here is my command

docker run --rm \
    -v $(pwd):/src \
    octopusdeploy/octo  push --package "$ID.$VERSION_SHORT.nupkg" --replace-existing --server ${1} --apiKey ${2} --debug

And here is my error. Can you please help?

22-Jun-2019 21:06:58	Octopus Deploy Command Line Tool, version 4.47.0
22-Jun-2019 21:06:58	
22-Jun-2019 21:06:58	Detected automation environment: "NoneOrUnknown"
22-Jun-2019 21:06:58	
22-Jun-2019 21:06:58	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.
22-Jun-2019 21:06:58	Parameter name: name
22-Jun-2019 21:06:58	   at System.Text.EncodingTable.GetCodePageFromName(String name)
22-Jun-2019 21:06:58	   at System.Text.Encoding.GetEncoding(String name)
22-Jun-2019 21:06:58	   at System.Net.Http.HttpContent.ReadBufferAsString(ArraySegment`1 buffer, HttpContentHeaders headers)
22-Jun-2019 21:06:58	   --- End of inner exception stack trace ---
22-Jun-2019 21:06:58	   at System.Net.Http.HttpContent.ReadBufferAsString(ArraySegment`1 buffer, HttpContentHeaders headers)
22-Jun-2019 21:06:58	   at System.Net.Http.HttpContent.ReadBufferedContentAsString()
22-Jun-2019 21:06:58	   at System.Net.Http.HttpContent.<>c.<ReadAsStringAsync>b__36_0(HttpContent s)
22-Jun-2019 21:06:58	   at System.Net.Http.HttpContent.WaitAndReturnAsync[TState,TResult](Task waitTask, TState state, Func`2 returnFunc)
22-Jun-2019 21:06:58	   at Octopus.Client.Exceptions.OctopusExceptionFactory.CreateException(HttpResponseMessage response) in C:\buildAgent\work\d8818cc5a2905d1\source\Octopus.Client\Exceptions\OctopusExceptionFactory.cs:line 47
22-Jun-2019 21:06:58	   at Octopus.Client.OctopusAsyncClient.DispatchRequest[TResponseResource](OctopusRequest request, Boolean readResponse) in C:\buildAgent\work\d8818cc5a2905d1\source\Octopus.Client\OctopusAsyncClient.cs:line 575
22-Jun-2019 21:06:58	   at Octopus.Client.OctopusAsyncClient.Get[TResource](String path, Object pathParameters)
22-Jun-2019 21:06:58	   at Octopus.Client.OctopusAsyncClient.EstablishSession() in C:\buildAgent\work\d8818cc5a2905d1\source\Octopus.Client\OctopusAsyncClient.cs:line 498
22-Jun-2019 21:06:58	   at Octopus.Client.OctopusAsyncClient.Create(OctopusServerEndpoint serverEndpoint, OctopusClientOptions options, Boolean addHandler, String requestingTool) in C:\buildAgent\work\d8818cc5a2905d1\source\Octopus.Client\OctopusAsyncClient.cs:line 151
22-Jun-2019 21:06:58	   at Octopus.Client.OctopusAsyncClient.Create(OctopusServerEndpoint serverEndpoint, OctopusClientOptions options, String requestingTool) in C:\buildAgent\work\d8818cc5a2905d1\source\Octopus.Client\OctopusAsyncClient.cs:line 133
22-Jun-2019 21:06:58	   at Octopus.Cli.Commands.ApiCommand.Execute(String[] commandLineArguments) in C:\buildAgent\work\d8818cc5a2905d1\source\Octopus.Cli\Commands\ApiCommand.cs:line 140
22-Jun-2019 21:06:58	   at Octopus.Cli.CliProgram.Run(String[] args) in C:\buildAgent\work\d8818cc5a2905d1\source\Octopus.Cli\CliProgram.cs:line 52
22-Jun-2019 21:06:58	Exit code: -3

Note i’ve tried downgrading all the way to version 4, but same error on latest.

Hi Jenna,

Sorry to hear you have this issue uploading a package to Octopus Server.
Can you tell me what Octopus Server version you trying to upload the package to is?
Does the same operation work on Windows against the same Octopus server?

Regards
John

Hi John,

Dev ops team just told me it is v3.12.8

Unfortunately our application needs to build on a Linux agent. I will see if i can test this on windows somehow.

Thanks
Jenna