Developer forum

Forum » Ecommerce - Standard features » Log outs automatic when saving product category field

Log outs automatic when saving product category field

Andreas Pettersson
Reply

Hi,

I have a weird problem. When I go in to settings => Ecommerce => Product catalog => productcategories and click on a field in a group. And change for example "Description field" it loads and then I be logged out automatically. Really weird behaviour. 

 

Anyone with the same problem?  Or have any idea whats wrong.
DW version: 9.13.1

It works in my local environment but not on production site.

Regards
Andreas


Replies

 
Shiwanka Chathuranga Dynamicweb Employee
Shiwanka Chathuranga
Reply
This post has been marked as an answer

This kind of case always use Event Viewer Of dynamicweb, that will give exact error to troubleshoot

Settings > System > Event Viewer

Votes for this answer: 1
 
Andreas Pettersson
Reply

Hi,

 

This is what shows up after i have pressed save and logged in again. And nothing has been logged before that regarding this. So in this case it did not print any error here what I can see.​

 

Regards

Andreas

 
Shiwanka Chathuranga Dynamicweb Employee
Shiwanka Chathuranga
Reply

Your logout happen because of app Pool recycle

if Dw event viewer not showing any thing before this line, you can goto windows event viewer to find why apppool recycle happened  

 
Andreas Pettersson
Reply

Hi,

In logfile in DW it says at that time when i save: 

2022-11-07 08:49:36.586: The client disconnected.. System.Web.HttpException (0x80070040): The client disconnected.    at System.Web.Hosting.IIS7WorkerRequest.BeginRead(Byte[] buffer, Int32 offset, Int32 count, AsyncCallback callback, Object state)    at System.Web.HttpBufferlessInputStream.BeginRead(Byte[] buffer, Int32 offset, Int32 count, AsyncCallback callback, Object state)    at System.IO.Stream.<>c.<BeginEndReadAsync>b__43_0(Stream stream, ReadWriteParameters args, AsyncCallback callback, Object state)    at System.Threading.Tasks.TaskFactory`1.FromAsyncTrim[TInstance,TArgs](TInstance thisRef, TArgs args, Func`5 beginMethod, Func`3 endMethod)    at System.IO.Stream.BeginEndReadAsync(Byte[] buffer, Int32 offset, Int32 count)    at System.IO.Stream.ReadAsync(Byte[] buffer, Int32 offset, Int32 count, CancellationToken cancellationToken)    at Microsoft.Owin.Host.SystemWeb.CallStreams.DelegatingStream.ReadAsync(Byte[] buffer, Int32 offset, Int32 count, CancellationToken cancellationToken)    at System.IO.Stream.ReadAsync(Byte[] buffer, Int32 offset, Int32 count)    at System.IO.StreamReader.<ReadBufferAsync>d__97.MoveNext() --- End of stack trace from previous location where exception was thrown ---    at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()    at System.IO.StreamReader.<ReadToEndAsyncInternal>d__62.MoveNext() --- End of stack trace from previous location where exception was thrown ---    at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()    at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)    at Microsoft.Owin.OwinRequest.<ReadFormAsync>d__80.MoveNext() --- End of stack trace from previous location where exception was thrown ---    at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()    at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)    at Microsoft.Owin.Security.WsFederation.WsFederationAuthenticationHandler.<AuthenticateCoreAsync>d__8.MoveNext() --- End of stack trace from previous location where exception was thrown ---    at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()    at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)    at Microsoft.Owin.Security.Infrastructure.AuthenticationHandler.<BaseInitializeAsync>d__31.MoveNext() --- End of stack trace from previous location where exception was thrown ---    at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()    at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)    at Microsoft.Owin.Security.Infrastructure.AuthenticationMiddleware`1.<Invoke>d__5.MoveNext() --- End of stack trace from previous location where exception was thrown ---    at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()    at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)    at Microsoft.Owin.Security.Infrastructure.AuthenticationMiddleware`1.<Invoke>d__5.MoveNext() --- End of stack trace from previous location where exception was thrown ---    at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()    at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)    at Microsoft.Owin.Security.Infrastructure.AuthenticationMiddleware`1.<Invoke>d__5.MoveNext() --- End of stack trace from previous location where exception was thrown ---    at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()    at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)    at Microsoft.Owin.Host.SystemWeb.IntegratedPipeline.IntegratedPipelineContextStage.<RunApp>d__7.MoveNext() --- End of stack trace from previous location where exception was thrown ---    at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()    at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)    at Microsoft.Owin.Host.SystemWeb.IntegratedPipeline.IntegratedPipelineContext.<DoFinalWork>d__12.MoveNext() --- End of stack trace from previous location where exception was thrown ---    at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()    at Microsoft.Owin.Host.SystemWeb.IntegratedPipeline.StageAsyncResult.End(IAsyncResult ar)    at System.Web.HttpApplication.AsyncEventExecutionStep.System.Web.HttpApplication.IExecutionStep.Execute()    at System.Web.HttpApplication.ExecuteStepImpl(IExecutionStep step)    at System.Web.HttpApplication.ExecuteStep(IExecutionStep step, Boolean& completedSynchronously)
2022-11-07 08:49:36.649: Request headers: [   "Cache-Control",   "Connection",   "Content-Length",   "Content-Type",   "Accept",   "Accept-Encoding",   "Accept-Language",   "Cookie",   "Host",   "Referer",   "User-Agent",   "sec-ch-ua",   "sec-ch-ua-mobile",   "sec-ch-ua-platform",   "upgrade-insecure-requests",   "origin",   "sec-fetch-site",   "sec-fetch-mode",   "sec-fetch-user",   "sec-fetch-dest" ]
2022-11-07 08:49:36.649: Request item keys: [   "owin.Environment",   {},   "Dynamicweb.Environment.Web",   "ExecutionTableMapper",   {},   {} ]
2022-11-07 08:49:36.649: Request form: []

 

 
Nicolai Pedersen Dynamicweb Employee
Nicolai Pedersen
Reply

