PhilippC / keepass2android

Password manager app for Android
https://play.google.com/store/apps/details?id=keepass2android.keepass2android
GNU General Public License v3.0
4.83k stars 390 forks source link

"The name must not be empty: null" when opening from Google Drive #432

Closed imDema closed 6 years ago

imDema commented 6 years ago

Trying to open from recents says that the cached version will be used instead because it couldn't get it from drive Trying to open it again shows the error after choosing the account

cob05 commented 6 years ago

I'm having the same issue. Something broke in the last update.

PhilippC commented 6 years ago

you can try the following steps:

(Before running the following steps, make sure you don't have local changes in your database which have not been synchronized with Google Drive (this can happen if you worked offline). If you have, please open the database from the local cache and go to settings - database settings - export database and make a backup copy of the data.)

One of these has helped all users so far, but unfortunately it's not totally clear to me why different steps are required (or nothing for most users).

foic commented 6 years ago

I would reliably get failures when opening from the shortcut in the "Open recent database" section after the application update. Simply choosing "open file" and rebrowsing for the file again on gdrive resolved the issue. The "open recent" entry works again at that point.

PatrickHonorez commented 6 years ago

clearing the cache & app memory solved the problem for me.

imDema commented 6 years ago

Clearing cache solved it

ghost commented 6 years ago

I'd be curious for the Android version of each occurance

mabdullah2010 commented 6 years ago

I experienced this issue after my phone upgraded to Oreo. Removing all permissions and reopening the app fixed it for me. Just posting for informational purposes. Thanks for the fix suggestions.

r0bnet commented 6 years ago

I also experienced it but the oreo update was "long" ago. What helped for me (try this before clearing the cache or uninstalling the app):

  1. Revoke storage permission for the app (if it is not already revoked)
  2. (Re-)add storage permission
  3. Force exit app
  4. Restart

Maybe this is helpful for anyone.

ghost commented 6 years ago

I guess the only real way to debug this would be to actually get a bug report, or logs of a system that this is still occurring on. However it seems very hit or miss and doesn't see like it is an easy thing to reproduce.

andjo commented 6 years ago

Here is a (slightly edited) log I generated while having this problem. Android 8.1.0, July 5, 2018 patch.

This issue should not be closed yet, should it?

7/14/2018 12:01:21 PM:282 -- KeePass.OnCreate
7/14/2018 12:01:21 PM:286 -- KeePass:apptask=
7/14/2018 12:01:21 PM:293 -- Loaded task keepass2android.NullTask
7/14/2018 12:01:21 PM:293 -- KeePass.OnCreate
7/14/2018 12:01:21 PM:325 -- KeePass.OnStart
7/14/2018 12:01:21 PM:326 -- KeePass.OnStart
7/14/2018 12:01:21 PM:417 -- FileSelect.OnCreate
7/14/2018 12:01:21 PM:418 -- FileSelect:apptask=NullTask
7/14/2018 12:01:21 PM:424 -- Loaded task keepass2android.NullTask
7/14/2018 12:01:21 PM:660 -- FileSelect.OnStart
7/14/2018 12:01:21 PM:856 -- FileSelect.OnResume
7/14/2018 12:01:22 PM:207 -- KeePass.OnStop
7/14/2018 12:01:22 PM:212 -- KeePass.OnDestroyTrue
7/14/2018 12:01:22 PM:214 -- KeePass.OnDestroyTrue
7/14/2018 12:01:26 PM:323 -- FileSelect.OnPause
7/14/2018 12:01:26 PM:355 -- FSSA.OnCreate with gdrive://.U8-andersjo%40gmail.com/.U8-Anders...
7/14/2018 12:01:26 PM:369 -- JFS/OnResume Ioc.Path=gdrive://.U8-andersjo%40gmail.com/.U8-Anders... Path=gdrive://.U8-andersjo%40gmail.com/.U8-Andets...
7/14/2018 12:01:26 PM:446 -- No AppTask in OnActivityResult
7/14/2018 12:01:26 PM:508 -- PasswordActivity.OnCreate
7/14/2018 12:01:26 PM:509 -- PasswordActivity:apptask=
7/14/2018 12:01:26 PM:516 -- Loaded task keepass2android.NullTask
7/14/2018 12:01:26 PM:874 -- PasswordActivity.OnStart
7/14/2018 12:01:26 PM:886 -- PasswordActivity.OnResume
7/14/2018 12:01:26 PM:887 --  DatabaseIsUnlocked=False
7/14/2018 12:01:26 PM:889 -- starting: True, Finishing: False, _performingLoad: False
7/14/2018 12:01:26 PM:932 -- Pre-loading database file starting
7/14/2018 12:01:26 PM:951 -- CFS: OpenWhenLocalChanges
7/14/2018 12:01:26 PM:968 -- the name must not be empty: null
7/14/2018 12:01:27 PM:1 -- couldn't open from remote gdrive://.U8-andersjo%40gmail.com/.U8-Anders..

7/14/2018 12:01:27 PM:2 -- PasswordActivity.OnPause
7/14/2018 12:01:27 PM:3 -- System.Exception: the name must not be empty: null ---> Java.Lang.IllegalArgumentException: the name must not be empty: null
  at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw () [0x0000c] in <92ccbda37a8f409b84c0d709658b6bb1>:0 
  at Java.Interop.JniEnvironment+InstanceMethods.CallObjectMethod (Java.Interop.JniObjectReference instance, Java.Interop.JniMethodInfo method, Java.Interop.JniArgumentValue* args) [0x00069] in <50f136c22854451fb0164819995099ad>:0 
  at Android.Runtime.JNIEnv.CallObjectMethod (System.IntPtr jobject, System.IntPtr jmethod, Android.Runtime.JValue* parms) [0x0000e] in <fb151c603a6b487c8c4acc18b247387d>:0 
  at Keepass2android.Javafilestorage.GoogleDriveFileStorage.OpenFileForRead (System.String p0) [0x00062] in <864263ecf9c74d2cbcc01d384e32b4fd>:0 
  at keepass2android.Io.JavaFileStorage.OpenFileForRead (KeePassLib.Serialization.IOConnectionInfo ioc) [0x0000d] in <8b8564fc621f46ffaff800ca19bc9b90>:0 
   --- End of inner exception stack trace ---
  at keepass2android.Io.JavaFileStorage.OpenFileForRead (KeePassLib.Serialization.IOConnectionInfo ioc) [0x0002b] in <8b8564fc621f46ffaff800ca19bc9b90>:0 
  at keepass2android.Io.OfflineSwitchableFileStorage.OpenFileForRead (KeePassLib.Serialization.IOConnectionInfo ioc) [0x00006] in <8b8564fc621f46ffaff800ca19bc9b90>:0 
  at keepass2android.Io.CachingFileStorage.GetRemoteDataAndHash (KeePassLib.Serialization.IOConnectionInfo ioc, System.String& hash) [0x00006] in <8b8564fc621f46ffaff800ca19bc9b90>:0 
  at keepass2android.Io.CachingFileStorage.CalculateHash (KeePassLib.Serialization.IOConnectionInfo ioc) [0x00000] in <8b8564fc621f46ffaff800ca19bc9b90>:0 
  at keepass2android.Io.CachingFileStorage.OpenFileForReadWhenLocalChanges (KeePassLib.Serialization.IOConnectionInfo ioc, System.String cachedFilePath) [0x00000] in <8b8564fc621f46ffaff800ca19bc9b90>:0 
  at keepass2android.Io.CachingFileStorage.OpenFileForRead (KeePassLib.Serialization.IOConnectionInfo ioc) [0x00045] in <8b8564fc621f46ffaff800ca19bc9b90>:0 
7/14/2018 12:01:27 PM:99 -- Pre-loading database file completed
7/14/2018 12:01:27 PM:148 -- PasswordActivity.OnResume
7/14/2018 12:01:27 PM:149 --  DatabaseIsUnlocked=False
7/14/2018 12:01:27 PM:150 -- starting: False, Finishing: False, _performingLoad: False
7/14/2018 12:01:27 PM:171 -- FP: Create FingerprintDecryption
7/14/2018 12:01:27 PM:193 -- FP: Init for Dec
7/14/2018 12:01:27 PM:261 -- FP: StartListening 
7/14/2018 12:01:27 PM:505 -- FileSelect.OnStop
7/14/2018 12:01:27 PM:568 -- FileSelect.OnDestroyTrue
7/14/2018 12:01:34 PM:759 -- FP: StopListening 
7/14/2018 12:01:34 PM:762 -- PasswordActivity.OnPause
7/14/2018 12:01:34 PM:782 -- AppSettingsActivity.OnCreate
7/14/2018 12:01:34 PM:783 -- AppSettingsActivity:apptask=
7/14/2018 12:01:34 PM:963 -- AppSettingsActivity.OnStart
7/14/2018 12:01:34 PM:965 -- AppSettingsActivity.OnResume
7/14/2018 12:01:34 PM:965 --  DatabaseIsUnlocked=False
7/14/2018 12:01:34 PM:974 -- FP: OnAuthenticationError: Fingerprint operation canceled., True
7/14/2018 12:01:35 PM:449 -- PasswordActivity.OnStop
jon-mueller commented 6 years ago

Just to chime in- the solution from @r0bnet worked perfectly for me. Thanks!!

PhilippC commented 6 years ago

@andjo This issue is caused by a behavior change introduced with Android 8 which is now "activated" by targeting Android 8 since 1.05. Following the advice from https://github.com/PhilippC/keepass2android/issues/432#issuecomment-401561254 fixes the issue.

GetSpiffed commented 6 years ago

solution from @r0bnet worked for me as well..

MeLlamoPablo commented 6 years ago

I did all of these steps, but it's still not working for me. I'm running LineageOS 15.1 with microG. It worked fine in 14.1, even with microG.

thany commented 6 years ago

Clearing cache & permissions worked for me.

Can we please get an update with a permanent fix? These steps should not be neccesary when something arbitrary changes or whatever.

toleressea commented 5 years ago

Clearing cache + data worked for me.

zefie commented 5 years ago

Leaving this note on this issue as it is most related.

Fresh setup of Android Pi 9 (Samsung S8 beta, no root). Let Google do the restore thing.

First use of Keepass2Android was a prompt to log into Facebook (eg the autofill option in the Facebook app). When trying to add my Google Drive, it would ask which account, then fail silently by returning to the main app page without loading anything.

Closed Facebook and went to KP directly, same thing.

Force closed KP and reloaded it directly, worked.

Dunno if this helps anyone in any way but just leaving it here.

blizard863 commented 5 years ago

uninstall app install app

will fix this problem。

thany commented 5 years ago

Why does reinstalling the app fix it?

This feels like a workaround to me. Whatever causes the error can surely be fixed more robustly.

vdrHorst commented 4 years ago

I see this issue is Closed, but I just ran into this same behaviour again on my new Samsung S10 android phone. Tried all proposed solutions (remove app, clear cache, removed local downloaded files) in several combinations without luck. Tested Dropbox storage as side chain, which worked immediately. Would like to sync my Drive file though... All help appreciated 🙂

PhilippC commented 4 years ago

so far the tips from https://github.com/PhilippC/keepass2android/issues/432#issuecomment-401561254 have helped for all. Can you please try to repeat?

vdrHorst commented 4 years ago

Hi Philipp, just to let you know it now works on my new S10 phone. Between the time I reported the problem and now, I did not do anything on the phone, except it ran out of battery power and was off for at least half a day before I read your reply. As noted before, I did try all proposed solutions, before I raised this question. I had(!) rebooted several times before, and I did reinstall (serveral times) in between, just to make sure I started the investigations vanilla. It drove me crazy, not able to fix it myself (as software engineer myself). The only conclusion I now can make is that it has to do something with the cache. It seems that "waiting" was clearing that cache somehow? But remove and reinstall did NOT clear the cache. I remember I also scanned through the filesystem and removed any wrong reference to be possibly used. However, I might not have done the right way in "clearing the cache". It might be usefull to describe the exact steps to perform such action....

Anyway, it works for me now again, so thank you very much for all the time and effort in this great piece of work!

rajeev-xyz commented 3 years ago

I too was facing this issue for my app Expensa where user tries to backup their data using google drive. I was able to resolve this by logout and login again - incase if this helps someone with similar root cause. Thanks.

Karreg commented 2 years ago

For the record, I just had this issue:

So clearing data and cache makes no sense. However, it still did fix the issue.

thany commented 2 years ago

@PhilippC Having a workaround means a fix is still due. Issues with only a workaround should not be closed, iyam.

Giganticus commented 2 years ago

Also having problems- new phone (Samsung A53). Tried all the suggestions and still get "Invalid composite key!"

...also the kdbx file doesn't open with KeePassDX ("Could not read credentials"). I'm using Google Drive to share the file between phone and PC.
So looks like an issue with how the file is copied or permissioned.

D'oh - I'd been getting my password wrong - (lower case should have been a cap).

So the messages were right and the app works perfectly. Thanks!

Code-1-ai commented 1 year ago

Re-install the keepass app and it will work.

Karreg commented 1 year ago

Re-install the keepass app and it will work.

No, it can also happen on a first install.

juicejuice commented 1 year ago

I can confirm as of yesterday (25 Apr 2023) you still need to "clear storage" for Keepass2Android to connect to Google Drive. This is a fresh install on a freshly wiped Pixel 7 Pro. Without that step it appears the access credentials are not made available to the Google Drive integration.

thany commented 1 year ago

Can this bug please be reopened? I'm not seeing any indication that this bug is fixed.

Slagh commented 1 year ago

Reproed this on a new phone - Google had transferred something of the app's storage or cache to the new phone and triggered the very same error message. Solved by clearing storage and cache, as reported by others here.

thany commented 1 year ago

But not actually solved. As a user you shouldn't have to manually clear cache.

johnfoxii commented 4 months ago

clearing the cache & app memory solved the problem for me thanks Patrick

johnfoxii commented 4 months ago

this was on a new device where smart switch had been used to transfer data, clearing cache in this case makes sense.

thany commented 4 months ago

@PhilippC Can you please reopen this issue? There seems to be only a workaround, but still no actual solution.

Please remember this happens on a totally new phone as well.