Skip to content
This repository has been archived by the owner on Feb 7, 2018. It is now read-only.

"Unable to load session attributes" warning #5

Closed
kbreidenbach opened this issue Nov 15, 2013 · 11 comments
Closed

"Unable to load session attributes" warning #5

kbreidenbach opened this issue Nov 15, 2013 · 11 comments

Comments

@kbreidenbach
Copy link

We are testing the DynamoDB session manager and have altered our test to use smaller sessions (thanks for the response on my last issue BTW).

Now, when we try to fail over from one server to another by removing an instance from the ELB we often see this error:
WARNING: Unable to load session attributes for session 0F80C708C7FA5F4CF85164AA8DF7FF5A
Nov 15, 2013 3:24:50 PM com.amazonaws.services.dynamodb.sessionmanager.DynamoDBSessionManager warn

When this happens it seems the user experiences receiving a new session. Is there a configuration setting we're missing to fix this? We've tried maxIdleBackup, but that doesn't seem to help.

Thanks,
KB

@fulghum
Copy link
Contributor

fulghum commented Nov 21, 2013

Hey KB, thanks for reporting this. My guess would be that the data wasn't able to be loaded from DynamoDB, possibly because it was removed by some process. We'll have to dig in a little more on this, and see if we can debug through a repro case. Let us know if you find any more clues on your end.

@override11
Copy link

I am having that same issue, tons of spam about being unable to load session attributes for session XXXXXX

We are using tomcat 7 and spring security, and we are using the latest 1.0.1 jar file from github

In the amazon account management, I created an AWS keyset that only has full access to DynamoDB

I can see the session entity getting created in Dynamo, but not sure how to gain insight here inside the JAR as far as what is going on, and where this error is coming from, any advice on how to proceed with this?

@fulghum
Copy link
Contributor

fulghum commented Dec 6, 2013

Hey Override11, do you see the same session ID being stored in Dynamo, but Tomcat isn't able to load it? Or is it missing from Dynamo, too? (just wanted to confirm)

We'll see if we can repo the error messages. Let us know if you have any additional information for the repro case.

@override11
Copy link

I will circle back when I get home, but iirc the session was named
properly to what I saw on dynamoDB
On Dec 6, 2013 5:30 PM, "Jason Fulghum" notifications@github.com wrote:

Hey Override11, do you see the same session ID being stored in Dynamo, but
Tomcat isn't able to load it? Or is it missing from Dynamo, too? (just
wanted to confirm)

We'll see if we can repo the error messages. Let us know if you have any
additional information for the repro case.


Reply to this email directly or view it on GitHubhttps://github.com//issues/5#issuecomment-30035254
.

@override11
Copy link

in fact, it appears that its trying to load a session that does not exist

In dynamoDB its showing:

"19759199FF93D8648A738140B2E35900"

in my application, I'm getting:

2013-12-06 19:42:55| http-bio-8888-exec-4 | WARN | com.amazonaws.services.dynamodb.sessionmanager.DynamoDBSessionManager.warn(): Unable to load session attributes for session EC0A93613FA69310498C4B4ABEDC9DF8

thats curious, wonder what is causing that...

Yes I am able to login to my application, even if I get that error, but I certainly don't fail-over in the event of a server switch in our load-balanced cluster

@spgmx
Copy link

spgmx commented Dec 13, 2013

The ExpiredSessionReaper deletes all sessions older than the deafult value from the store or the webapp. If you use session specific timeouts (greater than default), the reaper will deleted the session although the session should still be valid.
Other prob might be that ur client (browser) sends an outdated session cookie.

@moskinson
Copy link

Do you have fix this issue? I am having the same problem.

Jan 08, 2014 3:42:21 PM com.amazonaws.services.dynamodb.sessionmanager.DynamoDBSessionManager warn
WARNING: Unable to load session attributes for session 93A0A13B56583DFA7EE345347C73611E

This sessionId does not exists at Tomcat_SessionState in DynamoDB.
I have given Full Dynamo DB Access to the Beanstalk IamRole
The Load Balancer has sticky session by cookie with no expiration time
I have edited web.xml with tracking code to cookie
session-config:
session-timeout 30
tracking-mode COOKIE