Do we handle hosting?

What is setup in backend in terms of "External authentication"?

If you compare the web.config in your production environment to a standard DW web.config - do you see any differences?

Thanks for clarifying.

BR Nicolai

 
Andreas Pettersson
Reply

Hi,

No we handle hosting of the website.

Nothing special is addes in "External authentication"

 

We have a lot of appsettings in web.config for our specific needs

Here are some stuff that is different from our environment to 9.13.12 web.config file that i downloaded.

<httpRuntime targetFramework="4.7.2" />

<webHttpBinding>
        <binding name="webBinding">
          <security mode="Transport" />
        </binding>
      </webHttpBinding>

<system.data>
    <DbProviderFactories>
      <remove invariant="System.Data.SQLite.EF6" />
      <add name="SQLite Data Provider (Entity Framework 6)" invariant="System.Data.SQLite.EF6" description=".NET Framework Data Provider for SQLite (Entity Framework 6)" type="System.Data.SQLite.EF6.SQLiteProviderFactory, System.Data.SQLite.EF6" />
      <remove invariant="System.Data.SQLite" />
      <add name="SQLite Data Provider" invariant="System.Data.SQLite" description=".NET Framework Data Provider for SQLite" type="System.Data.SQLite.SQLiteFactory, System.Data.SQLite" />
    </DbProviderFactories>
  </system.data>

 

 
Nicolai Pedersen Dynamicweb Employee
Nicolai Pedersen
Reply

Hm - weird one.

If the stack you have provided is related to that save, it indicates some kind of security setup issue.

You could try to remove webHttpBinding section from web.config or set security mode to none and see if it impacts.

It is difficult for us to tell what it can be since it is not our hosting environement - you would have to dig into event viewer and maybe take a debug dump to see what could cause this weird behavior.

I can see your product category id is something coming from an integration - it could be worth taking a look at those IDs and verify that you do not have 'bad' characters in those IDs - i.e. non url characters...

All long shots...

 
Andreas Pettersson
Reply

The weird thing is that it sometimes work super. And sometimes i been logged out and the site goes down for a little time (guess det IIS restart) because if i do refresh on the site at the same time it trying ty save it just loads and loads...

The product category are created in DW so it's not fram an integration.

 
Andreas Pettersson
Reply

Hi,
On the server I get this error: 

Concurrency violation: the UpdateCommand affected 0 of the expected 1 records

And today when I test I dont get any errors at all but still logs out.. Weird.

 
Andreas Pettersson
Reply

Hi, 

