Create
cancel
Showing results for 
Search instead for 
Did you mean: 
Sign up Log in

Sporadic InvalidSessionException when calling getPage of SOAP web service

heinrich-ulbricht-communardo November 19, 2012

I am facing a problem when using the SOAP API to access pages of a Confluence installation.

Desciption of problem
----------------------------

When calling getPage(token, pageId) I am sometimes faced with this exception (which is returned in a SOAP message):

com.atlassian.confluence.rpc.InvalidSessionException: User not authenticated or session expired. Call login() to open a new session

But in most cases it just works fine.

I verified this behavior using soapUI to make sure that I have the easiest test case possible. I first call login(name, pass) to get a token. This always succeeds, I get a token. But there seem to be two kind of tokens: one kind which will always give me the above exception when using it as parameter of getPage. And one kind that does never give the exception.

(Note: Not much time passes between the two calls, just half a minute or so. So it can't be a cache timeout.)

This seems to be not a problem with the page nor with the login data. Because after getting a faulty token (which gives me the above exception) I can request another one (using login using the exact same login data) and request the same page again - and it will succeed.

So a workaround seems to be to request new tokens until the access succeeds. But that's far from a solution.

Context
------------

The same login data is used to get multiple tokens which will all be used in parallel. Confluence content is being accessed using these tokens in a highly concurrent manner. And I have the suspicion that the error occurs more often the more concurency (and thus load) there is on the Confluence installation. But that's just a feeling.

The Confluence version is 4.3.1.

Any help on this matter is greatly appreciated.

1 answer

1 accepted

Comments for this post are closed

Community moderators have prevented the ability to post new answers.

Post a new question

0 votes
Answer accepted
heinrich-ulbricht-communardo December 17, 2012

The errors seem to go away when re-using login tokens instead of requesting new ones.

Bob Swift OSS (Bob Swift Atlassian Apps)
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
December 17, 2012

Thanks for posting. I don't recall haven't seen this issue, but I don't do high concurrency. Just a tip on token reuse, cover the case where they may timeout.

heinrich-ulbricht-communardo January 1, 2013

Thanks for the tip. Apart from (inactivity-)timeout: is there a maximum time I can use the token before I have to request a new one? Does such a usage-timeout exist?

Bob Swift OSS (Bob Swift Atlassian Apps)
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
January 1, 2013

I use 30 mins as the upper limit more from experience rather than any specific documentation I could find. That means I regen the token before another series of actions if older than say 20 mins to allow some time for the actions to complete within the limit.

heinrich-ulbricht-communardo January 2, 2013

Interesting, so far my tokens survived for multiple hours. But I will keep your experience in mind. Thanks for sharing.

TAGS
AUG Leaders

Atlassian Community Events