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: 

Re: Internal Server Error 500 when sharing folder

Internal Server Error 500 when sharing folder

petepete717
Helpful | Level 6

When running my code I can share a folder one or two times but then I receive the Internal Server Error 500 afterwards.

 

Creating the shared folder works:

 

client.sharing.shareFolder(path: pathName).response { launch, error in

            switch launch {

            case .complete(let launchData):

               let id = launchData.sharedFolderID

               -> Code for adding shared member called from here

             shareFolder(id: id)

            case .asyncJobId(let jobID):

                // Do my async things here

                }

            case .none:

                print("None")

            }

}

 

func shareFolder(id: String) {

let member = Sharing.AddMember(member: .email("my.test@email.com))

client.sharing.addFolderMember(sharedFolderId: id,

                                       members: [member],

                                       quiet: false,

                                       customMessage: "Welcome to EZfile!")

        .response { _, error in

            switch error {

            case .none:

               print("Success creating share")

            case .some(let wrapped):

                print("Sharing folder error: \(#function)", wrapped)

            }

        }

}

 

The folder is created (I see it in Dropbox) but the share does not work in 80% of the times. Which indicates that I am creating the client correctly.

 

What am I missing here?

12 Replies 12

Greg-DB
Dropbox Staff

Thanks for the report. Can you share several request IDs (see here) for some of these failures? That would help us check on it.

petepete717
Helpful | Level 6

Here you go:

 

When I run 

switch error {

            case .internalServerError(let code, let message, let requestId):

                print("InternalServerError[\(requestId)]: \(code): \(message)")

 

 

it prints

InternalServerError[nil]: 500: Optional("")

 

I also checked: The sharedFolderID is correct.

Greg-DB
Dropbox Staff

Thanks for following up. Unfortunately it appears the request ID is not actually getting set there for some reason.

 

Can you confirm if you're performing these calls using an app owned by the Dropbox account you're using to post in the forum here? We can try to look up the failures that way instead.

petepete717
Helpful | Level 6
Hi Greg
Yes I checked - it is from the same account as I am posting from here on the forum.
Thanks for looking into this. Without this functionality working 100% unfortunately I cannot publish my app.

Greg-DB
Dropbox Staff

Thanks for confirming! We'll look into it and I'll follow up here with any updates for you.

petepete717
Helpful | Level 6
Thank you very much!

Greg-DB
Dropbox Staff

The team is looking into this, but they're asking if you can share a little more context on the failure rate you're seeing. Specifically, you mentioned it "does not work in 80% of the times", but can you offer some more details on that? For instance, are you always seeing an 80% failure rate on these calls, or does it only fail at that rate sometimes?

 

Also, are you running multiple addFolderMember calls at the same time? (Note that it runs asynchronously.)

 

Thanks!

PeteFromCH
New member | Level 2

What I have found is that when I log in the first time for the day it works a few times. Then only intermittently. 
Yesterday afternoon I could not get addFolderMember to work at all. Tried perhaps 10-20 times but no success. 
Interestingly enough, the folder always gets created. Which would seem to prove that I am logged in and have set up the client correctly? Also I checked to ensure that the sharedFolderID gets passed into addFolderMember

I only call addFolderMember once. 

One thing I did notice - it seems that my success rate is slightly higher if I pause the program after the folder is created but before addFolderMember is called. But it is far from 100%. 

I hope this helps. Please let me know if you need any more details. 

petepete717
Helpful | Level 6

What I have found is that when I log in the first time for the day it works a few times. Then only intermittently. 
Yesterday afternoon I could not get addFolderMember to work at all. Tried perhaps 10-20 times but no success. 
Interestingly enough, the folder always gets created. Which would seem to prove that I am logged in and have set up the client correctly? Also I checked to ensure that the sharedFolderID gets passed into addFolderMember

I only call addFolderMember once. 

One thing I did notice - it seems that my success rate is slightly higher if I pause the program after the folder is created but before addFolderMember is called. But it is far from 100%. 

I hope this helps. Please let me know if you need any more details. Thanks!

Need more support?