Swagger UI Failed to load API definition After Upgrade

Current Octopus Server version: v2020.6.4987 running on Windows Server 2016 with a MSSQL backend. When upgrading to any newer version of Octopus Deploy, the SwaggerUI endpoint fails to load as the URL to the swagger.json does not maintain the full url of our Octopus Server.

We have tried upgrading to v2020.6.5321 as well as v2021.1.7638 with the same breaking change.

Current Binding config;

Hi @amnelson,

Thank you for contacting Octopus Support.

Can you confirm if http://localhost/swaggerui/index.html works from the machine Octopus Server is installed on?

Let me know at your earliest convenience.

Regards,
Donny

I get a 404 error “The webpage cannot be found” and the browser redirected localhost to fqdn in my first binding listed but did not include the /EISOCTStage with it…

Hi @amnelson,

Thank you for getting back to me.

Is the Octopus Server UI accessible from the machine Octopus Server is installed on? Could you also try to access swagger via http://127.0.0.1/swaggerui/index.html? If that doesn’t work, could you try the LAN IP in place of 127.0.0.1?

I look forward to hearing back from you.

Regards,
Donny

Hey Donny,

So before the upgrade, we could browse to the localhost/swaggerui/index.html just fine. After the upgrade, all requests to localhost or 127.0.0.1 are now getting redirected to the FQDN we configured for our server.

Hi @amnelson,

Thank you for the quick response.

Did you happen to upgrade from Octopus Server 2019 or older? If so, in upgrading from 2019 or older to 2020 or newer, Octopus moves from .NET Framework to .NET Core. It may be worth a quick check to see if the machine that Octopus Server is installed on has any http_proxy environmental variables set that could be getting respected by .NET Core. This could explain why you are seeing this as a result of an Octopus Server upgrade.

Let me know at your earliest convenience.

Regards,
Donny

I just realized that we had the “redirect all requests to https” enabled. I’ve disabled that and now the swaggerui page is just blank. I get a code 200 back from curl but no UI is rendered from IE. I still see an error: Fetch errorNot Found /api/swagger.json

We are upgrading from 2020.5.9 and I’m trying to find the upgrade path to get to the latest version and at what point the swaggerui page breaks. I’m able to upgrade from 2020.5.9 -> 2020.5.392 just fine, then from 2020.5.9 -> 2020.6.4987 is actually where the swaggerui breaks (both locally and remotely).

There are no http_proxy environment variables setup on this server.

Thanks

Hi @amnelson!

Just jumping in for Donny here, as he’s wrapped up for the day.

Sadly, this is a known issue, that has been fixed in the upcoming 2021.2 release, only occurring if you use a virtual directory to host Octopus. You can find the details of the issue HERE

I hope this helps, and please let us know if you have any further questions.

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