MetaMask / metamask-mobile

Mobile web browser providing access to websites that use the Ethereum blockchain
https://metamask.io
Other
2.16k stars 1.12k forks source link

Storage limit issue #2100

Closed roo-shy closed 3 years ago

roo-shy commented 3 years ago

Storage limit issue

  1. When owning metamask app I can't login because I'm asked to enter password then says storage space full. It's not (73277)

  2. Over the past month or more sometimes when I try to login with my fingerprint Metamask asks for my password, then displays a error message about storage being corrupt. After clearing the data and restoring the seed phrase all works again for a while, then almost randomly stops working again (71661)

Screen Shot 2021-01-06 at 1 22 41 PM

Happens only on Android.

Acceptance Criteria:

  1. User shouldn't ever be locked out of their wallet
  2. The new storage solution musn't compromise on security of user data
omnat commented 3 years ago

@andrepimenta @rickycodes Till we figure out a better filesystem (alternative to AsyncStorage) to migrate to, is there anything that we can do, e.g., purge tx history, cache state differently as intermediary solutions to this?

omnat commented 3 years ago

Intermediary solutions: Purge transaction history after it reaches 7MB or # of recent transactions (per account or cumulative for wallet?), the older txs get purged: not persist them

Data we are persisting: Tx controller loads up all info for all accounts that the user has: Transaction History, tokens, etc. Analytics, Bookmarks, Open tabs in the browser. This requires a tx controller refactor to handle this state persistence better.

If needed - Increase the memory limit more than 10MB. But this isn't a long term solution as this limit can be reached.

omnat commented 3 years ago

Problem: AsyncStorage isn't optimal way of persisting data long term. Solutions:

  1. Filesystem - potential security concern
  2. Database like SQL lite
  3. Purging transaction history after a certain store limit - could take a performance hit
sethkfman commented 3 years ago

@rickycodes @andrepimenta

