ionic3/cordova project using cordova-plugin-firebase for analytics but getting network error [closed] - firebase

Closed. This question needs debugging details. It is not currently accepting answers.
Edit the question to include desired behavior, a specific problem or error, and the shortest code necessary to reproduce the problem. This will help others answer the question.
Closed 15 days ago.
This post was edited and submitted for review 8 days ago.
Improve this question
ionic3/cordova, intergrate cordova-plugin-firebase(link: https://ionicframework.com/docs/v3/native/firebase/). When i try to use Firebase/Analyticsthe and run in iPhone14(iOS 16.2). The log said "Encounter network error. Code, error: -1200...".
Finally the analytics data not uploaded to google analytics. even the firebase "debug view" got no data when i enable debug mode.
My code is:
import { Firebase } from '#ionic-native/firebase';
constructor(
private firebase: Firebase
){
platform.ready().then(() => {
this.firebase.setAnalyticsCollectionEnabled(true);
this.firebase.setUserId("test_user_id");
setInterval(() => {
this.firebase.logEvent("tutorial_begin", {id: 2})
this.firebase.logEvent("test_evt_1", {content_type: "page_view", item_id: "home"})
}, 5000);
...
}
}
all firebase logs below:
2023-02-04 16:37:42.422648+0800 WACOAL Body Diary[59287:11003149] 5.7.0 - [Firebase/Analytics][I-ACS023007] Analytics v.50101000 started
2023-02-04 16:37:42.422821+0800 WACOAL Body Diary[59287:11003149] 5.7.0 - [Firebase/Analytics][I-ACS023008] To enable debug logging set the following application argument: -FIRAnalyticsDebugEnabled
2023-02-04 16:37:42.581596+0800 WACOAL Body Diary[59287:11003225] 5.7.0 - [Firebase/Messaging][I-FCM001000] FIRMessaging Remote Notifications proxy enabled, will swizzle remote notification receiver handlers. If you'd prefer to manually integrate Firebase Messaging, add "FirebaseAppDelegateProxyEnabled" to your Info.plist, and set it to NO. Follow the instructions at:
4 16:37:42.581748+0800 WACOAL Body Diary[59287:11003225] 5.7.0 - [Firebase/Messaging][I-FCM002023] The object <AppDelegate: 0x28251fac0> does not respond to -messaging:didReceiveRegistrationToken:. Please implement -messaging:didReceiveRegistrationToken: to be provided with an FCM token.
071+0800 WACOAL Body Diary[59287:11003225] 5.7.0 - [Firebase/InstanceID][I-IID003009] Failed to fetch default token Error Domain=NSURLErrorDomain Code=-1009 "似乎已断开与互联网的连接。" UserInfo={_kCFStreamErrorCodeKey=50, NSUnderlyingError=0x282bb9800 {Error Domain=kCFErrorDomainCFNetwork Code=-1009 "(null)" UserInfo={_NSURLErrorNWPathKey=unsatisfied (Denied over Wi-Fi interface), interface: utun5, ipv4, dns, _kCFStreamErrorCodeKey=50, _kCFStreamErrorDomainKey=1}}, _NSURLErrorFailingURLSessionTaskErrorKey=LocalDataTask <70C75EC3-B639-4A14-814E-8E8C2EBCC341>.<1>, _NSURLErrorRelatedURLSessionTaskErrorKey=(
2023-02-04 16:37:42.596475+0800 WACOAL Body Diary[59287:11003159] 5.7.0 - [Firebase/Core][I-COR000020] Error posting to Clearcut: Error Domain=NSURLErrorDomain Code=-1009 "似乎已断开与互联网的连接。" UserInfo={_kCFStreamErrorCodeKey=50, NSUnderlyingError=0x282bbe880 {Error Domain=kCFErrorDomainCFNetwork Code=-1009 "(null)" UserInfo={_NSURLErrorNWPathKey=unsatisfied (Denied over Wi-Fi interface), interface: utun5, ipv4, dns, _kCFStreamErrorCodeKey=50, _kCFStreamErrorDomainKey=1}}, _NSURLErrorFailingURLSessionTaskErrorKey=LocalUploadTask <4509C1F8-6B85-4BF4-AA49-6FE4264C1CDF>.<1>, _NSURLErrorRelatedURLSessionTaskErrorKey=(
2023-02-04 16:37:44.990333+0800 WACOAL Body Diary[59287:11003217] 5.7.0 - [Firebase/Messaging][I-FCM002024] Format '/topics/all' is deprecated. Only 'all' should be used in subscribeToTopic.
2023-02-04 16:37:44.990664+0800 WACOAL Body Diary[59287:11003217] 5.7.0 - [Firebase/Messaging][I-FCM002010] The subscription operation is suspended because you don't have a token. The operation will resume once you get an FCM token.
2023-02-04 16:37:57.785635+0800 WACOAL Body Diary[59287:11003146] 5.7.0 - [Firebase/Analytics][I-ACS901017] Encounter network error. Code, error: -1200, Error Domain=NSURLErrorDomain Code=-1200 "发生了SSL错误,无法建立与该服务器的安全连接。" UserInfo={NSErrorFailingURLStringKey=https://app-measurement.com/config/app/1:863098066657:ios:e3bc4d921269b1d05249a0?platform=ios&app_instance_id=74BD658D121843AC9516C1D5016C087B&gmp_version=50101, NSLocalizedRecoverySuggestion=你仍要连接此服务器吗?, _kCFStreamErrorDomainKey=3, _NSURLErrorFailingURLSessionTaskErrorKey=LocalDownloadTask <33762771-AD4A-4E28-B0F4-B9B0EA93033B>.<1>, _NSURLErrorRelatedURLSessionTaskErrorKey=(

Related

Solidity Deployment Error - "ProviderError: HttpProviderError"

Been attempting to deploy a new instance of a contract I've deployed before, from an environment I haven't used in a while (though which has successfully deployed before). None of the details of the contracts or my configuration have changed, and it appears that the http error is unrelated. What can I do to debug and resolve?
ProviderError: HttpProviderError
at HttpProvider.request (/home/user/Solidity/env/node_modules/hardhat/src/internal/core/providers/http.ts:78:19)
at LocalAccountsProvider.request (/home/user/Solidity/env/node_modules/hardhat/src/internal/core/providers/accounts.ts:187:34)
at processTicksAndRejections (node:internal/process/task_queues:95:5)
at ChainIdValidatorProvider._getChainIdFromEthNetVersion (/home/user/Solidity/env/node_modules/hardhat/src/internal/core/providers/chainId.ts:33:17)
at ChainIdValidatorProvider._getChainId (/home/user/Solidity/env/node_modules/hardhat/src/internal/core/providers/chainId.ts:17:25)
at ChainIdValidatorProvider.request (/home/user/Solidity/env/node_modules/hardhat/src/internal/core/providers/chainId.ts:55:29)
at EthersProviderWrapper.send (/home/user/Solidity/env/node_modules/#nomiclabs/hardhat-ethers/src/internal/ethers-provider-wrapper.ts:13:20)
at getSigners (/home/user/Solidity/env/node_modules/#nomiclabs/hardhat-ethers/src/internal/helpers.ts:45:20)
at getContractFactoryByAbiAndBytecode (/home/user/Solidity/env/node_modules/#nomiclabs/hardhat-ethers/src/internal/helpers.ts:288:21)
at main (/home/user/Solidity/env/scripts/deployVerify.js:6:27)
error Command failed with exit code 1.
info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.
Found some great advice here: https://stackoverflow.com/a/74842616/14111336
Turns out my Alchemy RPC app had ceased working. I reset to a new app, and worked immediately as intended.

"invalid source token" while deploying a function to fireabse

i got wired issued with firebase deployment using:
firebase deploy -P dev
the error is
✔ functions[testFunction(us-central1)] Successful update operation.
Invalid source token
looks like its happen to new functions that created
when i tried to deploy specific function using:
firebase -deploy -P dev --only functions:name
its working
when i run and deploy all functions and all my apps i am getting the above error with no information
also the logs from google cloud function is:
status: {
code: 9
message: "Invalid source token"
}
firebase tools version 11.0.0
node: 14.19.3
I would suggest upgrading to atleast node 16 as there's an open issue regarding the "Invalid Source Token" on your current firebase-tools version. There's already a pull request regarding that issue and it will be fixed on the upcoming updates. Here's the github issue for reference.

firebase-admin fails with error maxretry without much information about the underlying cause and stops the node script also

I have a mobile and web app that use firebase realtime database and there are some long running tasks which are served on servers with the help of firebase-queue and firebase-admin. The long running tasks is to find out who else is using the mobile app in a person's contact book. So, if you install the app, the app will send a task to the server with your contact book data and ask it to find the people in the contact book who are also using the app. Every now and then I see two types of errors in the logs. First error is below which also cause the node process to stop.
/Users/varungupta/Projects/myapp-server/node_modules/#firebase/database-compat/dist/index.standalone.js:15373
return queue[i].onComplete(new Error(abortReason), false, null);
^
Error: maxretry
at /Users/varungupta/Projects/myapp-server/node_modules/#firebase/database-compat/dist/index.standalone.js:15373:52
at exceptionGuard (/Users/varungupta/Projects/myapp-server/node_modules/#firebase/database-compat/dist/index.standalone.js:4018:9)
at repoRerunTransactionQueue (/Users/varungupta/Projects/myapp-server/node_modules/#firebase/database-compat/dist/index.standalone.js:15386:9)
at repoRerunTransactions (/Users/varungupta/Projects/myapp-server/node_modules/#firebase/database-compat/dist/index.standalone.js:15279:5)
at /Users/varungupta/Projects/myapp-server/node_modules/#firebase/database-compat/dist/index.standalone.js:15260:13
at /Users/varungupta/Projects/myapp-server/node_modules/#firebase/database-compat/dist/index.standalone.js:7061:17
at PersistentConnection.onDataMessage_ (/Users/varungupta/Projects/myapp-server/node_modules/#firebase/database-compat/dist/index.standalone.js:7088:17)
at Connection.onDataMessage_ (/Users/varungupta/Projects/myapp-server/node_modules/#firebase/database-compat/dist/index.standalone.js:5882:14)
at Connection.onPrimaryMessageReceived_ (/Users/varungupta/Projects/myapp-server/node_modules/#firebase/database-compat/dist/index.standalone.js:5876:18)
at WebSocketConnection.onMessage (/Users/varungupta/Projects/myapp-server/node_modules/#firebase/database-compat/dist/index.standalone.js:5778:27)
at WebSocketConnection.appendFrame_ (/Users/varungupta/Projects/myapp-server/node_modules/#firebase/database-compat/dist/index.standalone.js:4491:18)
at WebSocketConnection.handleIncomingFrame (/Users/varungupta/Projects/myapp-server/node_modules/#firebase/database-compat/dist/index.standalone.js:4539:22)
at Client.mySock.onmessage (/Users/varungupta/Projects/myapp-server/node_modules/#firebase/database-compat/dist/index.standalone.js:4438:19)
at Client.dispatchEvent (/Users/varungupta/Projects/myapp-server/node_modules/#firebase/database-compat/dist/index.standalone.js:2883:30)
at Client._receiveMessage (/Users/varungupta/Projects/myapp-server/node_modules/#firebase/database-compat/dist/index.standalone.js:3042:10)
at Client$2.<anonymous> (/Users/varungupta/Projects/myapp-server/node_modules/#firebase/database-compat/dist/index.standalone.js:2924:49)
at Client$2.emit (node:events:539:35)
at Client$2.emit (node:domain:475:12)
at Client$2.<anonymous> (/Users/varungupta/Projects/myapp-server/node_modules/#firebase/database-compat/dist/index.standalone.js:2186:14)
at pipe (/Users/varungupta/Projects/myapp-server/node_modules/#firebase/database-compat/dist/index.standalone.js:1503:40)
at Pipeline$1._loop (/Users/varungupta/Projects/myapp-server/node_modules/#firebase/database-compat/dist/index.standalone.js:1510:3)
at Pipeline$1.processIncomingMessage (/Users/varungupta/Projects/myapp-server/node_modules/#firebase/database-compat/dist/index.standalone.js:1479:8)
at Extensions$1.processIncomingMessage (/Users/varungupta/Projects/myapp-server/node_modules/#firebase/database-compat/dist/index.standalone.js:1645:20)
at Client$2._emitMessage (/Users/varungupta/Projects/myapp-server/node_modules/#firebase/database-compat/dist/index.standalone.js:2177:22)
at Client$2._emitFrame (/Users/varungupta/Projects/myapp-server/node_modules/#firebase/database-compat/dist/index.standalone.js:2137:19)
at Client$2.parse (/Users/varungupta/Projects/myapp-server/node_modules/#firebase/database-compat/dist/index.standalone.js:1863:18)
at Client$2.parse (/Users/varungupta/Projects/myapp-server/node_modules/#firebase/database-compat/dist/index.standalone.js:2369:60)
at IO.write (/Users/varungupta/Projects/myapp-server/node_modules/#firebase/database-compat/dist/index.standalone.js:186:16)
at TLSSocket.ondata (node:internal/streams/readable:754:22)
at TLSSocket.emit (node:events:527:28)
at TLSSocket.emit (node:domain:475:12)
at addChunk (node:internal/streams/readable:315:12)
at readableAddChunk (node:internal/streams/readable:289:9)
at TLSSocket.Readable.push (node:internal/streams/readable:228:10)
at TLSWrap.onStreamRead (node:internal/stream_base_commons:190:23)
There isn't much information about what exactly caused the maxretry error. The error happens at random after a few days of running the script. It doesn't happen right away.
The second error that I see that isn't as disruptive as the one above is
[2022-06-01T10:30:49.722Z] #firebase/database: FIREBASE WARNING: transaction at /queue/tasks/-N3TDQCAdt4y-akb0_MK failed: disconnect
This doesn't stop the node process and I can see that a transaction failed but not sure why did it disconnect and how can I resolve this problem.
I am using firebase-admin 9.6.0.

ReactNative Crashlytics doesn't send logs when application crash or log

I have a React Native application i installed firebase successfly
"#react-native-firebase/analytics": "^7.6.8",
"#react-native-firebase/app": "^8.4.6",
"#react-native-firebase/crashlytics": "^8.4.11",
i can see on dashboard analytics on firebase that i have One user Active, i do some crash to simulate crashes, but i can't see them on firebase, i have a loader that says add sdk firebase ....
When i see on log console xcode i can see there is problem with crashlytics :
[Firebase/Crashlytics][I-CLS000000] Failed to download settings Error Domain=FIRCLSNetworkError Code=-6 "(null)" UserInfo={retryLimit=1, NSErrorFailingURLStringKey=https://firebase-settings.crashlytics.com/spi/v2/platforms/ios/gmp/1:359190975801:ios:9ed89ac2d5d316ebe184e8/settings?build_version=4&display_version=2.009&instance=107518e136276e412097823086820b54535a54f6&source=1}
2020-10-27 10:46:25.558428+0100 MYAPPLI****[4103:1348887] Task <30DF78EC-4FD2-41EF-A978-33989A7C7CFB>.<2> finished with error [-1001] Error Domain=NSURLErrorDomain Code=-1001 "Request timed out earlier than tunneling config was received." UserInfo={_NSURLErrorRelatedURLSessionTaskErrorKey=(
"LocalDataTask <30DF78EC-4FD2-41EF-A978-33989A7C7CFB>.<2>"
), NSLocalizedFailureReason=Request timed out earlier than tunneling config was received., _NSURLErrorFailingURLSessionTaskErrorKey=LocalDataTask <30DF78EC-4FD2-41EF-A978-33989A7C7CFB>.<2>}
I also tried to add log on the reactnative code :
import crashlytics from '#react-native-firebase/crashlytics';
crashlytics().log('Updating user count.');
But nothing showed on crashlytics
any help will be appreciated
-------------------------------Edit---------------------------------------
when i add ${PODS_ROOT}/FirebaseCrashlytics/run to build phase run script i don't get anymore error on log console xcode, but still can't see any log on crashlytics console

Firebase Cloud Functions Shell not executing write operations on realtime database

Since a few days I am not able to test cloud functions locally anymore, as all write functions are not executed and nothing is returned, consequently the function hangs and eventually stops with a timeout.
Example function:
import { database as dbEvent } from "firebase-functions";
export default dbEvent.ref("/tariffs/removeHistory").onCreate((event: any) => {
console.log("START");
const bikesHistoryRef = event.data.adminRef.parent.parent.child("bikesHistory");
return bikesHistoryRef.set(null).then((res) => console.log("Delete done", res));
});
Result:
firebase > removeBikeHistory("test")
'Successfully invoked function.'
firebase > info: User function triggered, starting execution
info: START
firebase >
firebase > info: Execution took 61023 ms, finished with status: 'timeout'
info: Execution took 49694 ms, finished with status: 'crash'
Any suggestion what is wrong? This happens with all my cloud functions, and when I deploy them it works.
I have tried with:
firebase-admin#5.5.1
firebase-functions#0.7.3
firebase-tools#3.15.4 (-g)
and
firebase-admin#5.6.0
firebase-functions#0.7.5
firebase-tools#3.16.0 (-g)
EDIT:
After enabling logging I get the following errors:
info: 0: onDisconnectEvents
info: p:0: Making a connection attempt
info: p:0: Failed to get token: Error: Credential implementation provided to initializeApp() via the "credential" property failed to fetch a valid Google OAuth2 access token with the following error: "Error fetching access token: invalid_grant (Bad Request)". There are two likely causes: (1) your server time is not properly synced or (2) your certificate key file has been revoked. To solve (1), re-sync the time on your server. To solve (2), make sure the key ID for your key file is still present at https://console.firebase.google.com/iam-admin/serviceaccounts/project. If not, generate a new key file at https://console.firebase.google.com/project/_/settings/serviceaccounts/adminsdk.
p:0: data client disconnected
info: p:0: Trying to reconnect in 1283.8299240003184ms
0: onDisconnectEvents
I have actually seen this error when I installed an older firebase-function/admin version, but thought it got fixed by installing the newer version. How can I fix it?
I found the solution in this bug report:
https://github.com/firebase/firebase-functions/issues/135
I have deleted the following file, now my cloud functions work locally again:
rm ~/.config/gcloud/application_default_credentials.json

Resources