Skip to content

Android mobile terminal H5 error... #6456

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
HChen318 opened this issue Jul 20, 2022 · 12 comments
Closed

Android mobile terminal H5 error... #6456

HChen318 opened this issue Jul 20, 2022 · 12 comments

Comments

@HChen318
Copy link

Error 1
FirebaseError
Firebase: Error thrown when reading from storage. Original error: Firebase: Error thrown when opening storage. Original error: Version change transaction was aborted in upgradeneeded event handler.. (app/storage-open).. (app/storage-get).

error code:

throw ERROR_FACTORY.create(AppError.STORAGE_GET, {
originalErrorMessage: (e as Error)?.message
});

Error 2
FirebaseError
Installations: Could not process request. Application offline. (installations/app-offline).

error code:
const registrationPromiseWithError = Promise.reject(
ERROR_FACTORY.create(ErrorCode.APP_OFFLINE)
);

Error 3
FirebaseError
Installations: Could not process request. Application offline. (installations/app-offline).

Error 4
ReferenceError
fetch is not defined

error code:
requiredApisAvailable(): boolean {
if (!fetch || !Promise || !areCookiesEnabled()) {
consoleLogger.info(
'Firebase Performance cannot start if browser does not support fetch and Promise or cookie is disabled.'
);
return false;
}

@google-oss-bot
Copy link
Contributor

I couldn't figure out how to label this issue, so I've labeled it for a human to triage. Hang tight.

@rizafran
Copy link

Hi @HChen318, please follow the issue template including the needed information so we can have a better understanding of the issue. Thanks.

@HChen318
Copy link
Author

Hi @HChen318, please follow the issue template including the needed information so we can have a better understanding of the issue. Thanks.

[REQUIRED] Describe your environment
Operating System version: [Android 6.1.1]
Browser version: Google Chrome 103.0.5060.114
Firebase SDK version: 9.1.1
Firebase Product: firebase Performance

[REQUIRED] Describe the problem
We use firebase to report performance on the H5 page, and some Android models will report errors on the sentry monitoring platform

@hsubox76
Copy link
Contributor

  • Are you able to reproduce any of these errors locally on your own Android devices?
  • Two of the errors say that the device is offline. Probably the device is offline? That seems normal enough?
  • One of the errors says that fetch is not defined. It's probably being used on a browser where fetch is not defined, maybe an old browser. You listed one Google Chrome version above, is it the same version all the errors are being logged from?
  • I'm not sure what the first error is, how frequent is it? If it only occurs once it might just be something unusual happening in one case.

@HChen318
Copy link
Author

  • Are you able to reproduce any of these errors locally on your own Android devices?
  • Two of the errors say that the device is offline. Probably the device is offline? That seems normal enough?
  • One of the errors says that fetch is not defined. It's probably being used on a browser where fetch is not defined, maybe an old browser. You listed one Google Chrome version above, is it the same version all the errors are being logged from?
  • I'm not sure what the first error is, how frequent is it? If it only occurs once it might just be something unusual happening in one case.

I can't reproduce it on my android phone.
Google version varies, there are other versions such as chrome 45.0.24.
The first problem is quite frequent. There are more than 400 users who report errors.

@hsubox76
Copy link
Contributor

If we can't reproduce this error, it will be difficult to find the actual cause and fix it. The best we can do is guess. The first error is caused by a failed IndexedDB transaction, probably in the upgrade callback in the core app package, here:

upgrade: (db, oldVersion) => {

I can try wrapping the only statement in there, the db.createObjectStore() call, in an if check (to see if STORE_NAME exists) and maybe a try/catch block if that works on createObjectStore, and it might be a good idea in general to just add more error handling there, but since we can't reproduce your problem, there's no guarantee this will fix it specifically.

@hsubox76
Copy link
Contributor

hsubox76 commented Jul 21, 2022

I can't reproduce it on my end after messing around with various db versions and trying to force it into an odd state. Can you share anything about your code? How are you importing and initializing app and performance? Are you using performance standalone?

Edit: My best guess is that perhaps you have a situation where you're somehow loading 2 versions of firebase/app and they're both trying to open idb at the same time and there's a race condition perhaps?

@HChen318
Copy link
Author

ok
in index.js use

import { initializeApp } from 'firebase/app'
import { getAnalytics } from 'firebase/analytics'
import { getPerformance } from 'firebase/performance'

const firebaseConfig = {
apiKey: 'x',xxxx
authDomain: 'xxxx',
projectId: 'xxx',
storageBucket: 'wx',
messagingSenderId: 'xxx',
appId: 'x',xx
measurementId: 'x'xxx
}

// Initialize Firebase
const app = initializeApp(firebaseConfig)
const analytics = getAnalytics(app)
const perf = getPerformance(app)

@hsubox76
Copy link
Contributor

Everything looks correct and I can't reproduce it with a similar setup. I can try to wrap db.createObjectStore() in more error handling, but no guarantee that will fix your problem unless you can provide a sample app that can consistently reproduce the error locally. I will update this issue when I've made a PR for the error handling.

@HChen318
Copy link
Author

Everything looks correct and I can't reproduce it with a similar setup. I can try to wrap db.createObjectStore() in more error handling, but no guarantee that will fix your problem unless you can provide a sample app that can consistently reproduce the error locally. I will update this issue when I've made a PR for the error handling.

ok, I am following

@google-oss-bot
Copy link
Contributor

Hey @HChen318. We need more information to resolve this issue but there hasn't been an update in 5 weekdays. I'm marking the issue as stale and if there are no new updates in the next 5 days I will close it automatically.

If you have more information that will help us get to the bottom of this, just add a comment!

@google-oss-bot
Copy link
Contributor

Since there haven't been any recent updates here, I am going to close this issue.

@HChen318 if you're still experiencing this problem and want to continue the discussion just leave a comment here and we are happy to re-open this.

@firebase firebase locked and limited conversation to collaborators Jul 9, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

6 participants