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.
Community moderators have prevented the ability to post new answers.
The errors seem to go away when re-using login tokens instead of requesting new ones.
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.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
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?
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
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.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Interesting, so far my tokens survived for multiple hours. But I will keep your experience in mind. Thanks for sharing.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.