Forum Discussion

Mark R.5's avatar
Mark R.5
Helpful | Level 5
8 years ago

Obj-C V2 disk error after uploadUrl

If I try to backup up my database file using the uploadUrl method, when I next try to access the database using Core Data I get the following error:

 

CoreData: error: -executeRequest: encountered exception = I/O error for database at /var/mobile/Containers/Data/Application/2B4358FA-A339-49B0-8F7E-6D04CE21C7F7/Documents/SpendingTracker.sqlite.  SQLite error code:6922, 'disk I/O error' with userInfo = {
    NSFilePath = "/var/mobile/Containers/Data/Application/2B4358FA-A339-49B0-8F7E-6D04CE21C7F7/Documents/SpendingTracker.sqlite";
    NSSQLiteErrorDomain = 6922;
}

The Dropbox Sync SDK used to have a 'shouldSteal' option when loading. According to the documentation this would cause the file to be copied before uploading. I did this myself by making a temp copy, uploading that and then deleting it afterwards. The problem then went away, but it would be good if the framework handled it for you, or the issue was documented. 

  • Greg-DB's avatar
    Greg-DB
    Icon for Dropbox Staff rankDropbox Staff
    Thanks for the post! I'm glad to hear you were able to work around this issue, though I'm not sure I understand exactly what the issue was. When using uploadUrl, the SDK should upload the data from whatever URL you supply, but as far as I'm aware it shouldn't then affect the local file, e.g., in a way to cause an error like this.

    Is that the entirety of the output you got when you ran in to that issue?
    • Mark R.5's avatar
      Mark R.5
      Helpful | Level 5

      I will give you as much info as I can. First off I upload the file using a method like this:

       

      [client uploadUrl:@"/File.sqlite" mode:[[[DBFILESWriteMode alloc] initWithOverwrite] autorelease] autorename:@NO clientModified:nil mute:@YES inputUrl:inputUrl];

      Then, when I next do a 

      [NSFetchedResultsController performFetch:]

      against the database, I get the following error:

      2017-03-31 15:53:59.022073 App[12260:3128970] [error] error: (6922) I/O error for database at /var/mobile/Containers/Data/Application/172114D0-4346-48F1-ACAE-23A76EC9C339/Documents/File.sqlite.  SQLite error code:6922, 'disk I/O error'
      CoreData: error: (6922) I/O error for database at /var/mobile/Containers/Data/Application/172114D0-4346-48F1-ACAE-23A76EC9C339/Documents/App.sqlite.  SQLite error code:6922, 'disk I/O error'
      2017-03-31 15:56:29.270469 App[12260:3128970] [error] error: -executeRequest: encountered exception = I/O error for database at /var/mobile/Containers/Data/Application/172114D0-4346-48F1-ACAE-23A76EC9C339/Documents/File.sqlite.  SQLite error code:6922, 'disk I/O error' with userInfo = {
          NSFilePath = "/var/mobile/Containers/Data/Application/172114D0-4346-48F1-ACAE-23A76EC9C339/Documents/File.sqlite";
          NSSQLiteErrorDomain = 6922;
      }
      CoreData: error: -executeRequest: encountered exception = I/O error for database at /var/mobile/Containers/Data/Application/172114D0-4346-48F1-ACAE-23A76EC9C339/Documents/File.sqlite.  SQLite error code:6922, 'disk I/O error' with userInfo = {
          NSFilePath = "/var/mobile/Containers/Data/Application/172114D0-4346-48F1-ACAE-23A76EC9C339/Documents/File.sqlite";
          NSSQLiteErrorDomain = 6922;
      }
      
      • Greg-DB's avatar
        Greg-DB
        Icon for Dropbox Staff rankDropbox Staff
        Thanks for the additional information! We'll take a look to see if we can figure out what's going on here.

About Dropbox API Support & Feedback

Node avatar for Dropbox API Support & Feedback
Find help with the Dropbox API from other developers.5,941 PostsLatest Activity: 19 hours ago
351 Following

If you need more help you can view your support options (expected response time for an email or ticket is 24 hours), or contact us on X or Facebook.

For more info on available support options for your Dropbox plan, see this article.

If you found the answer to your question in this Community thread, please 'like' the post to say thanks and to let us know it was useful!