Firestore call setData will not enter completion block after signOut and signIn firebase auth on iOS - firebase

In iOS (swift) with Firebase SDK
Using Firebase (4.10.0)
Using FirebaseAuth (4.4.4)
Using FirebaseCore (4.0.16)
Using FirebaseFirestore (0.10.2)
Problem happen when
signIn (anonymous or with credential)
signOut
signIn
call FIRDocumentReference.setData then completion block of setData will never called
Problem will not happen if
signOut
terminate app
signIn
call FIRDocumentReference.setData everything work fine
import UIKit
import Firebase
class ViewController: UIViewController {
let mEmail = "tester#xxxxx.com"
let mPassword = "xxxxx"
override func viewDidLoad() {
super.viewDidLoad()
}
#IBAction func clickSignIn(_ sender: Any) {
print("clickSignIn")
Auth.auth().signIn(withEmail: mEmail, password: mPassword) { (user, error) in
print("user:", user ?? "no user")
print("error:", error ?? "no error")
}
}
#IBAction func clickSignOut(_ sender: Any) {
print("clickSignOut")
do {
try Auth.auth().signOut()
} catch {
print("can't signOut")
}
print(Auth.auth().currentUser ?? "no user")
}
#IBAction func clickSetData(_ sender: Any) {
print("clickSetData")
let ref = Firestore.firestore().document("tests/test_1")
let data = ["text": "xxxxx"]
ref.setData(data, options: SetOptions.merge()) { (e) in
if (e == nil) {
print("setData complete")
} else {
print("setData error:", e ?? "no error")
}
}
}
}
And sometime it cause this crash too
*** Assertion failure in -[FSTLevelDBMutationQueue removeMutationBatches:group:], third_party/firebase/ios/Source/Firestore/Source/Local/FSTLevelDBMutationQueue.mm:536
2018-03-08 03:56:22.364597+0700 setdata-bug[30957:9502011] *** Terminating app due to uncaught exception 'NSInternalInconsistencyException', reason: 'FIRESTORE INTERNAL ASSERTION FAILED: Mutation batch [mutation: userID=\^X8I\^G\^A batchID=5] not found; found [mutation: userID=P¸P››\^? batchID=0]'
*** First throw call stack:
(
0 CoreFoundation 0x000000010a05c12b __exceptionPreprocess + 171
1 libobjc.A.dylib 0x00000001096f0f41 objc_exception_throw + 48
2 CoreFoundation 0x000000010a0612f2 +[NSException raise:format:arguments:] + 98
3 Foundation 0x0000000109191d69 -[NSAssertionHandler handleFailureInMethod:object:file:lineNumber:description:] + 193
4 setdata-bug 0x0000000107333229 -[FSTLevelDBMutationQueue removeMutationBatches:group:] + 1967
5 setdata-bug 0x000000010733fc8e -[FSTLocalStore removeMutationBatches:group:] + 885
6 setdata-bug 0x000000010733f753 -[FSTLocalStore releaseBatchResults:group:remoteDocuments:] + 537
7 setdata-bug 0x000000010733c4f7 -[FSTLocalStore acknowledgeBatchWithResult:] + 571
8 setdata-bug 0x0000000107321e36 -[FSTSyncEngine applySuccessfulWriteWithResult:] + 166
9 setdata-bug 0x0000000107363325 -[FSTRemoteStore writeStreamDidReceiveResponseWithVersion:mutationResults:] + 300
10 setdata-bug 0x0000000107373069 -[FSTWriteStream handleStreamMessage:] + 847
11 setdata-bug 0x00000001073712da -[FSTStream writeValue:] + 477
12 setdata-bug 0x000000010736ee73 -[FSTCallbackFilter writeValue:] + 84
13 RxLibrary 0x00000001086065d6 __57-[GRXConcurrentWriteable enqueueValue:completionHandler:]_block_invoke + 86
14 libdispatch.dylib 0x000000010b0cd2f7 _dispatch_call_block_and_release + 12
15 libdispatch.dylib 0x000000010b0ce33d _dispatch_client_callout + 8
16 libdispatch.dylib 0x000000010b0d6855 _dispatch_queue_serial_drain + 1162
17 libdispatch.dylib 0x000000010b0d71ea _dispatch_queue_invoke + 336
18 libdispatch.dylib 0x000000010b0d2f7c _dispatch_queue_override_invoke + 733
19 libdispatch.dylib 0x000000010b0da102 _dispatch_root_queue_drain + 772
20 libdispatch.dylib 0x000000010b0d9da0 _dispatch_worker_thread3 + 132
21 libsystem_pthread.dylib 0x000000010d8051ca _pthread_wqthread + 1387
22 libsystem_pthread.dylib 0x000000010d804c4d start_wqthread + 13
)
libc++abi.dylib: terminating with uncaught exception of type NSException

It was confirmed by google engineers that the issue I've identified is a known bug on the latest iOS SDK version (4.10.0). The good news is that, it was already fixed in the following pull requests: 890, 893. Until the fixes has been publicly released, Google suggest us to temporarily downgrade to version 4.9.0 for now. Any specifics or timeline can't be shared at the moment so please keep an eye out on our release notes for any updates.

Related

gRPC not receiving responses due to queue_timeout?

I have a simple gRPC client/server application. The server starts and the client pings(verified by server-side code); however I don't receive responses.
I narrowed it down to this line on the server-side. I am not sure what could cause a queue_timeout. I am following this
.proto:
1 syntax = "proto3";
2
3 service Pinger {
4 rpc Ping (PingMessage) returns (PongMessage) {}
5 }
6
7 message PingMessage{
8 string message = 1;
9 }
10
11 message PongMessage {
12 string message = 1;
13 }
server.py:
class Pinger(PingerServicer):
def Ping(self, request, context):
return grpc_service_pb2.PongMessage(message = "pong")
grpc_server_app = Pinger()
client.py:
class GRPCClient:
def __init__(self):
self.host = "localhost"
self.port = GRPC_PORT
#timeit('grpc')
def send(self, channel):
stub = grpc_service_pb2_grpc.PingerStub(channel)
ping_message = grpc_service_pb2.PingMessage(message = 'ping')
response = stub.Ping(ping_message)
def run(self):
with grpc.insecure_channel(f"{self.host}:{self.port}") as channel:
while True:
self.send(channel)
main.py
17 def grpc_server_wrapper():
18 server = grpc.server(ThreadPoolExecutor(max_workers=2))
19 grpc_service_pb2_grpc.add_PingerServicer_to_server(grpc_server_app, server)
20 server.add_insecure_port('[::]:' + str(GRPC_PORT))
21 server.start()
22 print("Server started, listening on " + str(GRPC_PORT))
23 server.wait_for_termination()
24
25 if __name__ == '__main__':
26 futures = []
27 with ProcessPoolExecutor(max_workers = 2) as executor:
46 futures.append(
47 executor.submit(grpc_client_app.run)
48 )
49
50 futures.append(
51 executor.submit(grpc_server_wrapper)
52 )
56 [f.result() for f in futures]
The problem was that the server was not ready when the client was trying to ping and thus it would err out and die. The error was swallowed by the process pool.
The solution is to add wait_for_ready = True to the client call:
response = stub.Ping(ping_message, wait_for_ready = True)

Geting error Caused by: com.databricks.NotebookExecutionException: FAILED

