AnsweredAssumed Answered

Error generating geodatabase, cryptic response

Question asked by jamesrichards on May 5, 2014
Latest reply on May 6, 2014 by jamesrichards

I modified (simplified) the OfflineEditingSample to try and generate a geodatabase from one of our Feature Services. I'm just trying to generate the geodatabase file and download it. Once I have that working I can move on to more fun stuff. Here is the code (lifted from the sample):

    AGSGDBGenerateParameters *params = [[AGSGDBGenerateParameters alloc] initWithFeatureServiceInfo:self.gdbTask.featureServiceInfo];     params.extent = self.mapView.visibleAreaEnvelope;     params.outSpatialReference = self.mapView.spatialReference;     NSArray* layers = @[@(1)]; // Just getting one layer for testing     params.layerIDs = layers;          [SVProgressHUD showWithStatus:@"Preparing to download"];     [self.gdbTask generateGeodatabaseWithParameters:params downloadFolderPath:nil useExisting:YES status:^(AGSResumableTaskJobStatus status, NSDictionary *userInfo) {                  //If we are fetching result, display download progress         if (status == AGSResumableTaskJobStatusFetchingResult) {             NSNumber* totalBytesDownloaded = userInfo[@"AGSDownloadProgressTotalBytesDownloaded"];             NSNumber* totalBytesExpected = userInfo[@"AGSDownloadProgressTotalBytesExpected"];             if(totalBytesDownloaded != nil && totalBytesExpected != nil){                 double dPercentage = (double)([totalBytesDownloaded doubleValue]/[totalBytesExpected doubleValue]);                 [SVProgressHUD showProgress:dPercentage status:@"Downloading features"];             }         } else {             //don't want to log status for "fetching result" state because             //status block gets called many times a second when downloading.             //we only log status for other states here             NSLog(@"Status: %@", AGSResumableTaskJobStatusAsString(status));         }     } completion:^(AGSGDBGeodatabase *geodatabase, NSError *error) {         if (error) {             NSLog(@"error generating geodatabase: %@", error);             [SVProgressHUD showErrorWithStatus:@"Error downloading features"];         } else {             NSLog(@"downloaded geodatabase: %@", geodatabase.path);             [SVProgressHUD showSuccessWithStatus:@"Finished downloading"];         }     }];

Several status events are logged and eventually the completion block fires with an error. The NSLog output to the console looks like this:

Status: Waiting for default parameters Status: Pre-processing job Status: Starting job Status: Polling Status: Polling Status: Polling Status: Polling Status: Polling Status: Done error generating geodatabase: Error Domain=NSCocoaErrorDomain Code=400 "The operation couldn???t be completed. " UserInfo=0x14f4f860 {NSURL=http://xxxxxxxx:6080/arcgis/rest/services/ElectricDistribution/FeatureServer/jobs/j51fbc2858ae648d89478daa6bd27b32b?f=json, responseJSON={     error =     {         code = 400;         description = "";     };     lastUpdatedTime = 1399335065000;     replicaName = "Ags_Fs";     resultUrl = "";     status = Failed;     submissionTime = 1399335050000; }, NSLocalizedFailureReason=}

Note: I replaced the location of the server in the error message with xxxxxxxx. It is hidden behind a firewall and access is occurring over a VPN.

Can anyone shed some light on the error message. It's not telling me much.

Also note: here are the Sync Capabilities on the Feature Service:

Sync Capabilities: Supports Registering Existing Data: true Supports Sync Direction Control: true Supports PerLayer Sync: false Supports PerReplica Sync: true Supports RollbackOnFailure : false Supports Async: true

Thanks in advance,