Illegal State Exception because Client Modified meta data field is null since version 3.11.0
michaelkircher opened this issue · 6 comments
Since version 3.11.0, including version 3.11.1, the DBStoneValidators::raiseIllegalStateErrorWithMessage throws an exception because the clientModified data field in the meta data is null when reading from a Dropbox account. Going back to 3.10.0 solves the issue.
Can you clarify what versions of the Dropbox Java SDK you're referring to? The version numbers you mentioned aren't actually releases of the Dropbox Java SDK. The latest is currently v3.1.3.
Also, can you share the code and steps to reproduce the issue, and the full error output you get? Thanks in advance!
It is the Dropbox Objective-C SDK, sorry for the confusion.
The invocation of the Dropbox API inside my iOS Objective-C App looks like:
[[restClient.filesRoutes listFolder:_dropboxFolderPath]
setResponseBlock:^(DBFILESListFolderResult *result, DBFILESListFolderError *routeError, DBRequestError *error) {
if (result && !self.cancelled) {
NSArray<NSMutableArray *> *entities = [self collectJBElements:result.entries];
if (completionHandler) completionHandler(entities, nil);
} else if (error) {
completionHandler(nil, [NSError dropboxErrorWithMessage:NSLocalizedString(@"Failed to read from Dropbox",
@"Failed to read from Dropbox")
error:error listFolderError:routeError folderPath:_dropboxFolderPath]);
} else {
// may report user cancel via special errorkind like domain=="UserCanceled"
completionHandler(nil, nil);
}
}];
The stack trace is:
#0 0x000000010ba00c7c in +[DBStoneValidators raiseIllegalStateErrorWithMessage:] at .../Shared/Generated/Resources/DBStoneValidators.m:133
#1 0x000000010ba00af6 in __38+[DBStoneValidators nonnullValidator:]block_invoke at .../Shared/Generated/Resources/DBStoneValidators.m:119
#2 0x000000010b858fb5 in -[DBFILESFileMetadata initWithName:id:clientModified:serverModified:rev:size:pathLower:pathDisplay:parentSharedFolderId:mediaInfo:symlinkInfo:sharingInfo:isDownloadable:exportInfo:propertyGroups:hasExplicitSharedMembers:contentHash:fileLockInfo:] at .../Shared/Generated/ApiObjects/Files/DBFilesObjects.m:7212
#3 0x000000010b85d3e5 in +[DBFILESFileMetadataSerializer deserialize:] at .../Shared/Generated/ApiObjects/Files/DBFilesObjects.m:7534
#4 0x000000010b84aaa6 in +[DBFILESMetadataSerializer deserialize:] at .../Shared/Generated/ApiObjects/Files/DBFilesObjects.m:4732
#5 0x000000010b87608b in __49+[DBFILESListFolderResultSerializer deserialize:]_block_invoke at .../Shared/Generated/ApiObjects/Files/DBFilesObjects.m:11561
#6 0x000000010b9fe919 in +[DBArraySerializer deserialize:withBlock:] at .../Shared/Generated/Resources/DBStoneSerializers.m:181
#7 0x000000010b875f60 in +[DBFILESListFolderResultSerializer deserialize:] at .../Shared/Generated/ApiObjects/Files/DBFilesObjects.m:11559
#8 0x000000010b875646 in +[DBFILESListFolderResult deserialize:] at .../Shared/Generated/ApiObjects/Files/DBFilesObjects.m:11481
#9 0x000000010be5699d in +[DBTransportBaseClient routeResultWithRoute:data:serializationError:] at .../Shared/Handwritten/Networking/DBTransportBaseClient.m:334
#10 0x000000010ba01d9d in __56-[DBRpcTask storageBlockWithResponseBlock:cleanupBlock:]_block_invoke at .../Shared/Handwritten/Networking/DBTasks.m:142
#11 0x000000010b7e52fc in __51-[DBDelegate URLSession:task:didCompleteWithError:]_block_invoke.59 at .../Shared/Handwritten/Networking/DBDelegate.m:90
#12 0x00007fff25914e4c in NSBLOCKOPERATION_IS_CALLING_OUT_TO_A_BLOCK ()
#13 0x00007fff25914d6d in -[NSBlockOperation main] ()
#14 0x00007fff25917c9c in NSOPERATION_IS_INVOKING_MAIN ()
#15 0x00007fff25913fae in -[NSOperation start] ()
#16 0x00007fff259185e0 in NSOPERATIONQUEUE_IS_STARTING_AN_OPERATION ()
#17 0x00007fff25918100 in __NSOQSchedule_f ()
#18 0x000000010db884dc in _dispatch_block_async_invoke2 ()
#19 0x000000010db79e8e in _dispatch_client_callout ()
#20 0x000000010db87d97 in _dispatch_main_queue_callback_4CF ()
#21 0x00007fff23da1849 in CFRUNLOOP_IS_SERVICING_THE_MAIN_DISPATCH_QUEUE ()
#22 0x00007fff23d9c399 in __CFRunLoopRun ()
#23 0x00007fff23d9b884 in CFRunLoopRunSpecific ()
#24 0x00007fff38b5ac1a in GSEventRunModal ()
#25 0x00007fff48c19220 in UIApplicationMain ()
#26 0x000000010b6dd8e9 in main at /Users/micha/Development/Jagdbegleiter/main.m:15
#27 0x00007fff519b910d in start ()
#28 0x00007fff519b910d in start ()
Enqueued from (Thread 8) Queue : (serial)
#0 0x000000010db7dd46 in dispatch_async ()
#1 0x00007fff25912163 in __NSOQSchedule ()
#2 0x00007fff25915f29 in __addOperations ()
#3 0x000000010b7e4b46 in -[DBDelegate URLSession:task:didCompleteWithError:] at .../Shared/Handwritten/Networking/DBDelegate.m:89
#4 0x00007fff230f3297 in ___lldb_unnamed_symbol8603$$CFNetwork ()
#5 0x00007fff25914e4c in NSBLOCKOPERATION_IS_CALLING_OUT_TO_A_BLOCK ()
#6 0x00007fff25914d6d in -[NSBlockOperation main] ()
#7 0x00007fff25917c9c in NSOPERATION_IS_INVOKING_MAIN ()
#8 0x00007fff25913fae in -[NSOperation start] ()
#9 0x00007fff259185e0 in NSOPERATIONQUEUE_IS_STARTING_AN_OPERATION ()
#10 0x00007fff25918100 in __NSOQSchedule_f ()
#11 0x000000010db884dc in _dispatch_block_async_invoke2 ()
#12 0x000000010db79e8e in _dispatch_client_callout ()
#13 0x000000010db7c7a3 in _dispatch_continuation_pop ()
#14 0x000000010db7bbbb in _dispatch_async_redirect_invoke ()
#15 0x000000010db8b399 in _dispatch_root_queue_drain ()
#16 0x000000010db8bca6 in _dispatch_worker_thread2 ()
#17 0x00007fff51b9e9f7 in _pthread_wqthread ()
#18 0x00007fff51b9db77 in start_wqthread ()
In line #2 the "clientModified" field is checked:
[DBStoneValidators nonnullValidator:nil](clientModified);
The same code works fine with 3.10.0 Objective-C SDK and the same Dropbox account and folder. Basically all my users had the same issue with my app having integrated the 3.11.0 Objective-C SDK. So it is not depend on account or data.
My apologies! I thought this was filed under the Java SDK for some reason. Thanks for the report! We'll look into it.
@michaelkircher I'll be looking into this issue today. Will let you know what I find
@michaelkircher We can't seem to reproduce the issue on our end. Could you do us a favor? Could you throw a breakpoint here and give me the output of printing out the headers
variable?
Send me an email at with the output if you're comfortable with it! It would really help us a lot. If you could also send me your app key in that email as well, we can have our backend devs look into your errors as well to narrow down this issue.
DON'T FORGET TO SCRUB YOUR AUTH KEY FROM THE HEADERS. Your safety and security is important to us so please make sure not to send your auth key.
Alternately, send me an example project that shows this issue? I can't reproduce for the life of me at the moment and it's possible that this may be a server side issue. I don't want to rule out the possibility of an API change on the SDK side though.
On top of all of that, I release 3.11.2 but we're not terribly sure if this fixes the issue for you. Could you also test this code of yours on 3.11.2 on top of sending me the headers value I mentioned above? That would be extremely helpful!
As I mentioned in the separate email to you, 3.11.2 fixed the issue for me.