I am trying to run the below notebook through databricks but getting the below error. I have tried to update the notebook timeout and the retry mechanism but still no luck yet.
NotebookData("/Users/mynotebook",9900, retry=3)
]
res = parallelNotebooks(notebooks, 2)
result = [f.result(timeout=9900) for f in res] # This is a blocking call.
print(result)
Can someone please help me to sort out this issue? Thanks
%python
from concurrent.futures import ThreadPoolExecutor
class NotebookData:
def __init__(self, path, timeout, parameters=None, retry=0):
self.path = path
self.timeout = timeout
self.parameters = parameters
self.retry = retry
def submitNotebook(notebook):
print("Running notebook %s" % notebook.path)
try:
if (notebook.parameters):
return dbutils.notebook.run(notebook.path, notebook.timeout, notebook.parameters)
else:
return dbutils.notebook.run(notebook.path, notebook.timeout)
except Exception:
if notebook.retry < 1:
raise
print("Retrying notebook %s" % notebook.path)
notebook.retry = notebook.retry - 1
submitNotebook(notebook)
def parallelNotebooks(notebooks, numInParallel):
# This code limits the number of parallel notebooks.
with ThreadPoolExecutor(max_workers=numInParallel) as ec:
return [ec.submit(submitNotebook, notebook) for notebook in notebooks]
notebooks = [
NotebookData("/Users/mynotebook",1200000, retry=0)
]
res = parallelNotebooks(notebooks, 2)
result = [f.result(timeout=1200000) for f in res] # This is a blocking call.
print(result)
Error:
Py4JJavaError Traceback (most recent call last)
<command-1143841910698378> in <module>
32 ]
33 res = parallelNotebooks(notebooks, 2)
---> 34 result = [f.result(timeout=1200000) for f in res] # This is a blocking call.
35 print(result)
<command-1143841910698378> in <listcomp>(.0)
32 ]
33 res = parallelNotebooks(notebooks, 2)
---> 34 result = [f.result(timeout=1200000) for f in res] # This is a blocking call.
35 print(result)
/usr/lib/python3.7/concurrent/futures/_base.py in result(self, timeout)
426 raise CancelledError()
427 elif self._state == FINISHED:
--> 428 return self.__get_result()
429
430 self._condition.wait(timeout)
/usr/lib/python3.7/concurrent/futures/_base.py in __get_result(self)
382 def __get_result(self):
383 if self._exception:
--> 384 raise self._exception
385 else:
386 return self._result
/usr/lib/python3.7/concurrent/futures/thread.py in run(self)
55
56 try:
---> 57 result = self.fn(*self.args, **self.kwargs)
58 except BaseException as exc:
59 self.future.set_exception(exc)
<command-1143841910698378> in submitNotebook(notebook)
12 return dbutils.notebook.run(notebook.path, notebook.timeout, notebook.parameters)
13 else:
---> 14 return dbutils.notebook.run(notebook.path, notebook.timeout)
15 except Exception:
16 if notebook.retry < 1:
/local_disk0/tmp/1664351986642-0/dbutils.py in run(self, path, timeout_seconds, arguments, _NotebookHandler__databricks_internal_cluster_spec)
136 arguments,
137 __databricks_internal_cluster_spec,
--> 138 self.shell.currentJobGroup)
139
140 def __repr__(self):
/databricks/spark/python/lib/py4j-0.10.9-src.zip/py4j/java_gateway.py in __call__(self, *args)
1303 answer = self.gateway_client.send_command(command)
1304 return_value = get_return_value(
-> 1305 answer, self.gateway_client, self.target_id, self.name)
1306
1307 for temp_arg in temp_args:
/databricks/spark/python/pyspark/sql/utils.py in deco(*a, **kw)
125 def deco(*a, **kw):
126 try:
--> 127 return f(*a, **kw)
128 except py4j.protocol.Py4JJavaError as e:
129 converted = convert_exception(e.java_exception)
/databricks/spark/python/lib/py4j-0.10.9-src.zip/py4j/protocol.py in get_return_value(answer, gateway_client, target_id, name)
326 raise Py4JJavaError(
327 "An error occurred while calling {0}{1}{2}.\n".
--> 328 format(target_id, ".", name), value)
329 else:
330 raise Py4JError(
Py4JJavaError: An error occurred while calling o1741._run.
: com.databricks.WorkflowException: com.databricks.NotebookExecutionException: FAILED
at com.databricks.workflow.WorkflowDriver.run(WorkflowDriver.scala:95)
at com.databricks.dbutils_v1.impl.NotebookUtilsImpl.run(NotebookUtilsImpl.scala:122)
at com.databricks.dbutils_v1.impl.NotebookUtilsImpl._run(NotebookUtilsImpl.scala:89)
at sun.reflect.GeneratedMethodAccessor820.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:498)
at py4j.reflection.MethodInvoker.invoke(MethodInvoker.java:244)
at py4j.reflection.ReflectionEngine.invoke(ReflectionEngine.java:380)
at py4j.Gateway.invoke(Gateway.java:295)
at py4j.commands.AbstractCommand.invokeMethod(AbstractCommand.java:132)
at py4j.commands.CallCommand.execute(CallCommand.java:79)
at py4j.GatewayConnection.run(GatewayConnection.java:251)
at java.lang.Thread.run(Thread.java:748)
Caused by: com.databricks.NotebookExecutionException: FAILED
at com.databricks.workflow.WorkflowDriver.run0(WorkflowDriver.scala:141)
at com.databricks.workflow.WorkflowDriver.run(WorkflowDriver.scala:90)
... 12 more

Xamarin.Forms - iOS app crash after start

I have xamarin forms application. On Android is everything OK. On iOS is possible to run app only if I use visual studio to deploy application to iPhone or when I use simulator. When I use TestFlight service then app crash on startup. Apple automation test fails too.
Part of crah log is here and full crash log is under this:
Exception Type: EXC_CRASH (SIGABRT)
Exception Codes: 0x0000000000000000, 0x0000000000000000
Exception Note: EXC_CORPSE_NOTIFY
Triggered by Thread: 0
Thread 0 name:
Thread 0 Crashed:
0 libsystem_kernel.dylib 0x000000019aec6d88 __pthread_kill + 8
1 libsystem_pthread.dylib 0x000000019addf1e8 pthread_kill$VARIANT$mp + 136 (pthread.c:1458)
2 libsystem_c.dylib 0x000000019ad329b0 __abort + 112 (abort.c:147)
3 libsystem_c.dylib 0x000000019ad32940 abort + 112 (abort.c:118)
4 Zaruky.iOS 0x0000000101d9ee64 xamarin_printf + 25177700 (runtime.m:2472)
5 Zaruky.iOS 0x0000000101c6475c mono_invoke_unhandled_exception_hook + 23889756 (exception.c:1299)
6 Zaruky.iOS 0x0000000101bf95bc mono_handle_exception_internal + 23451068 (mini-exceptions.c:2783)
7 Zaruky.iOS 0x0000000101bf9fb0 mono_resume_unwind + 23453616 (mini-exceptions.c:3532)
8 Zaruky.iOS 0x0000000101bededc mono_arm_resume_unwind + 23404252 (exceptions-arm64.c:421)
9 Zaruky.iOS 0x00000001006f5b38 llvm_resume_unwind_trampoline + 168
10 Zaruky.iOS 0x00000001015762ec Xamarin_iOS_UIKit_UIApplication_Main_string___intptr_intptr + 16622316 (UIApplication.cs:0)
11 Zaruky.iOS 0x0000000101c0b1bc mono_jit_runtime_invoke + 23523772 (mini-runtime.c:3165)
12 Zaruky.iOS 0x0000000101cc6870 mono_runtime_invoke_checked + 24291440 (object.c:3220)
13 Zaruky.iOS 0x0000000101cccac8 mono_runtime_exec_main_checked + 24316616 (object.c:5284)
14 Zaruky.iOS 0x0000000101be9774 mono_jit_exec + 23385972 (driver.c:1328)
15 Zaruky.iOS 0x0000000101da6900 xamarin_main + 25209088 (monotouch-main.m:0)
16 Zaruky.iOS 0x0000000100607e4c main + 441932 (main.m:166)
17 libdyld.dylib 0x000000019aed18f0 start + 4
I found some errors with Device log in visual studio:
Visual studio - device log
Full apple crash log
I had to create new project and move all code to this new project. Now is everything OK. But I don't know where the mistake was.

SiriKit crashes: "Use of the class from an app requires the entitlement com.apple.developer.siri."

We have been receiving crash reports say that "Use of the class INPreferences from an app requires the entitlement com.apple.developer.siri. Did you enable the Siri capability in your Xcode project?". But We have absolutely enabled the Siri capability in Xcode, and the APP ID does support the Siri feature, otherwise our app would have crashed all the time. So, why just some devices crashed? This bothers us a lot.
Anyone knows the reason or has encoutered the same problem? We'd appreciate if you can offer some help.
Here is the crash log:
0 CoreFoundation 0x000000018b6fd1b8 ___exceptionPreprocess + 124
1 libobjc.A.dylib 0x000000018a13455c objc_exception_throw + 44
2 Intents 0x00000001a4cd55ac -[INPreferences _siriAuthorizationStatus]
3 libdispatch.dylib 0x000000018a5861bc __dispatch_client_callout + 16
4 libdispatch.dylib 0x000000018a586fb0 dispatch_once_f + 56
5 Intents 0x00000001a4cd51d8 -[INPreferences assertThisProcessHasSiriEntitlement] + 112
6 Intents 0x00000001a4cd57f8 -[INPreferences requestSiriAuthorization:] + 96
7 Intents 0x00000001a4cd5950 +[INPreferences requestSiriAuthorization:] + 80
8 AppName 0x0000000100589cf4 -[AppDelegate _requestAuthorizations] (CAppDelegate.m:802)
9 AppName 0x00000001001b99dc -[SplashView p_didTransitionImageViewAnimations] (SplashView.m:234)
10 AppName 0x0000000100a3adb0 -[SplashView p_disappearImageView] (SplashView.m:395)
11 Foundation 0x000000018c1fa46c __NSFireDelayedPerform + 416
12 CoreFoundation 0x000000018b6ab1d8 ___CFRUNLOOP_IS_CALLING_OUT_TO_A_TIMER_CALLBACK_FUNCTION__ + 28
13 CoreFoundation 0x000000018b6aaeec ___CFRunLoopDoTimer + 872
14 CoreFoundation 0x000000018b6aa7a8 ___CFRunLoopDoTimers + 244
15 CoreFoundation 0x000000018b6a83a4 ___CFRunLoopRun + 1572
16 CoreFoundation 0x000000018b5d62b8 CFRunLoopRunSpecific + 436
17 GraphicsServices 0x000000018d08a198 GSEventRunModal + 172
18 UIKit 0x00000001916167fc -[UIApplication _run] + 684
19 UIKit 0x0000000191611534 UIApplicationMain + 204
20 AppName 0x00000001002a6084 main (main.m:248)
21 libdyld.dylib 0x000000018a5b95b8 _dyld_process_info_notify_release + 36
Use of the class <INPreferences: 0x174238980> from an app requires the entitlement com.apple.developer.siri. Did you enable the Siri capability in your Xcode project?
Seems like you need to share data of main applciaiton with extension, turn on Siri Capability and App Grouping for your app. Also, you have to add Siri feature for your app on developer.apple.com
Go to your Entitlements file and make sure you enabled siri

Application crash: QAcessibleInterface and segmentation fault

I have this application bundled on Os X 10.11 El Capitan with Qt 5.5, and runs justfine on the development machine. It also works on Os X Yosemite 10.10.5. The app crashes on all other machines that have Os X 10.11 El Capitan. Here is part of the Error log:
System Integrity Protection: enabled
Crashed Thread: 0 Dispatch queue: com.apple.main-thread
Exception Type: EXC_BAD_ACCESS (SIGSEGV)
Exception Codes: KERN_INVALID_ADDRESS at 0x0000000000000000
Exception Note: EXC_CORPSE_NOTIFY
VM Regions Near 0:
-->
__TEXT 000000010acca000-000000010b06b000 [ 3716K] r-x/rwx SM=COW /Volumes/VOLUME/WaveAnalyser.app/Contents/MacOS/WaveAnalyser
Thread 0 Crashed:: Dispatch queue: com.apple.main-thread
0 QtGui 0x000000010b83bc9a QAccessible::uniqueId(QAccessibleInterface*) + 106
1 libqcocoa.dylib 0x000000010e73b961 QCocoaAccessibility::notifyAccessibilityUpdate(QAccessibleEvent*) + 17
2 QtWidgets 0x000000010b3dac5f QAbstractItemViewPrivate::_q_rowsInserted(QModelIndex const&, int, int) + 127
3 QtWidgets 0x000000010b3dce36 QAbstractItemView::qt_static_metacall(QObject*, QMetaObject::Call, int, void**) + 1510
4 QtCore 0x000000010bf0ac26 QMetaObject::activate(QObject*, int, int, void**) + 2550
5 QtCore 0x000000010bf80d2e QAbstractItemModel::rowsInserted(QModelIndex const&, int, int, QAbstractItemModel::QPrivateSignal) + 78
6 QtCore 0x000000010be8eea0 QAbstractItemModel::endInsertRows() + 80
7 QtGui 0x000000010baffb07 QStandardItemModelPrivate::rowsInserted(QStandardItem*, int, int) + 151
8 QtGui 0x000000010baffec6 QStandardItemPrivate::insertRows(int, int, QList<QStandardItem*> const&) + 934
9 QtGui 0x000000010bb0351b QStandardItemModel::appendRow(QList<QStandardItem*> const&) + 75
The problem shows up when I press the pushbutton that closes the QMainWindow. I can provide complete log to track down the problem.

Resources