-
Notifications
You must be signed in to change notification settings - Fork 117
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
513 error when running api v 2 on two different devices #60
Comments
|
@markmcminn: Thanks for reaching out. Looks like the Dropbox SDK is having trouble moving a recently downloaded file from it's temporary location to it's final destination. Usually the download flow for the SDK looks like:
It would be helpful to get a stack trace of the failure so I can identify which move operation in the above flow is failing. Also, I would ask you to examine closely the value you're supply for the Based on this error, it is possible that your app logic is generating a Would you mind telling me a little bit more about how your app uses the Dropbox API? Is it designed to automatically download everything from a user's Dropbox account and upload it to iCloud? Are there specific conditions that trigger a download from Dropbox? |
|
Thanks for the reply. This is a competency based app that is used to give feedback to doctoral students on course assignments. If the assignment is a Word document, for example, the faculty member marks it up on his or her computer and then saves it to a Dropbox file. Then in the iOS app the faculty member completes a rubric, makes comments, and then attaches the file from Dropbox. The email is sent to the student with the Dropbox file as attachment. When the rubric score is uploaded to iCloud, the Word file from Dropbox is also uploaded and stored as a CKAsset in iCloud. It all works perfectly on my iPad right now, but I get the error described above on my iPhone. Last week, with the same code, it was just the opposite. It was working great on my iPhone, but I got this error on my iPad. Regarding the destination url, here is the code I am using, which is modeled after the sample I found on your github site (very helpful, by the way!): DropboxClient *client = [DropboxClientsManager authorizedClient]; It works fine on both the iPad and iPhone when it's working, but when it is not working I get the error. I've not done a Stack Trace before. Does this look like what you need? ( Thanks for looking into this! Mark |
|
Now I'm getting the error on both of my devices. The code hasn't changed. |
|
Here is the destination url where the file is to be written on the iPad. file:///var/mobile/Containers/Data/Application/D1C08C61-3A05-4113-ADFE-A2A9D103670E/Documents/Attachment1 Here is the error message: UserInfo={NSSourceFilePathErrorKey=/var/mobile/Library/Caches/com.apple.nsurlsessiond/Downloads/com.114consulting.CLASFaculty/CFNetworkDownload_MwlHQw.tmp, NSUserStringVariant=(\n Move\n), NSDestinationFilePath=/var/mobile/Containers/Data/Application/D1C08C61-3A05-4113-ADFE-A2A9D103670E/Documents/Attachment1, NSFilePath=/var/mobile/Library/Caches/com.apple.nsurlsessiond/Downloads/com.114consulting.CLASFaculty/CFNetworkDownload_MwlHQw.tmp, NSUnderlyingError=0x1706459a0 {Error Domain=NSPOSIXErrorDomain Code=1 "Operation not permitted"}}"; It looks to me like it's not allowing the file to be moved from the temporary location you mentioned in your earlier email. |
|
Okay, here's a bit more information. I traced the error to the Dropbox Framework. It's occurring in this method:
There is a an if (handlerQueue) a few lines in, and then an else {responseHandler(location, downloadTask.response, nil);} clause. The error is occurring in response to the else clause in this if-then-else statement. Does this help? |
|
And a bit more information... If I use the client.filesRoutes downloadData method instead of client.filesRoutes downloadUrl, I don't get the 513 error. Everything seems to work fine in terms of progress monitoring and the metadata download, but the NSData object is nil at the end of the download. |
|
Got it working today by resetting my devices to factory settings. Perhaps things will work for a while now, but I still think there are some issues here. |
|
@markmcminn: Sorry we couldn't be more helpful. Let us know if the issue persists, in which case we can really dive in to get to the bottom of it. |
|
I saw a similar problem (not using Dropbox SDK) where the I suspect this is a bug in |
|
I found this thread while searching for a solution to the same problem. I was able to work around it in my app by setting the sharedContainerIdentifier of the URLSession. The app's extensions don't actually need to use any of the downloaded content, but setting the value to the app group identifier seems to have the effect of keeping the downloaded files in the sandbox container. |
|
Thanks so much! I’ll give this a try. I’ve discovered that the problem seems to be using the same device for development and then also for downloading the app from the App Store and running it that way. If I only do one or the other I don’t seem to get the error. Once I get the error, I need to completely reset the device to get it working again.
Mark
… On Mar 7, 2017, at 9:17 AM, claurel ***@***.***> wrote:
I found this thread while searching for a solution to the same problem. I was able to work around it in my app by setting the sharedContainerIdentifier of the URLSession. The app's extensions don't actually need to use any of the downloaded content, but setting the value to the app group identifier seems to have the effect of keeping the downloaded files in the sandbox container.
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub <#60 (comment)>, or mute the thread <https://github.com/notifications/unsubscribe-auth/ANTgMyNMK2p4F5FMyTyBxZJfb8YM165Bks5rjZEvgaJpZM4Kwh2w>.
|
|
@claurel: Thanks for the suggestion. @markmcminn: Let us know if that solves the issue for you. I can push out a change to expose |
|
Yes, this seems to solve the issue. I added this code in the application didFinishLaunchingWithOptions method of the app delegate, right after the setupWithAppKey method, some of which I found in another Dropbox discussion about how to configure a separate NSURLSession.
DBTransportClient *transportClient = [DropboxClientsManager authorizedClient].transportClient;
if (transportClient)
{
NSString *backgroundId = [NSString stringWithFormat:@"%@.%@", @"com.dropbox.dropbox_sdk_obj_c_background", [NSUUID UUID].UUIDString];
NSURLSessionConfiguration *backgroundSessionConfig = [NSURLSessionConfiguration backgroundSessionConfigurationWithIdentifier:backgroundId];
backgroundSessionConfig.sharedContainerIdentifier = [app bundle identifier here];
transportClient.backgroundSession = [NSURLSession sessionWithConfiguration:backgroundSessionConfig delegate:transportClient.delegate delegateQueue:transportClient.delegateQueue];
}
Thanks @claurel <https://github.com/claurel> !
Mark
… On Mar 7, 2017, at 11:08 AM, Stephen Cobbe ***@***.***> wrote:
@claurel <https://github.com/claurel>: Thanks for the suggestion. @markmcminn <https://github.com/markmcminn>: Let us know if that solves the issue for you. I can push out a change to expose sharedContainerIdentifier and set it to the app group identifier by default.
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub <#60 (comment)>, or mute the thread <https://github.com/notifications/unsubscribe-auth/ANTgM0ujbYbitv17EBmkdRjLAHMU51Dbks5rjas-gaJpZM4Kwh2w>.
|
|
@markmcminn: That's great to hear. Just wanted to clarify – did you see this error occurring in the context of using an app extension, or no? |
|
No. I’ve never used app extensions, so don’t know much about them.
… On Mar 8, 2017, at 11:03 AM, Stephen Cobbe ***@***.***> wrote:
@markmcminn <https://github.com/markmcminn>: That's great to hear. Just wanted to clarify – did you see this error occurring in the context of using an app extension, or no?
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub <#60 (comment)>, or mute the thread <https://github.com/notifications/unsubscribe-auth/ANTgM79fjRhG-DCRh10B9EA-Ruqquv2fks5rjvtygaJpZM4Kwh2w>.
|
|
@markmcminn: Got it, thanks! |
|
@markmcminn: Thanks for your patience, and let us know if anything else comes up. |
|
I should add I'm seeing this almost every single time and I'm not using an App Extension. I'll try this solution out. |
|
@guidedways: Any luck? |
|
@scobbe sorry was still testing - I think that fixed it for me as I've stopped seeing these errors spring up. Weird! |
|
@guidedways: Good to hear the issue was resolved. Were you using multiple devices / build targets at the time of the issue? |
|
In my case, yes, multiple devices (iPhone + iPad). The latest version of the SDK has cleared it up for me. Thanks! |
|
@markmcminn can you help me? I have same problem that you describe before: "And a bit more information... If I use the client.filesRoutes downloadData method instead of client.filesRoutes downloadUrl, I don't get the 513 error. Everything seems to work fine in terms of progress monitoring and the metadata download, but the NSData object is nil at the end of the download." I just use last DropBox SDS, downloaded in April 11, 2017. Where is the problem? Sometimes download go well, but 90% of times give me error that you describe... Thanks |
|
@alebaldi I'm sorry to hear about the problem. The latest SDK cleared it up for me so I'm not sure what might be happening in your situation. Before the latest SDK, I had to completely reset my device (iPad or iPhone) and then when I reinstalled the app it worked okay for a while. If I used the device both for development and also to run my app from the App Store, then the problem started again. You might try a full reset on your device and see if that helps. |
|
@markmcminn what is versione of SDK that resolve your problem? Whit this version you must set trasnportConfig or not? |
|
It was version 3.0.4 released on March 9 that worked for me. Yes, mine was my personal phone also. It was a pain. No, the DBTransportClient was no longer necessary with the March 9 release. |
|
I downloaded SDK in first day of April... so my version I think is correct... :-(... but I have this problem... I don't know what to do... |
|
Yes, it is probably the current version. And you're not using the DBTransportClient code, right? I had to take that code out with the latest version. If all this is correct, I have no idea what is going on. You may need to file a bug report. |
|
I have same problem with or without DBTransportClient... nothing it's changed... Only one thing to note: first day of my test it's all ok... for all day... but starting from second day I had this problem... What's changed?! In my code... nothings... |
|
@alebaldi: Could you update to the latest version of the SDK, and the let me know if your problem is still there? |
|
@alebaldi: I think I might have determined with the issue is. Please try updating to the latest version of the SDK, v3.0.18, and see if that fixes your issue. |
|
@scobbe with last version, 3.0.18, it's all ok. I have three App, and all Apps now it's all ok. Thank you very much! ;-) |
|
@alebaldi: That's great to hear! Let us know if anything else comes up, or if you have feedback for the SDK. Good luck! |
|
@scobbe We were getting a lot of reports of hang-ups and other strange timeouts which suddenly seem to have disappeared for those users (currently in beta). I was using v3.0.9 and just updated to 3.0.18 - looks like there are a number of improvements packed in. Thanks! |
|
@guidedways: That's great to hear! Hopefully, things should be more stable going forward. Let us know if you have any more suggestions! |
My app uses Dropbox to download files and store them temporarily on the device until they are uploaded to iCloud. I've followed the client.fileRoutes downloadURL method on api v2 exactly as described in the tutorial and it works great on either my iPhone or iPad. But once it's running on one device, I get a 513 error on the other:
NSError = "Error Domain=NSCocoaErrorDomain Code=513 CFNetworkDownload_ok6tFU.tmp\U201d couldn't be moved because you don't have permission to access..."
This is true whether I run the app directly from Xcode or I download it from the App Store and run it that way. Both devices are running from the same Dropbox account.
I've tried all sorts of things to work around this, but can't find any. It doesn't seem to be a write permissions issue on the device (I've tested for this), but rather a permission to access issue on Dropbox.
Thanks for any insight you can offer me!
The text was updated successfully, but these errors were encountered: