Discuss Dropbox Developer & API
Hi.
I am using the DropBox Core Java SDK from my Java application (v3.1.0 JARs).
In particular, I am uploading a certain number of small files (around 200 files, around 200 KB each), and for each file I am invoking the following code to get a public URL to the file:
============
DbxRequestConfig reqConfig = new DbxRequestConfig(CLIENT_IDENTIFIER);
DbxClientV2 client = new DbxClientV2(reqConfig, myAccessToken);
SharedLinkMetadata sharedLinkData = client.sharing().createSharedLinkWithSettings(pathInDropbox);
String shareablePreviewURL = sharedLinkData.getUrl();
============
For most files in my set, everything works fine. Just for 2/3 files out of 200, it is raising the following exception:
=============
com.dropbox.core.ServerException
at com.dropbox.core.DbxRequestUtil.unexpectedStatus(DbxRequestUtil.java:382)
at com.dropbox.core.v2.DbxRawClientV2$1.execute(DbxRawClientV2.java:154)
at com.dropbox.core.v2.DbxRawClientV2.executeRetriable(DbxRawClientV2.java:330)
at com.dropbox.core.v2.DbxRawClientV2.executeRetriableWithRefresh(DbxRawClientV2.java:351)
at com.dropbox.core.v2.DbxRawClientV2.rpcStyle(DbxRawClientV2.java:137)
at com.dropbox.core.v2.sharing.DbxUserSharingRequests.createSharedLinkWithSettings(DbxUserSharingRequests.java:465)
at com.dropbox.core.v2.sharing.DbxUserSharingRequests.createSharedLinkWithSettings(DbxUserSharingRequests.java:495)
[...]
=============
If I apply a "retry" policy in my application code, then calling again the createSharedLinkWithSettings() will result in the following exception:
=============
com.dropbox.core.v2.sharing.CreateSharedLinkWithSettingsErrorException: Exception in 2/sharing/create_shared_link_with_settings: {".tag":"shared_link_already_exists","shared_link_already_exists":{".tag":"metadata","metadata":{".tag":"file","url":"https://www.dropbox.com/s/j4hrqwqlqb331d4/00000107.dcm?dl=0","name":"00000107.dcm","link_permissions..."}}}
at com.dropbox.core.v2.sharing.DbxUserSharingRequests.createSharedLinkWithSettings(DbxUserSharingRequests.java:474)
at com.dropbox.core.v2.sharing.DbxUserSharingRequests.createSharedLinkWithSettings(DbxUserSharingRequests.java:495)
[...]
=============
So, for a given file, the first call to createSharedLinkWithSettings() sometimes raises a ServerException, but then if retry again with the same Dropbox file it complains that "shared_link_already_exists".
What is happening? Please notice that the same application code has been working flawlessly for the last 12 months or more.
Also, please notice that the exception only happens for 2/3 files out of a set of 200 files.
Can you guess why these exception are happening in the last few days?
Thanks in advance and best regards,
Marco Sambin
Can you try again now? Thanks again!
Hi there!
If you need more help you can view your support options (expected response time for a ticket is 24 hours), or contact us on X or Facebook.
For more info on available support options for your Dropbox plan, see this article.
If you found the answer to your question in this Community thread, please 'like' the post to say thanks and to let us know it was useful!