Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ApplicationMainUrl is always empty #14527

Closed
stefanstankovic opened this issue Jul 7, 2023 · 2 comments
Closed

ApplicationMainUrl is always empty #14527

stefanstankovic opened this issue Jul 7, 2023 · 2 comments
Labels

Comments

@stefanstankovic
Copy link

Which Umbraco version are you using? (Please write the exact version, example: 10.1.0)

12.0.0

Bug summary

I tried to create the last version of the Umbraco application and the application works locally, but when we deployed the application to the IIS server we couldn't start it due to the following error:

Description: The process was terminated due to an unhandled exception.
Exception Info: System.UriFormatException: Invalid URI: The URI is empty.
   at System.Uri.CreateThis(String uri, Boolean dontEscape, UriKind uriKind, UriCreationOptions& creationOptions)
   at System.Uri..ctor(String uriString)
   at Umbraco.Cms.Web.Common.AspNetCore.AspNetCoreHostingEnvironment..ctor(IOptionsMonitor`1 hostingSettings, IOptionsMonitor`1 webRoutingSettings, IWebHostEnvironment webHostEnvironment)
   at Umbraco.Extensions.UmbracoBuilderExtensions.GetTemporaryHostingEnvironment(IWebHostEnvironment webHostEnvironment, IConfiguration config)
   at Umbraco.Extensions.UmbracoBuilderExtensions.AddUmbraco(IServiceCollection services, IWebHostEnvironment webHostEnvironment, IConfiguration config)
   at Auva.Web.Startup.ConfigureServices(IServiceCollection services) in C:\Jenkins\.jenkins\workspace\Auva.Web_preview\Auva.Web\Startup.cs:line 40
   at System.RuntimeMethodHandle.InvokeMethod(Object target, Void** arguments, Signature sig, Boolean isConstructor)
   at System.Reflection.MethodInvoker.Invoke(Object obj, IntPtr* args, BindingFlags invokeAttr)
   at System.Reflection.RuntimeMethodInfo.Invoke(Object obj, BindingFlags invokeAttr, Binder binder, Object[] parameters, CultureInfo culture)
   at Microsoft.AspNetCore.Hosting.ConfigureServicesBuilder.InvokeCore(Object instance, IServiceCollection services)
   at Microsoft.AspNetCore.Hosting.GenericWebHostBuilder.UseStartup(Type startupType, HostBuilderContext context, IServiceCollection services, Object instance)
   at Microsoft.AspNetCore.Hosting.GenericWebHostBuilder.<>c__DisplayClass14_0.<UseStartup>b__0(HostBuilderContext context, IServiceCollection services)
   at Microsoft.Extensions.Hosting.HostBuilder.InitializeServiceProvider()
   at Microsoft.Extensions.Hosting.HostBuilder.Build()
   at Umbraco.Cms.Web.Common.Hosting.UmbracoHostBuilderDecorator.Build()
   at Auva.Web.Program.Main(String[] args) in C:\Jenkins\.jenkins\workspace\Auva.Web_preview\Auva.Web\Program.cs:line 6

I took the source code and added an additional log to check UmbracoApplicationUrl value:

 var eventLog = new EventLog("Application");
            eventLog.Source = "Application";
            eventLog.WriteEntry($"_webRoutingSettings.CurrentValue.UmbracoApplicationUrl = {_webRoutingSettings.CurrentValue.UmbracoApplicationUrl}", EventLogEntryType.Warning);

in this line:
https://github.com/umbraco/Umbraco-CMS/blob/contrib/src/Umbraco.Web.Common/AspNetCore/AspNetCoreHostingEnvironment.cs#L70
but the value is always an empty string:

If the event originated on another computer, the display information had to be saved with the event.

The following information was included with the event: 

_webRoutingSettings.CurrentValue.UmbracoApplicationUrl = 

The message resource is present but the message was not found in the massage table

I tried to set the parameter in the appsettings.json file:

"Umbraco": {
    "CMS": {
      "WebRouting": {
        "DisableRedirectUrlTracking": true,
		"UmbracoApplicationUrl": "https://my.website.address/"
      },

but the log still reports the empty string.
The webserver has an Umbraco V10 application that works without issues, but there is one Umbraco 11 application and there is one Umbraco 12 application that reports the same issue: Exception Info: System.UriFormatException: Invalid URI: The URI is empty.

Specifics

No response

Steps to reproduce

Deploy Umbraco 12 app on an IIS web server.

Expected result / actual result

No response

@github-actions
Copy link

github-actions bot commented Jul 7, 2023

Hi there @stefanstankovic!

Firstly, a big thank you for raising this issue. Every piece of feedback we receive helps us to make Umbraco better.

We really appreciate your patience while we wait for our team to have a look at this but we wanted to let you know that we see this and share with you the plan for what comes next.

  • We'll assess whether this issue relates to something that has already been fixed in a later version of the release that it has been raised for.
  • If it's a bug, is it related to a release that we are actively supporting or is it related to a release that's in the end-of-life or security-only phase?
  • We'll replicate the issue to ensure that the problem is as described.
  • We'll decide whether the behavior is an issue or if the behavior is intended.

We wish we could work with everyone directly and assess your issue immediately but we're in the fortunate position of having lots of contributions to work with and only a few humans who are able to do it. We are making progress though and in the meantime, we will keep you in the loop and let you know when we have any questions.

Thanks, from your friendly Umbraco GitHub bot 🤖 🙂

@nikolajlauridsen
Copy link
Contributor

Hey @stefanstankovic I'm sorry, but I cannot reproduce the issue, I published 12.0.0 to an IIS running on Azure, and everything seems to work as expected, both with and without the UmbracoApplicationUrl. Maybe, there is an issue with the configuration of the IIS, I'd recommend maybe asking on the forum or in the discord.

I'll go ahead and close this for now since I cannot reproduce, however, please feel free to comment on the issue if you have more specific reproduction steps, and then we can have another look at trying to reproduce.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants