Debug Remote JS throws __NSPlaceholderDictionary initWithObjects:forKeys:count: Exception

#1

In this issue, I complained that I am not able to upload a picked image from an Expo app into the S3 store using AWS Amplify Storage#put.

Even more interesting, if I turn on “Debug Remote JS”, then try to upload the picked image via Storage#put, the following exception throws, in which the blob data is exactly the blobData I try to upload.

Exception '*** -[__NSPlaceholderDictionary initWithObjects:forKeys:count:]: attempt to insert nil object from objects[0]' was thrown while invoking sendRequest on target Networking with params (
        {
        data =         {
            blob =             {
                blobId = "26fc4264-9609-4b36-86d2-7b0af7027dbe";
                offset = 0;
                size = 506268;
            };
            trackingName = unknown;
        };
        headers =         {
            authorization = "AWS4-HMAC-SHA256 Credential=ASIAVSHNRZ3MPTKSIZEQ/20181129/us-west-2/s3/aws4_request, SignedHeaders=host;x-amz-content-sha256;x-amz-date;x-amz-security-token;x-amz-user-agent, Signature=0456ef4b41148271b74dd5d193a5d2b1ea0bc34595755402b9fae137a0ce42e3";
            "content-type" = "image/jpeg";
            "x-amz-content-sha256" = "UNSIGNED-PAYLOAD";
            "x-amz-date" = 20181129T054910Z;
            "x-amz-security-token" = "AgoGb3JpZ2luEJr//////////wEaCXVzLXdlc3QtMiKAAiVKqOhknKEZrZOBc+TMoQpWnxzf/824Bm7s2xtVGP4+dnmZOyrTPto+blb9JmaeBEsu+ik+EqbVSjX0J6m4AH51fGAP28i2DH9axAQAZwJEMIllq9fBboDQZlC3kJ7d8AygZqZhZfYCjHGgcMmd7MDHQ9gppgSQQyayUTWecXs9qf7cCq0oOK0dRH8L2pohRTW2u8EV180VPwTufFT5ZFZ62kNDCZiyRsYvosHEqUb1KagwoKviMywhSu9xgMkzneKD6AIZM4psL1yXtcumRlqHEW/DjZjntNCAqdBunStR/35DFiVx/VWWeJph5mqmyhbf4juIeXsfxDUhMzjtTK4qpgUIPxAAGgwzODI3NTAyODE0MzIiDBSe0LsKS3OePax0fiqDBUeOR9IvtldS53dA3gY/qNc2USpYlKJBXuCzgGYwmTESZ+EXZQ7/PGIqInNO1TetZLTEb+wz9HbL9wskPK1Sq7pMD+odQkKGDuI9nYxxXAujDqXMOrS2viGxMPf8vT30cdNGBCQ2d/75lqg2RkNd5AUdwfdKAct3/eIxjZOKlbTtuHHm/o6Uo2TqxO0Tj037EXP1Z6KIt829yOvoaeqyFBgrxJAFqiHf074CCF8vKN29tKETM5mduwOc7WCdb/SmazgXWOQZFtsRRdGXN5DUTVsvcYOWp2gR7gAkWCq68mTJ6KO+JXB+0JvLnqVaiEmTYjAcnJpDNc2TLLFzmdlMisxC8lOJGkWYjHeBF9dryikFbxZdj7KAJHxGpcvuB3avOLvfwk27LVn2LPeu282fnngggiE7zDnw0SYjZvnj8z1KuOtjhcq6LMR6uSjnXHA10+TNUgZON2cJFtrajNgjqFWo/FZ47u+fu0MdYQj91ZB3A6HYeuwrA9vV2rt0yZsEy3w5WyAHOCKhI/fLzOvFpfqZ0Ae4Qf/GYfzThP6VNQKo57Sji2cW9L+/81VEZ/4tXZd/XYbn/dq0800sKerJMJpUPxXvicBd7q7K1WIE2afFK2eGDmv81iQTLA2wIy6eTxR/YjiN3iHJoVwJ96w/lbYPYgCb68OwO6DZdhhhYnz4UITU39qowE4uv7sEb/3FVV9zLAmaNhAc8TNpMTT/slNY3U4UdmX2lvPaJDn7o6gGH17UE5mdde+M7nQA+wTU8gmOU1e1fHaie1ReMSwPmGGSeU629C4IUhWG060sxr1vcTk/860B1pyaklrs8vXnaCm1VzgYlCL7cSmxxikgYh49Njowxfv93wU=";
            "x-amz-user-agent" = "aws-amplify/1.0.18 react-native aws-amplify/1.0.18 react-native callback";
        };
        incrementalUpdates = 1;
        method = PUT;
        responseType = base64;
        timeout = 120000;
        url = "https://inventoryappmobile13756e6e67bd43598dff634406e80658.s3.us-west-2.amazonaws.com/private/us-west-2%3A0baf7761-8b5d-4f62-81d4-f5366d936911/items/example.png";
        withCredentials = 1;
    },
    1305
)
callstack: (
	0   CoreFoundation                      0x00000001116f61e6 __exceptionPreprocess + 294
	1   libobjc.A.dylib                     0x000000010fbec031 objc_exception_throw + 48
	2   CoreFoundation                      0x00000001117360bc _CFThrowFormattedException + 194
	3   CoreFoundation                      0x0000000111609951 -[__NSPlaceholderDictionary initWithObjects:forKeys:count:] + 321
	4   CoreFoundation                      0x00000001116097db +[NSDictionary dictionaryWithObjects:forKeys:count:] + 59
	5   Exponent                            0x0000000104059ad4 -[ABI31_0_0RCTBlobManager handleNetworkingRequest:] + 416
	6   Exponent                            0x00000001040c1b86 -[ABI31_0_0RCTNetworking processDataForHTTPQuery:callback:] + 318
	7   Exponent                            0x00000001040c1306 -[ABI31_0_0RCTNetworking buildRequest:completionBlock:] + 1144
	8   Exponent                            0x00000001040c487d -[ABI31_0_0RCTNetworking sendRequest:responseSender:] + 151
	9   CoreFoundation                      0x0000000111679ccc __invoking___ + 140
	10  CoreFoundation                      0x0000000111679b84 -[NSInvocation invoke] + 308
	11  CoreFoundation                      0x00000001116928d6 -[NSInvocation invokeWithTarget:] + 54
	12  Exponent                            0x00000001040b38e1 -[ABI31_0_0RCTModuleMethod invokeWithBridge:module:arguments:] + 612
	13  Exponent                            0x00000001040bae7b _ZN8facebook14ReactABI31_0_0L11invokeInnerEP18ABI31_0_0RCTBridgeP22ABI31_0_0RCTModuleDatajRKN5folly7dynamicE + 255
	14  Exponent                            0x00000001040babf9 ___ZN8facebook14ReactABI31_0_024ABI31_0_0RCTNativeModule6invokeEjON5folly7dynamicEi_block_invoke + 78
	15  libdispatch.dylib                   0x00000001125cf6cb _dispatch_call_block_and_release + 12
	16  libdispatch.dylib                   0x00000001125d0709 _dispatch_client_callout + 8
	17  libdispatch.dylib                   0x00000001125d8142 _dispatch_queue_serial_drain + 735
	18  libdispatch.dylib                   0x00000001125d893f _dispatch_queue_invoke + 321
	19  libdispatch.dylib                   0x00000001125d50fa _dispatch_queue_override_invoke + 477
	20  libdispatch.dylib                   0x00000001125dac88 _dispatch_root_queue_drain + 473
	21  libdispatch.dylib                   0x00000001125daa51 _dispatch_worker_thread3 + 119
	22  libsystem_pthread.dylib             0x0000000112ae5169 _pthread_wqthread + 1387
	23  libsystem_pthread.dylib             0x0000000112ae4be9 start_wqthread + 13
)

ABI31_0_0RCTFatal
facebook::ReactABI31_0_0::invokeInner(ABI31_0_0RCTBridge*, ABI31_0_0RCTModuleData*, unsigned int, folly::dynamic const&)
invocation function for block in facebook::ReactABI31_0_0::ABI31_0_0RCTNativeModule::invoke(unsigned int, folly::dynamic&&, int)
_dispatch_call_block_and_release
_dispatch_client_callout
_dispatch_queue_serial_drain
_dispatch_queue_invoke
_dispatch_queue_override_invoke
_dispatch_root_queue_drain
_dispatch_worker_thread3
_pthread_wqthread
start_wqthread

The exception will not be thrown if I am not turning on “Debug Remote JS”. The issue happens in both IOS simulator and my own IOS device.

closed #2

This topic was automatically closed 15 days after the last reply. New replies are no longer allowed.