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":{"can_revoke":true,"resolved_visibility":"public","requested_visibility":"public"},"client_modified":"2019-05-22T09:53:27Z","server_modified":"2019-05-22T09:53:28Z","rev":"2b154336976b","size":226880,"id":"id:qfZ_JAWlk-AAAAAAAAAP4w","path_lower":"/sharedstudies/shareop_99995_1558518735130/00000107.dcm"}}}
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