Inedo Community Forums Forums
    • Recent
    • Tags
    • Popular
    • Login

    Welcome to the Inedo Forums! Check out the Forums Guide for help getting started.

    If you are experiencing any issues with the forum software, please visit the Contact Form on our website and let us know!

    ProGet - Exception: An error occurred in the web application: Nullable object must have a value.

    Scheduled Pinned Locked Moved Support
    5 Posts 2 Posters 20 Views 1 Watching
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • J Offline
      jw
      last edited by

      Version 2024.11 (Build 10)

      A new exception is created navigating on the web UI or just pressing F5.

      An error occurred in the web application: Nullable object must have a value.
      
      URL: https://192.168.x.x/0x44/ProGet.WebApplication/Inedo.ProGet.WebApplication.Controls.Layout.NotificationBar/GetNotifications
      Referrer: https://192.168.x.x/administration/logs
      User: xxxxxxxxxx
      User Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/126.0.0.0 Safari/537.36
      Stack trace: at System.Nullable`1.get_Value()
      at Inedo.ProGet.WebApplication.Controls.Layout.NotificationBar.GetNotificationsInternal(AhHttpContext context)
      at Inedo.ProGet.WebApplication.Controls.Layout.NotificationBar.GetNotifications(AhHttpContext context)
      at Inedo.Web.AhWebMiddleware.InvokeAsync(HttpContext context)
      
      stevedennisS 1 Reply Last reply Reply Quote 0
      • stevedennisS Offline
        stevedennis inedo-engineer @jw
        last edited by

        Hi @jw ,

        Can you try restarting the web application (Admin > Manage Service)? Hopefully it will be resolved after that.

        Thanks,
        Steve

        1 Reply Last reply Reply Quote 0
        • J Offline
          jw
          last edited by

          Hi Steve,

          I tried restarting via Manage Service, restarted both Windows services manually and rebooted the whole VM.

          The issue does not seem to go away.

          stevedennisS 1 Reply Last reply Reply Quote 0
          • stevedennisS Offline
            stevedennis inedo-engineer @jw
            last edited by

            Hi @jw,

            I'm afraid I'm at at a loss then...

            It seems to be related to one of the following settings / issues:

            • Admin Banner Message that was configured on Admin section
            • When logged in as Admin...
              • New ProGet Version Detected
              • License Violation (i.e. using ProGet Free connectors)
              • License Problem/Expiry (your license key)
              • Extenison Load Error
            • NuGet v2 queries

            Based on the stack trace, I can't pinpoint which one it is, but I'll share the code - and maybe you'll see something.

            I would first try to pinpoint which it is by trying as Admin vs Non-Admin, and then see which of those issues it could be.

            private static List<Notification> GetNotificationsInternal(AhHttpContext context)
            {
                var notifications = new List<Notification>();
            
                if(!string.IsNullOrWhiteSpace(ProGetConfig.Web.AdminBannerMessage) && (ProGetConfig.Web.AdminBannerExpiry == null || DateTime.UtcNow < ProGetConfig.Web.AdminBannerExpiry))
                {
                    notifications.Add(new Notification(
                        NotificationType.warning,
                        ProGetConfig.Web.AdminBannerMessage
                    ));
                }
            
                if (WebUserContext.IsAuthorizedForTask(ProGetSecuredTask.Admin_ConfigureProGet))
                {
                    if (ShowUpdateNotification(context))
                    {
                        notifications.Add(new Notification(
                            NotificationType.update,
                            InfoBlock.Success(
                                new A(Localization.Global.UpdatesAvailable) { Href = UpdatesOverviewPage.BuildUrl(returnUrl: AhHttpContext.Current.Request.Url.PathAndQuery) }
                            )
                        ));
                    }
            
                    if (ShowLicenseViolationNotification(context, out var violationUrl))
                    {
                        notifications.Add(new Notification(NotificationType.error,
                            new A(Localization.Global.LicenseViolation)
                            { Href = violationUrl }
                        ));
                    }
            
                    var expiresDate = Licensing.LicensingInformation.Current.LicenseKey?.ExpiresDate;
                    if (expiresDate != null && expiresDate <= DateTime.Now)
                    {
                        notifications.Add(new Notification(NotificationType.error,
                            new A(Localization.Global.KeyExpired)
                            { Href = LicensingOverviewPage.BuildUrl() }
                        ));
                    }
                    else if (Licensing.LicensingInformation.Current?.LicenseKey?.LicenseType == ProGetLicenseType.Trial)
                    {
                        var days = (int)expiresDate.Value.Subtract(DateTime.Now).TotalDays;
                        notifications.Add(new Notification(NotificationType.warning,
                                new A(Localization.Global.TrialWillExpire(ProGetConfig.Licensing.EnterpriseTrial ? "Enterprise" : "Basic", days))
                                { Href = LicensingOverviewPage.BuildUrl() }
                            ));
                    }                    
                    else if (expiresDate != null && expiresDate.Value.Subtract(DateTime.Now).TotalDays <= 45)
                    {
                        var days = (int)expiresDate.Value.Subtract(DateTime.Now).TotalDays;
                        notifications.Add(new Notification(NotificationType.warning,
                            new A(Localization.Global.KeyWillExpire(days))
                            { Href = LicensingOverviewPage.BuildUrl() }
                        ));
                    }
                    
            
                    var extensions = ExtensionsManager.GetExtensions();
            
                    if (!extensions.Any() || extensions.All(e => !e.LoadResult.Loaded))
                    {
                        notifications.Add(new Notification(
                            NotificationType.error,
                            InfoBlock.Error(
                                new A(Localization.Global.ExtensionLoadError) { Href = Pages.Administration.Extensions.ExtensionsOverviewPage.BuildUrl() }
                            )
                        ));
                    }
            
                    if (WUtil.ShowDockerRestartMessage)
                    {
                        notifications.Add(
                            new Notification(
                                NotificationType.warning,
                                InfoBlock.Warning(Localization.Global.ContainerRestartNeeded)
                            )
                        );
                    }
                }
               
                var v2Notifications = ShowV2DeprecatedQueriesUsedWarning(context);
                if (v2Notifications.Any())
                {
                    notifications.AddRange(v2Notifications.Select(f => new Notification(
                        NotificationType.warning,
                        InfoBlock.Warning(new A(ManageFeedPropertiesPage.BuildUrl(f.Feed_Id), $"{f.Feed_Name} is using deprecated ODATA (V2) Queries."))
                    )));
                }
            
                return notifications;
            }
            
            1 Reply Last reply Reply Quote 0
            • J Offline
              jw
              last edited by

              Hi @stevedennis

              Let's continue this thread here: EDO-10681

              1 Reply Last reply Reply Quote 0

              Hello! It looks like you're interested in this conversation, but you don't have an account yet.

              Getting fed up of having to scroll through the same posts each visit? When you register for an account, you'll always come back to exactly where you were before, and choose to be notified of new replies (either via email, or push notification). You'll also be able to save bookmarks and upvote posts to show your appreciation to other community members.

              With your input, this post could be even better 💗

              Register Login
              • 1 / 1
              • First post
                Last post
              Inedo Website Home • Support Home • Code of Conduct • Forums Guide • Documentation