It looks like there are a few options:

  1. We should be able to configure the redux-persist-filesystem-storage module to store the file in the apps sandbox but this would only protect against malicious apps trying to access the file on a non-rooted phone. Additionally the file could be stored encrypted which would provide another layer of security.

  2. We could implement a DB storage mechanism only on Android using Room and add PBC (https://medium.com/vmware-end-user-computing/securing-a-room-database-with-passcode-based-encryption-82ec670961e).

  3. We could have a cross-platform solution using something like:

All that being said here are my thoughts: I think option 3 would be nice and provide some consistency across iOS & Android and scalability into the future. My only concern is that these libraries seem a bit old. Although, it does look like they are being maintained.

Let me know what you think and I would be happy to jump on a call to discuss.

omnat commented 3 years ago

@sethkfman In addition to the better storage system, we should consider handling the edge case of user reaching storage limit.

As a user, I want to be minimally disrupted by this error, such that I at least maintain access to my wallet (and hence funds) without fail.

Given that I reach storage limit, Warn me when I am reaching storage limit So that I know what disruption in MetaMask usage to expect (e.g., some transaction history won't be shown, new custom tokens won't be visible), and if there's a way for me to resolve it (e.g., clear disk space)

sethkfman commented 3 years ago

@rickycodes @andrepimenta @omnat I think the items below capture the meeting but please add/edit if I missed something.

Discussed file storage solution

ibrahimtaveras00 commented 3 years ago

Also during my regression testing on v2.0.0 I was noticing it takes a really long time log into app on one of my specific accounts that has close to 400 transactions on mainnet and over 500 transactions on Rinkeby. Also when creating wallet (at one point it crashed)

Note to check this when the above is fixed to see if it solves the issue.

mobularay commented 3 years ago

@sethkfman will write out test scenarios, then reviewing with @rickycodes and @andrepimenta end of today or tomorrow morning before stand-up.

sethkfman commented 3 years ago

The migration is currently working but it is defaulting to the old DB if anything is corrupted in the new storage. This could cause issues if the old DB has reached its storage limit. I have another branch that has the FileSystem implement throughout the app so it will stop using AsyncStorage. A mechanism to limit the number of transactions cached should be considered.

CC: @andrepimenta & @rickycodes

mxwlsavard commented 3 years ago

I just encountered this exact issue on iOS. Do you need a new issue?

JJJJJJJJJJ2012 commented 3 years ago

I have also encountered this issue roughly 4 times now in the span of less than a month...

ianis58 commented 3 years ago

I encountered the same issue approximately 6 times on Android since I started using MetaMask 1 month ago. I don't understand how people are able to reliably use MetaMask with this issue. Are people mainly using MetaMask on chromium based browsers ?

ianis58 commented 3 years ago

Also I have plenty free space on my device so the corruption error message is not accurate

Uinsionn commented 3 years ago

Has happen to me on my IPhone 11 Pro Max about 4 times now. It's getting more frequent and annoying.

jrog2269 commented 3 years ago

I did this on my android phone and I put in my seed phrase and my balance of tokens shows 0 and looks like it gave me a new address plz help

jrog2269 commented 3 years ago

I had same issue on my android I entered my 12 word phrase and now I have no balance in my wallet it say 0 and have a new address plz help

jrog2269 commented 3 years ago

I had same issue on my android I entered my 12 word phrase and now I have no balance in my wallet it say 0 and have a new address plz help

Poincare1 commented 3 years ago

I am experiencing this error WEEKLY on Android 11. This is ridiculous as it has been happening since May for me. First off, it is a 256GB device, there is no storage limit(ation) of the SD Card or device memory. This happens after about 4 days and either requires a wallet reset or to reinstall Metamask completely. This means, ALL of the custom tokens have to be RE-ENTERED for every chain (Eth, BSC, and Polygon). This is making Metmask mobile unusable. Please get a solution fixed otherwise people will jump to Trust Wallet, as it now be supporting BSC and Polygon.

omnat commented 3 years ago

I hear your frustration. This is a high priority issue, and we are actively working on resolving it and will ship a fix with an upcoming release.

It's been a hard to reproduce issue, but we've certainly heard other reports of it. If we need people to test the fix, would you be willing to help out? @Poincare1 @jrog2269 @Uinsionn @ianis58 ?

Poincare1 commented 3 years ago

"hard to reproduce"?? Just use Metamask for an average week. The error pops up all the friggin' time on Android, forces you to reset, losing all your custom entered coins, and similar info.
People have been reporting this error since January. Your understanding of high priority seems a bit off. This seems more like a we'll get to it when that intern has time type of priority.

ianis58 commented 3 years ago

Hi, When I was encountering this issue, I was using a Oneplus 5 running Android 10. Now that I use a Oneplus 9 on Android 11, the issue doesn't exist anymore. It could be related to the android version, or some Android builds. @omnat I can reproduce the issue on my old phone, so yes I can test a patch if needed. @Poincare1 I understand that you're a bit upset because I was facing the same issue and it makes the app totally useless, but you could be less arrogant and help discussing the issue instead of assuming that what happens on your phone happens on others people phones. Thanks !

jrog2269 commented 3 years ago

I had the same error but I reinstalled metamask and it gave me a whole new address and lost my tokens ..can still see them and old address on etherscan help????

On Wed, Aug 4, 2021, 3:20 AM Ianis R. @.***> wrote:

Hi, When I was encountering this issue, I was using a Oneplus 5 running Android 10. Now that I use a Oneplus 9 on Android 11, the issue doesn't exist anymore. It could be related to the android version, or some Android builds. @omnat https://github.com/omnat I can reproduce the issue on my old phone, so yes I can test a patch if needed. @Poincare1 https://github.com/Poincare1 I understand that you're a bit upset because I was facing the same issue and it makes the app totally useless, but you could be less arrogant and help discussing the issue instead of assuming that what happens on your phone happens on others people phones. Thanks !

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/MetaMask/metamask-mobile/issues/2100#issuecomment-892464488, or unsubscribe https://github.com/notifications/unsubscribe-auth/AU6AZF7YL6KNH2A2MZDXKVLT3DZ3ZANCNFSM4VYCAEVA . Triage notifications on the go with GitHub Mobile for iOS https://apps.apple.com/app/apple-store/id1477376905?ct=notification-email&mt=8&pt=524675 or Android https://play.google.com/store/apps/details?id=com.github.android&utm_campaign=notification-email .

andrepimenta commented 3 years ago

Will be fixed in 3.1.0. Please let us know if the issue still persists.

jrog2269 commented 3 years ago

When will 3.1 be released

On Tue, Aug 17, 2021, 11:40 AM Andre Pimenta @.***> wrote:

Will be fixed in 3.1.0. Please let us know if the issue still persists.

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/MetaMask/metamask-mobile/issues/2100#issuecomment-900455370, or unsubscribe https://github.com/notifications/unsubscribe-auth/AU6AZF3QXHNBRB6Y64NM5RDT5KGIVANCNFSM4VYCAEVA . Triage notifications on the go with GitHub Mobile for iOS https://apps.apple.com/app/apple-store/id1477376905?ct=notification-email&mt=8&pt=524675 or Android https://play.google.com/store/apps/details?id=com.github.android&utm_campaign=notification-email .

nimri commented 3 years ago

I’ve never had this problem before. Today for the first time! I’m running 3.1.0 on the latest iOS

Did your last update mess things up for users who never had this problem before?

Beyond frustrating. Plz fix immediately!

Please tell us what to do to maintain the same address after seed recovery

0xGaryWu commented 3 years ago

I fixed it https://github.com/MetaMask/metamask-mobile/pull/3081/commits/2444b966e7e4d976680da3d92bf3a6cfbeee8075

waiting to be merged

sethkfman commented 3 years ago

@ianis58 Would you be interested in testing a patch release for us on your Oneplus 5?

alvin-reyes commented 3 years ago

Are we going to get an update on this issue?

sethkfman commented 3 years ago

@alvin-reyes A patch provided by (@liangwu) that addresses the immediate issue will be released in v3.3.0. We are working on a longer term solution. If issues persist after the upgrade to v3.3.0 please notify us.

alvin-reyes commented 3 years ago

@alvin-reyes A patch provided by (@liangwu) that addresses the immediate issue will be released in v3.3.0. We are working on a longer term solution. If issues persist after the upgrade to v3.3.0 please notify us.

Thank you! If I may ask, when will 3.3.0 be released?

alvin-reyes commented 3 years ago

I saw the code made by @liangwu, I was wondering how the timeout will solve the case for iOS mobile app users?

I think there are a few solutions to consider, not only the long term solution but also for the edge cases:

0xGaryWu commented 3 years ago

I saw the code made by @liangwu, I was wondering how the timeout will solve the case for iOS mobile app users?

I think there are a few solutions to consider, not only the long term solution but also for the edge cases:

  • cases where user doesn't have the seed phrase but still have access to the data file - I'm not sure if vault decryptor is within the scope? https://metamask.zendesk.com/hc/en-us/articles/360018766351-How-to-use-the-Vault-Decryptor-with-the-MetaMask-Vault-Data
  • I'm thinking for the long term solution on the storage, we can introduce a feature to prompt the user to delete older transactions once a specific threshold is reached? I'm thinking we can do this automatically (asynchronously). The change will to add a setting toggle to auto-purge. If this is enabled, a background process is run periodically to check capacity. Once capacity reaches 70% threshold, delete older transactions to free up? If this toggle is off, the app will continuously prompt the user to allow the app to delete older transactions.

hi, you could read my commits message(https://github.com/MetaMask/metamask-mobile/commit/67763b25a5808e3884781d87caa1dc658a0c24be) to find the reason. code change is simple but take me about 4 days to solve it for that to reproduce is not easy and read whole persist module codes.

0xGaryWu commented 3 years ago

@alvin-reyes A patch provided by (@liangwu) that addresses the immediate issue will be released in v3.3.0. We are working on a longer term solution. If issues persist after the upgrade to v3.3.0 please notify us.

Thank you! If I may ask, when will 3.3.0 be released?

REINSTALL is necessary. (updating will not solve it, once this bug appears, updating do not fix this)

alvin-reyes commented 3 years ago

@alvin-reyes A patch provided by (@liangwu) that addresses the immediate issue will be released in v3.3.0. We are working on a longer term solution. If issues persist after the upgrade to v3.3.0 please notify us.

Thank you! If I may ask, when will 3.3.0 be released?

REINSTALL is necessary. (updating will not solve it, once this bug appears, updating do not fix this)

There are a few users who experienced this without backing up their seeds. Will this reinstalling using the same data files work?

0xGaryWu commented 3 years ago

@alvin-reyes A patch provided by (@liangwu) that addresses the immediate issue will be released in v3.3.0. We are working on a longer term solution. If issues persist after the upgrade to v3.3.0 please notify us.

Thank you! If I may ask, when will 3.3.0 be released?

REINSTALL is necessary. (updating will not solve it, once this bug appears, updating do not fix this)

There are a few users who experienced this without backing up their seeds. Will this reinstalling using the same data files work?

NO, once this bug appears, your data including encrypted seeds etc is gone, which is metamask mobile's current working mechanism. this official is working for a long term solution for this.

TeeJ-J commented 3 years ago

I am also receiving this error message, on iOS. Is there a solution? I don’t want to have to reinstall MetaMask unless I’m 100% sure this will be able to be reinstalled using my key phrase. Sounds like other users have had their wallets reset, and I do not want that obviously. Please advise. Thanks

TeeJ-J commented 3 years ago

Reinstalling and using my seed phrase worked.

However, I had created other wallets in the MetaMask app, for Harmony One, Heco, BSC etc. these did not generate seed phrases, but these are now not listed or shown in the MetaMask app. How can I access these again?

all my favorites, custom networks and accounts other than my Ethereum accounts are gone. please advise

0xGaryWu commented 3 years ago

Reinstalling and using my seed phrase worked.

However, I had created other wallets in the MetaMask app, for Harmony One, Heco, BSC etc. these did not generate seed phrases, but these are now not listed or shown in the MetaMask app. How can I access these again?

find your account in metamask app settings, and export the private key for BSC etc

TeeJ-J commented 3 years ago

What I mean is within MetaMask I had different accounts created in the app, for BSC, Harmony One etc. there is only one seed phrase, which is for my Eth account.

There seems to be no option to find or export a seed phrase for these accounts since the app failed

TeeJ-J commented 3 years ago

Hi guys, any update on this? I still can’t access my other accounts since MetaMask failed. Thanks

sethkfman commented 3 years ago

@TeeJ-J If you created those other accounts on the MetaMask wallet you will need to perform the same process as before. In the app, if you create a new account it will add the same address you used to have. Then you can add your custom network associated with the account.

A friendly reminder, MetaMask will not ask for your Seed Phrase / Secret Recovery Phrase by any means.

If you continue to run into issues please MetaMask support: https://metamask.zendesk.com/hc/en-us/requests/new

If you run into the storage limit error again please report on this GH issue. Thanks

AlexHerman1 commented 3 years ago

@gustavozantut you need to open a support ticket here:

https://metamask.zendesk.com/hc/en-us/requests/new

AlexHerman1 commented 3 years ago

GitHub is not a support forum

jrog2269 commented 3 years ago

Same thing happened to me lost over 10,000 in eth!!

On Wed, Oct 6, 2021, 11:25 AM Gustavo Abbomerato Zantut < @.***> wrote:

I have nothing to do with yours incompetence, disability and bad faith, jut give my wallet back!

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/MetaMask/metamask-mobile/issues/2100#issuecomment-936613165, or unsubscribe https://github.com/notifications/unsubscribe-auth/AU6AZFYPU5RPYV7GF7TXRS3UFR2BLANCNFSM4VYCAEVA . Triage notifications on the go with GitHub Mobile for iOS https://apps.apple.com/app/apple-store/id1477376905?ct=notification-email&mt=8&pt=524675 or Android https://play.google.com/store/apps/details?id=com.github.android&referrer=utm_campaign%3Dnotification-email%26utm_medium%3Demail%26utm_source%3Dgithub.

fadingsignal commented 3 years ago

Just got this here using latest iOS.

cuongnguyen-kms commented 2 years ago

Hi, anyupdate on this? Just got the same issue here

YZBPXX commented 2 years ago

Hi, anyupdate on this? Just got the same issue here

I had the same question, how did you solve it?

YZBPXX commented 2 years ago

Hi, anyupdate on this? Just got the same issue here

I had the same question, how did you solve it?