@eniveld
Copy link

eniveld commented May 6, 2014

I'm having the same problem as y'all and have yet to figure it out. However, I did just run across this rather ominous note in the documentation for the AWS DynamoDB Tomcat Session manager (from the bottom of http://docs.aws.amazon.com/AWSSdkDocsJava/latest/DeveloperGuide/java-dg-tomcat-session-manager.html):

Limitations

The session manager does not support session locking. Therefore, applications that use many concurrent AJAX calls to manipulate session data may not be appropriate for use with the session manager, due to race conditions on session data writes and saves back to the data store.

@i72peesj
Copy link

i72peesj commented May 7, 2014

In fact, i discovered that sticky session option is available. ;)

2014-05-07 1:51 GMT+02:00 eniveld notifications@github.com:

I'm having the same problem as y'all and have yet to figure it out.
However, I did just run across this rather ominous note in the
documentation for the AWS DynamoDB Tomcat Session manager (from the bottom
of
http://docs.aws.amazon.com/AWSSdkDocsJava/latest/DeveloperGuide/java-dg-tomcat-session-manager.html
):

Limitations

The session manager does not support session locking. Therefore,
applications that use many concurrent AJAX calls to manipulate session data
may not be appropriate for use with the session manager, due to race
conditions on session data writes and saves back to the data store.


Reply to this email directly or view it on GitHubhttps://github.com//issues/5#issuecomment-42374050
.

https://twitter.com/i72peesj
http://es.linkedin.com/in/juanluisperezhttp://es.linkedin.com/in/juanluisperez

Juan Luis Pérez Estrella
Director de tecnología y Socio Fundador
jlperez@intelify.net
M +34 636424769 / F +34 957760033

Antes de imprimir este correo piense si es realmente necesario; Please
consider your environmental responsibility before printing this e-mail.

Este mensaje contiene información reservada y confidencial destinada
exclusivamente al destinatario. Si usted no es el destinatario, no está
autorizado a copiar, reproducir o distribuir este mensaje ni su contenido.
Si ha recibido este mensaje por error, le rogamos que nos lo notifique
inmediatamente.

Le informamos que sus datos personales, que puedan constar en este mensaje,
están incorporados a un fichero automatizado responsabilidad de Intelify
con la finalidad de realizar las gestiones derivadas de los servicios que
prestamos. En cualquier momento usted podrá ejercer sus derechos de acceso,
rectificación, cancelación y oposición, enviando un email a:
info@intelify.net. Intelify es una marca de Ciudad2020 S.L.

@eniveld
Copy link

eniveld commented May 7, 2014

I am looking at the source to DynamoDBSessionManager.java and I see this line of code in the constructor:

    setMaxInactiveInterval(60 * 60 * 2); // 2 hours

Here's the scenario I'm worried about. Say I've got a beanstalk cluster with 2 EC2 servers going, and no session stickiness. The user goes to server 1, and then a few minutes later goes to server 2, and then stays with server 2 for a while. Meanwhile, after 2 hours, his session on server 1 expires and the session is removed from the store. Even though server 2 is still actively going. Then we get an error that the session is missing.

Should it not be respecting the session-timeout set in web.xml?

Am I misinterpreting the code?

@dsjohnsonMaine
Copy link

That only controls when sessions are expired, not how often they get persisted.

I wouldn't recommend going without sticky session, but if you do, then you must force sessions to persist quick enough that the current session will be on the DB to be swapped in by other servers, and keep maxIdleSwap = maxIdleBackup, so you don't come back to a server with a stale session in memory. If you have sticky session, then this risk is minimized, and longer swap than backup allows ongoing activity to be handled by same server without having to swap in, while making frequent backups as a hedge against server outage, for failover.

Look at processExpiresFrequency, maxIdleBackup, maxIdleSwap, minIdleSwap, backgroundProcessorDelay.

On May 6, 2014, at 8:39PM, eniveld wrote:

@shorea shorea closed this as completed Mar 31, 2016
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

9 participants