Copied to clipboard

Flag this post as spam?

This post will be reported to the moderators as potential spam to be looked at


  • Angus Atkins-Trimnell 15 posts 85 karma points
    Jan 31, 2023 @ 17:27
    Angus Atkins-Trimnell
    0

    Models Builder Custom Tool Failing with HTTP Status "Redirect"

    I am running Models Builder in Umbraco 8.17.1. It is, I believe, in API mode. We have a Models project, in which we use the custom tool in Visual Studio to update the models, which are generated.cs files.

    Our setup in config is as follows:

      <add key="Umbraco.ModelsBuilder.Enable" value="true" />
      <add key="Umbraco.ModelsBuilder.ModelsMode" value="" />
      <add key="Umbraco.ModelsBuilder.EnableApi" value="true" />
    

    The custom tool has been failing today. The error is:

    UmbracoModelsBuilder: Starting v8.0.5 1/31/2023 11:12:15 AM. UmbracoModelsBuilder: UmbracoModelsBuilder failed to generate code: Exception: Response status code does not indicate success (Redirect)

    UmbracoModelsBuilder: at Umbraco.ModelsBuilder.Api.ApiClient.EnsureSuccess(HttpResponseMessage result) at Umbraco.ModelsBuilder.Api.ApiClient.GetModels(Dictionary`2 ourFiles, String modelsNamespace) at Umbraco.ModelsBuilder.CustomTool.CustomTool.UmbracoModelsBuilder.GenerateRaw(String wszInputFilePath, String wszDefaultNamespace, IntPtr[] rgbOutputFileContents, UInt32& pcbOutput, String& errMsg)

    Looking through the Models Builder code from GitHub, this seems to indicate that calling the Get Models endpoint in the ModelsBuilderAPI in the Umbraco backoffice returns some type of 300 status code. The Umbraco Website that we have registered with Visual Studio is running and I am able to access the backoffice with no trouble.

    Does anyone know what this return value from the API endpoint might indicate?

    Thanks for any help.

    Angus

  • Dave Woestenborghs 3504 posts 12135 karma points MVP 9x admin c-trib
    Feb 02, 2023 @ 08:16
    Dave Woestenborghs
    1

    Hi Angus,

    Do you have rewrite rules implemented on your website ?

    That could be the cause of this.

    Dave

  • Angus Atkins-Trimnell 15 posts 85 karma points
    Feb 02, 2023 @ 15:01
    Angus Atkins-Trimnell
    0

    Hi Dave,

    Thanks for the suggestion. We do have rewrites for alternate URLs on our servers. However, the base web.config, which the local IIS uses, doesn't have any.

    As a follow-up: There were issues with the check in of the solution in DevOps. These were cleared up and now the custom tool works perfectly. It must have had something to do with those issues.

    Angus

Please Sign in or register to post replies

Write your reply to:

Draft