Deleting channel using octopus client causes "File not found" exception

Hello, when deleting a channel using octopus client, we are encountering “404 - File or directory not found.” .

Provided with the “ChannelId”, we are deleting the channel using the Delete method of Octopus client.

This is how we invoke it

GetOctopusClient().Delete($“/api/channels/{channel.Id}”);

Below is the response we got from the API

404 - File or directory not found.

Server Error

404 - File or directory not found.

The resource you are looking for might have been removed, had its name changed, or is temporarily unavailable.

The error should be straight forward, but the channel is still there in the dashboard although empty.

We tried to delete some of the channels of those channel id manually and they succeeded without hitch.

Hi,

Thank you for contacting us. Theoretically that line of code should work, so I need to ask you some questions to determine what the cause may be.

Firstly, what is the contents of your GetOctopusClient() method? Do other methods on the client work properly? How are you retrieving the channel?

Also, there are repository methods available for Channels that may prevent these errors and simplify your usage. For example, you can substitute the line above with:

GetOctopusRepository().Channels.Delete(channel);

And in this instance the client will determine the correct URL for you.

Looking forward to your response.

Regards.
Jayden

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.