cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
Announcements
Share your feedback on the Document Scanning Experience in the Dropbox App right here.

Discuss Dropbox Developer & API

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

ServerException on createSharedLinkWithSettings()

ServerException on createSharedLinkWithSettings()

MarcoNL
Explorer | Level 3

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

10 Replies 10

Greg-DB
Dropbox Staff

Can you try again now? Thanks again!

Need more support?
Who's talking

Top contributors to this post

  • User avatar
    Greg-DB Dropbox Staff
  • User avatar
    MarcoNL Explorer | Level 3
  • User avatar
    TaylorKrusen Dropbox Staff
What do Dropbox user levels mean?