Skip to content
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

Error 513 when downloading a file. #258

Closed
AaronMcGranaghan opened this issue Apr 20, 2020 · 4 comments
Closed

Error 513 when downloading a file. #258

AaronMcGranaghan opened this issue Apr 20, 2020 · 4 comments

Comments

@AaronMcGranaghan
Copy link

Hello, hoping someone can help with an issue I've recently come across. I can't be sure when it started happening, but when I try to download a file I get error 513:

DropboxClientError[{
    NSError = "Error Domain=NSCocoaErrorDomain Code=513 \"\U201cCFNetworkDownload_KWoAqe.tmp\U201d couldn\U2019t be moved because you don\U2019t have permission to access \U201ctmp\U201d.\" UserInfo={NSSourceFilePathErrorKey=/var/mobile/Library/Caches/com.apple.nsurlsessiond/Downloads/BUNLE_ID/CFNetworkDownload_KWoAqe.tmp, NSUserStringVariant=(\n    Move\n), NSDestinationFilePath=/private/var/mobile/Containers/Data/Application/220F0D18-CF5B-4FEE-8248-B0BEF2F6517E/tmp/7B749750-D583-4D3C-AEED-FD1916439C82, NSFilePath=/var/mobile/Library/Caches/com.apple.nsurlsessiond/Downloads/BUNDLE_ID/CFNetworkDownload_KWoAqe.tmp, NSUnderlyingError=0x280384240 {Error Domain=NSPOSIXErrorDomain Code=1 \"Operation not permitted\"}}";

The code I'm using has worked fine for a long time and hasn't been changed:

NSString *tmpDir = NSTemporaryDirectory();
NSURL *destURL = [NSURL fileURLWithPath:[tmpDir stringByAppendingPathComponent:[dropboxPath lastPathComponent]]];
[[[[DBClientsManager  authorizedClient].filesRoutes downloadUrl:dropboxPath overwrite:YES destination:destURL] setResponseBlock:^(DBFILESFileMetadata *result, DBFILESDownloadError *routeError, DBRequestError *networkError, NSURL *destination) { ...

The odd thing is, this error only occurs on some of my devices, not all of them.

I'm using iOS (13.31) and ObjectiveDropboxOfficial (3.11.2).

@JBishopJr
Copy link

JBishopJr commented Apr 20, 2020 via email

@greg-db
Copy link
Contributor

greg-db commented Apr 20, 2020

A 513 Cocoa error is NSFileWriteNoPermissionError, indicating a local filesystem permission issue. There have been a few similar issues like this in the past with more information and potential solutions that may be helpful:

Also, as John pointed out, 'BUNLE_ID' doesn't seem to be correct. Is that actually in the path in the output, or is that a typo from redacting your bundle ID for this post?

@AaronMcGranaghan
Copy link
Author

Yes, that was a typo in my redaction. All paths are valid and correct. I'll check out some of the other issues and see if any of those solutions help.

Thanks.

@AaronMcGranaghan
Copy link
Author

Using forceForegroundSession seems to have fixed the problem. Thanks for the pointers.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants