Erro no Login - Valor não pode ser nulo

Boa tarde!

Temos um cliente, que constantemente reclama da mensagem da imagem abaixo na hora de tentar fazer login no sistema, porém, todas as vezes depois de um tempo (algumas horas ou até mesmo um dia) ele consegue logar normalmente.

Conseguem nos ajudar a sanar este problema de vez no cliente?

Att,
Nielson Santos

Olá @nielson.santos

Já vi este erro ocorrer quando ocorre uma falha ao acessar o banco de dados e a sessão do usuário é iniciada, porém inválida.

O problema costuma estar relacionado ao arquivo config.xml estar apontando para um banco de dados que não existe, mas não parece ser o caso, já que é intermitente.

Veja se consegue encontrar na pasta App_Data/Log ou App_Data/Log/Users/Nome_Do_Usuario algum arquivo de log que tenha essa mensagem de erro. Se encontrar, poste a mensagem completa aqui.

Bom dia!
Vou verificar se conseguimos achar esse arquivo de log coloco aqui em seguida.

Obrigado

Não sei sei é esse logo que vc se referia, mas vou colar o ultimo que tem lá:

Data/Hora            Tipo     Origem                Categoria                 ID     Tempo            Mensagem
===========================================================================================================================================================================================================================================
2021-02-03 11:20:08  Error    LATROMI Web           --                        --     --               Erro ao carregar o logotipo
    Informacoes Adicionais:
    	sender: ASP.global_asax
    	e: System.EventArgs
    	app: ASP.global_asax
    	context: System.Web.HttpContext
    	Url: http://168.138.252.59:8084/web/Default.aspx
    	UrlReferrer: <null>

    em LATROMI.Web.UI.Global.Application_AcquireRequestState(Object sender, EventArgs e)
       em System.Web.HttpApplication.SyncEventExecutionStep.System.Web.HttpApplication.IExecutionStep.Execute()
       em System.Web.HttpApplication.ExecuteStepImpl(IExecutionStep step)
       em System.Web.HttpApplication.ExecuteStep(IExecutionStep step, Boolean& completedSynchronously)
       em System.Web.HttpApplication.PipelineStepManager.ResumeSteps(Exception error)
       em System.Web.HttpApplication.BeginProcessRequestNotification(HttpContext context, AsyncCallback cb)
       em System.Web.HttpRuntime.ProcessRequestNotificationPrivate(IIS7WorkerRequest wr, HttpContext context)
       em System.Web.Hosting.PipelineRuntime.ProcessRequestNotificationHelper(IntPtr rootedObjectsPointer, IntPtr nativeRequestContext, IntPtr moduleData, Int32 flags)
       em System.Web.Hosting.PipelineRuntime.ProcessRequestNotification(IntPtr rootedObjectsPointer, IntPtr nativeRequestContext, IntPtr moduleData, Int32 flags)
       em System.Web.Hosting.UnsafeIISMethods.MgdIndicateCompletion(IntPtr pHandler, RequestNotificationStatus& notificationStatus)
       em System.Web.Hosting.UnsafeIISMethods.MgdIndicateCompletion(IntPtr pHandler, RequestNotificationStatus& notificationStatus)
       em System.Web.Hosting.PipelineRuntime.ProcessRequestNotificationHelper(IntPtr rootedObjectsPointer, IntPtr nativeRequestContext, IntPtr moduleData, Int32 flags)
       em System.Web.Hosting.PipelineRuntime.ProcessRequestNotification(IntPtr rootedObjectsPointer, IntPtr nativeRequestContext, IntPtr moduleData, Int32 flags)

2021-02-03 11:20:09  Error    LATROMI Web           --                        --     --               System.Web.HttpUnhandledException (0x80004005): Exceção do tipo 'System.Web.HttpUnhandledException' foi acionada. ---> System.FieldAccessException: O valor da propriedade 'AuthTicket' não pode ser nulo.      em LATROMI.Common.BLL.BaseBLL.ThrowIfAuthTicketIsNull()      em LATROMI.BLL.Estatistica.UltimosAcessos(Int32 limit)      em LATROMI.Web.UI.Default.CarregarRecentes(Int32 limit)      em LATROMI.Web.UI.Default.MontaPagina()      em LATROMI.Web.UI.Default.Page_Init(Object sender, EventArgs e)      em System.EventHandler.Invoke(Object sender, EventArgs e)      em System.Web.UI.Control.OnInit(EventArgs e)      em System.Web.UI.Page.OnInit(EventArgs e)      em LATROMI.Web.UI.BasePage.OnInit(EventArgs e)      em System.Web.UI.Control.InitRecursive(Control namingContainer)      em System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint)      em System.Web.UI.Page.HandleError(Exception e)      em System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint)      em System.Web.UI.Page.ProcessRequest(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint)      em System.Web.UI.Page.ProcessRequest()      em System.Web.UI.Page.ProcessRequest(HttpContext context)      em System.Web.HttpApplication.CallHandlerExecutionStep.System.Web.HttpApplication.IExecutionStep.Execute()      em System.Web.HttpApplication.ExecuteStepImpl(IExecutionStep step)      em System.Web.HttpApplication.ExecuteStep(IExecutionStep step, Boolean& completedSynchronously)      [System.Web.HttpUnhandledException]         Message:   Exceção do tipo 'System.Web.HttpUnhandledException' foi acionada.      Source:   System.Web   ----------------------------------------------------------------------      [System.FieldAccessException]         Message:   O valor da propriedade 'AuthTicket' não pode ser nulo.      Source:   LATROMI.Common.BLL   
    System.Web.HttpUnhandledException (0x80004005): Exceção do tipo 'System.Web.HttpUnhandledException' foi acionada. ---> System.FieldAccessException: O valor da propriedade 'AuthTicket' não pode ser nulo.
       em LATROMI.Common.BLL.BaseBLL.ThrowIfAuthTicketIsNull()
       em LATROMI.BLL.Estatistica.UltimosAcessos(Int32 limit)
       em LATROMI.Web.UI.Default.CarregarRecentes(Int32 limit)
       em LATROMI.Web.UI.Default.MontaPagina()
       em LATROMI.Web.UI.Default.Page_Init(Object sender, EventArgs e)
       em System.EventHandler.Invoke(Object sender, EventArgs e)
       em System.Web.UI.Control.OnInit(EventArgs e)
       em System.Web.UI.Page.OnInit(EventArgs e)
       em LATROMI.Web.UI.BasePage.OnInit(EventArgs e)
       em System.Web.UI.Control.InitRecursive(Control namingContainer)
       em System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint)
       em System.Web.UI.Page.HandleError(Exception e)
       em System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint)
       em System.Web.UI.Page.ProcessRequest(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint)
       em System.Web.UI.Page.ProcessRequest()
       em System.Web.UI.Page.ProcessRequest(HttpContext context)
       em System.Web.HttpApplication.CallHandlerExecutionStep.System.Web.HttpApplication.IExecutionStep.Execute()
       em System.Web.HttpApplication.ExecuteStepImpl(IExecutionStep step)
       em System.Web.HttpApplication.ExecuteStep(IExecutionStep step, Boolean& completedSynchronously)

    em LATROMI.Web.UI.Global.Application_Error(Object sender, EventArgs e)
       em System.Web.HttpApplication.RaiseOnError()
       em System.Web.HttpApplication.RecordError(Exception error)
       em System.Web.HttpApplication.PipelineStepManager.ResumeSteps(Exception error)
       em System.Web.HttpApplication.BeginProcessRequestNotification(HttpContext context, AsyncCallback cb)
       em System.Web.HttpRuntime.ProcessRequestNotificationPrivate(IIS7WorkerRequest wr, HttpContext context)
       em System.Web.Hosting.PipelineRuntime.ProcessRequestNotificationHelper(IntPtr rootedObjectsPointer, IntPtr nativeRequestContext, IntPtr moduleData, Int32 flags)
       em System.Web.Hosting.PipelineRuntime.ProcessRequestNotification(IntPtr rootedObjectsPointer, IntPtr nativeRequestContext, IntPtr moduleData, Int32 flags)
       em System.Web.Hosting.UnsafeIISMethods.MgdIndicateCompletion(IntPtr pHandler, RequestNotificationStatus& notificationStatus)
       em System.Web.Hosting.UnsafeIISMethods.MgdIndicateCompletion(IntPtr pHandler, RequestNotificationStatus& notificationStatus)
       em System.Web.Hosting.PipelineRuntime.ProcessRequestNotificationHelper(IntPtr rootedObjectsPointer, IntPtr nativeRequestContext, IntPtr moduleData, Int32 flags)
       em System.Web.Hosting.PipelineRuntime.ProcessRequestNotification(IntPtr rootedObjectsPointer, IntPtr nativeRequestContext, IntPtr moduleData, Int32 flags)

Esse log peguei da pasta \App_Data\Log, era o ultimo que tinha.

Obrigado @nielson.santos.

O log é este mesmo. Vou dar uma estudada nele pra ver se descubro o que está acontecendo.

Por enquanto, caso acontece, reinicie o site no IIS.

Vou repassar essa orientação paliativa para nosso contato no cliente.

Aguardo mais detalhes posteriormente.

@nielson.santos, nos logs tu não encontrou a mensagem que aparece na tela de login?

Bom dia.
Não, aquela não.

Bom dia @daniel.giacomelli, conseguiu descobrir alguma coisa sobre o erro informado?

Att,
Nielson Santos

Olá @nielson.santos!

Sim, conseguimos descobrir do que se trata.

O erro está documentado neste tópico:

Este ambiente provavelmente deve estar perdendo a conexão com o banco do LATROMI com frequência.

Você pode verificar isso enquanto a correção não for publicada.

Olá @nielson.santos.

A correção deste problema foi realizada no LATROMI Web v3.5.291.

Foi implementado um tratamento para fazer com o que sistema se recupere de uma inicialização mal sucedida.

Obrigado @daniel.giacomelli , vou repassar para o cliente e avaliar se paramos de ter esse problema.