cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
Announcements
Want to learn some quick and useful tips to make your day easier? Check out how Calvin uses Replay to get feedback from other teams at Dropbox here.

Dropbox API Support & Feedback

Find help with the Dropbox API from other developers.

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

java sdk: "error": "The given OAuth 2 access token doesn't exist or has expired."

java sdk: "error": "The given OAuth 2 access token doesn't exist or has expired."

rr z.
New member | Level 1

hello,

my application runs non stop (daemon) and checks every 10 seconds if a file has changed (lastmodified)
the application works well, but after some time (1 - 2 days) the token seems to be invalidated.

i did not invalidate it, and no one else has access to do this.
if i renew the token, the application will run again for some time and then stop with this error.
i tried generating a token through the dropbox app console and through the web interface.
the issue happens in both cases.

according to the documentation the token should be valid for "years"

can anyone help on how to avoid the token being invalidated.

thanks

environment:
java 7
raspbian latest version
dropbox java sdk latest version.

app name: dbxvfs

6 Replies 6

Greg-DB
Dropbox Staff

OAuth 2 access tokens for the Dropbox API don't expire, as you said, but they can be revoked:

Do any of these apply to your app? E.g., check your code for disable_access_token.

Also, you don't need to "renew" access tokens on the Dropbox API. Can you clarify what you mean by that?

rr z.
New member | Level 1

hello,

thanks for your answer.

i think the issue was on my side.
i had 2 instances of the app running in parallel using 2 different tokens.
in addition the apps did not correctly store the tokens.
after resolving this it seems that the issue did not reoccur.

i think you can consider this as a non-issue.

by "renew" i mean is generate a new token through the app console.

rr z.
New member | Level 1

hello,

it seems that this still happens.
I am now sure that my application works correctly.

at 15-04-14 08:25:19 (central european time) i created a new token through the app console "generate access token" function and restarted my application

at 15-04-14 20:22:49 the java sdk throws the following exception:

  Caused by: {"error": "The given OAuth 2 access token doesn't exist or has expired."}
    com.dropbox.core.DbxRequestUtil.unexpectedStatus(DbxRequestUtil.java:208)
    com.dropbox.core.DbxClient$2.handle(DbxClient.java:186)
    com.dropbox.core.DbxRequestUtil.doGet(DbxRequestUtil.java:242)
    com.dropbox.core.DbxClient.doGet(DbxClient.java:1942)
    com.dropbox.core.DbxClient.getMetadataWithChildrenBase(DbxClient.java:181)
    com.dropbox.core.DbxClient.getMetadataWithChildren(DbxClient.java:148)

it seems that the token has been invalidated after 12 hours.

i am pretty sure that i did not invalidate it.

this is pretty annoying. because it makes the usage of dropbox for this kind of applications unpredictable.

Greg-DB
Dropbox Staff

Have you checked your code for disable_access_token or disableAccessToken though? (The latter is the method in the Java SDK that calls the /disable_access_token endpoint.)

rr z.
New member | Level 1

hello,

yes, there was a call to disableAccessToken.
the process is restarted approx every 2 hours.
at stop of the process this method was invoked.

however what wonders me is why the invocation of this method may disables the current token at random.
at times the token will be valid for 1-2 days although it is being disabled every 2 hours.

i have not removed all invocations to this method and will post again if this issue still remains.

thanks

-- Ron

rr z.
New member | Level 1

ps: typo: i meant to write:
i have removed all invocations to this method and will post again if this issue still remains.

Need more support?
Who's talking

Top contributors to this post

  • User avatar
    rr z. New member | Level 1
  • User avatar
    Greg-DB Dropbox Staff
What do Dropbox user levels mean?