Now I have change both database server and webserver and still the problem exists... It works if i download the database and whole web to my local machine. 
I dont know what the next step should be to try..

 

This is on our staging server:

 

And this is on production:

 

/Andreas

 
Shiwanka Chathuranga Dynamicweb Employee
Shiwanka Chathuranga
Reply

Andreas please buzz me at sc@dynamicwebapac.com

lets try to connect and give help

 
Adrian Ursu Dynamicweb Employee
Adrian Ursu
Reply

Hi guys,

I am interested to find out the solution if any,

We have seen similar behavior when managing ProductCategory fields but we could not find the cause. And the scenario is not consistent. It does not happen everytime.
At some point we have considered that the behavior could be related to concurrent updates on ProductCategory fields (multiple users making changes at the same time).
Changes to the ProductCategories and productCategory fields are saved in the GlobalSettings.ashx and maybe there could be an issue.

The log out seemed to be some sort of recycle of the application although we have not been able to capture anything in the logs (nor DW nor IIS).

If you get to the bottom of it, please post the conclusion/solution.

Thank you,

Adrian

 
Andreas Pettersson
Reply

Hi,

In my globalsettings.aspx on the last row it looks like there some sort of error:
The left file is production globalsettings and the right file is my local solution file. As you see it does not look i have any error in my local but in the production i got some sort of error.
I will investigate the file and see if i could find anything

 

/Andreas

 
Nicolai Pedersen Dynamicweb Employee
Nicolai Pedersen
Reply

Can you provide a zipped version of the entire config file?

Could this be related to a lot of category fields being saved to the config file?

 
Nicolai Pedersen Dynamicweb Employee
Nicolai Pedersen
Reply

And maybe a systemname of a field containing weird characters like <> / and other xml breaking things?

 
Andreas Pettersson
Reply

Here comes the zipped globalsettings.

Some fields:

 
Andreas Pettersson
Reply

When i remove this: <Style>True</Style> inside <neweditor> tags. The error goes away in Visual studio code. I dont know if this has anything to my main problem but...

 
Andreas Pettersson
Reply

I have now tried setting value 0 in the files without success: 
update.xml
UpdateVersion_ecom.xml

 
Nicolai Pedersen Dynamicweb Employee
Nicolai Pedersen
Reply

What is the server you are hosting on - Windows version? Is it 64bit?

Also it could be setup of the application pool that causes recycles - i.e. if it is set to recycle if memory goes above some number, or if CPU goes above something 

And if you compare the web.config with the standard web.config, do you see any differences?

Could be the setting below - or something else here. It could be a lot of exceptions on the server (look in Windows eventviewer) that causes the IIS to recycle. Something causes your IIS to recycle, and you need to figure out what it is by investigating the server.

 
Andreas Pettersson
Reply

Windows Server 2022 Standard

64-bit operating system, x64-based processor

Private memory limit is set to 0:

 

 
Nicolai Pedersen Dynamicweb Employee
Nicolai Pedersen
Reply

And what do you have in the windows event viewer?

 
Andreas Pettersson
Reply

In windows event viewer nothing is there at that timestamp when I been logged out.

Could it be something problem with the globalsettings file where these fields are stored? 

 
Nicolai Pedersen Dynamicweb Employee
Nicolai Pedersen
Reply

Yes - it can be many things...

But we cannot debug it for you in an external hosting environment...

The only thing we can offer is to get a zipped copy of the site and see if we can replicate it - which we probably cannot.

 
Adrian Ursu Dynamicweb Employee
Adrian Ursu
Reply

Hi guys,

I can confirm that you won't find anything in the EventViewer. We have tried various approaches to identify the issue but without any luck.

It is indeed hard to replicate and that makes it even harder to fix.

At this point I am unsure if the issue is a recycle of the application or just losing the authentication (Cookies or some other issue).

But one thing is for sure, it happens quite often, at least for our customers.

Adrian

 
Andreas Pettersson
Reply

I have now find another customer to us that this problem also exists on. And that customer has dw version 9.15.4.

But the problem seems to be when you:
Open a tab with admin and login
Then open another tab with the frontend site
Then clicking around on the frontend (view products etc)
Then go to the othe tab with admin and do a refresh
Then save a product field inside a product category

Could it be something with cookies/session things? 

 

You must be logged in to post in the forum