Skip to content
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

Help! Linux - changed user name - TabFern extension disappeared! (other extensions unaffected) #170

Closed
philiprhoades opened this issue Mar 15, 2019 · 20 comments
Assignees
Labels
support User requests for support, as opposed to features

Comments

@philiprhoades
Copy link

Chris,

After a catastrophic hard disk head crash in my server at the end of Oct last year and because of carelessness / stupidity in keeping backups, I have been spending some months recovering most of the server data. Today, as a near final reorganisation of my workstation and server, I renamed my user login from "phil" to "phr" (so the user name didn't conflict with workstation name). This all went relatively smoothly but when I finally got around to starting Vivaldi again - all my extensions were still there and working - except for TabFern! :(

I know that reloading the unpacked extension will create a new setup so before I do that I want to see if I can find my saved sessions somehow - because of what has been going on, I haven't done an export since last Nov . .

From the Extensions dir I did:

ls -al */ | grep 0.2

but that doesn't find anything with version number 0.2.0, then I tried:

find . -name manifest.json -exec grep short_name {} ; -print

but that doesn't find anything that looks like tabfern.

I am about to go looking the DB dirs to see if I can find anything there but any help at this stage would be greatly appreciated!

Regards,
Phil.

@cxw42
Copy link
Owner

cxw42 commented Mar 15, 2019

Phil, sorry to hear it! I'll take a look and see where my Vivaldi installation stores extension data. My recollection is that it's in a sqlite db in the profile dir.

Does /home/phil still exist separate from /home/phr? Could you rename your account back and then save a backup? Edit or manually re-create the path where it used to be, load it from there, and see if it gets the same id.

Is TF the only extension you run unpacked? If not, what did other extensions do?

@philiprhoades
Copy link
Author

There doesn't seem to be a [Pp]rofile dir on my Vivaldi setup for the Default user.
/home/phil does still exist but it is basically empty now - I'm pretty sure renaming back the other way won't help - the actual extension dir itself seems to have disappeared . . I couldn't find any DB dir corresponding to TF but that might still exist but I expect if the extension code got deleted, the data / DB probably got zapped too . .
I think that is the answer - the only unpacked extension got zapped somehow . .

@philiprhoades
Copy link
Author

[phr@phil databases]$ sqlite3 ./Databases.db
SQLite version 3.26.0 2018-12-01 12:34:55
Enter ".help" for usage hints.
sqlite> .tables
Databases meta
sqlite> select * from Databases ;
13|chrome-extension_eggkanocgddhmamlbiijnphhppkpkmkl_0|backupdb|Tree Backup|20971520
14|chrome-extension_hdokiejnpimakedhajhdlcegeplioahd_0|lp|LastPass Local Database|200000
15|https_www.tradingview.com_0|sqlite_evercookie|evercookie|1048576
16|chrome-extension_edacconmaakjimmfgnblocblbcdcpbko_0|SB|Session Buddy|5242880
17|https_www.ebay.com.au_0|ebay|ebay database storage|1048576
18|https_coingape.com_0|sqlite_evercookie|evercookie|1048576
19|https_www.newsbtc.com_0|sqlite_evercookie|evercookie|1048576
20|https_mail.google.com_0|OfflineMailUsers||4096
21|https_www.organifishop.com_0|judb|session|1048576
22|https_www.congress.gov_0|testdb|html5 test db|200000
23|https_read.amazon.com_0|K4W|Kindle Cloud Reader|5000000
24|https_read.amazon.com_0|K4Wbooks|Kindle Cloud Reader Books|50000000
25|http_incrediblepbx.com_0|testdb|html5 test db|200000
26|https_translate.google.com_0|||0
27|https_translate.google.com_0|GoogleTranslateMobileWebApp|Google Translate Mobile Web App|500000

@cxw42
Copy link
Owner

cxw42 commented Mar 15, 2019

Phil, I agree it doesn't sound promising :( . I did check, with the following results/procedure.

  1. Exit Vivaldi, and make sure nodejs and npm are installed and working.

  2. Put the following script in ~/foo/extract.js:

     // This code by cxw42 2019, CC-BY-SA 3.0.  Thanks to the sample at
     // https://github.com/Level/levelup/blob/master/README.md and to
     // https://superuser.com/a/1088579/269989 by
     // https://superuser.com/users/219095/daniel-b
    
     var levelup = require('levelup')
     var leveldown = require('leveldown')
    
     // 1) Create our store
     var db = levelup(leveldown('./data'))
    
     // 3) Fetch by key
     db.get('tabfern-data', function (err, value) {
         if (err) return console.log('Ooops!', err) // likely the key was not found
    
         // Ta da!
         console.log(value.toString('utf8')) // since value is a Buffer
     })
    
  3. Run the following from ~/foo

     npm init
     (...accept all defaults...)
     npm install levelup leveldown
    
  4. Find the TF data. Vivaldi TF data is in /Local Extension Settings (Super User Q). I found mine using ag, but any recursive grep will do:

     cd User\ Data/Default/Local\ Extension\ Settings
     ag -lu tabfern
    

It output several lines since I have multiple TF installations.

  1. For each directory that includes a TF file, one at a time:

    • Copy the contents of that dir into ~/foo/data. After this step, ~/foo/data will have files in it called LOG, CURRENT, *.ldb, ... .
    • Run node extract.js > some-appropriate-filename.tabfern

That will give you the TF backup file, just as if you had made a backup from within TF.

Good luck! I am going to close this issue for now, but please feel free to reply or re-open if you need further assistance.

@cxw42 cxw42 closed this as completed Mar 15, 2019
@cxw42 cxw42 self-assigned this Mar 15, 2019
@cxw42 cxw42 added the support User requests for support, as opposed to features label Mar 15, 2019
@philiprhoades
Copy link
Author

philiprhoades commented Mar 15, 2019

Chris,

I get:

[phr@phil foo]$ node extract.js > lgbdonjnanhdbfoglklccfkgoeklfghl.tabfern
internal/modules/cjs/loader.js:583
throw err;
^
Error: Cannot find module 'levelup'
at Function.Module._resolveFilename (internal/modules/cjs/loader.js:581:15)
at Function.Module._load (internal/modules/cjs/loader.js:507:25)
at Module.require (internal/modules/cjs/loader.js:637:17)
at require (internal/modules/cjs/helpers.js:22:18)
at Object. (/home/phr/foo/extract.js:6:16)
at Module._compile (internal/modules/cjs/loader.js:689:30)
at Object.Module._extensions..js (internal/modules/cjs/loader.js:700:10)
at Module.load (internal/modules/cjs/loader.js:599:32)
at tryModuleLoad (internal/modules/cjs/loader.js:538:12)
at Function.Module._load (internal/modules/cjs/loader.js:530:3)

for both dirs that I find.

Thanks,
Phil.

@cxw42
Copy link
Owner

cxw42 commented Mar 15, 2019

Phil, for what it's worth, I've just changed the switchover branch so it is back to opening all tabs or none. That is so I can push out other changes that have been blocked on issue 35. Then I will put that feature back in.

Would you be willing to live with that restriction for a few days, try out the latest switchover on Vivaldi, and let me know if you see any bugs? Attached if you're willing. Thanks!
webstore-0.2.0-pre.5.zip

@cxw42
Copy link
Owner

cxw42 commented Mar 15, 2019

Phil, re. "levelup", did you do npm install levelup leveldown from step 2 in #170 (comment) ?

@philiprhoades
Copy link
Author

I did miss a step . . now I get in the *.tabfern outputs:

Ooops! NotFoundError: Key not found in database [tabfern-data]
at /home/phr/foo/node_modules/levelup/lib/levelup.js:160:15

I'm happy to try the new version but that will not delete / overwrite any potential data that might still be there for pre.4 ?

@cxw42
Copy link
Owner

cxw42 commented Mar 15, 2019

OK - unfortunately, the "key not found" means TF never saved tabs into that DB. :( You can use the sample at https://github.com/Level/levelup#dbcreatereadstreamoptions or open the DB files in an editor and see if you find any data anywhere else, but that's the only place I know of to look (and I did test it on my own Vivaldi installation successfully).

I still think manually creating /home/phil/.../tfswitch/public and loading that is worth a try. This SO answer says that the ID only depends on the absolute path to the extension. That also answers your other question - loading unpacked from /home/phr/... should give you a different ID from the old ID, so shouldn't overwrite anything (and you can back up the whole profile dir before installing it, if you're really concerned.)

I've got to drop off - best of luck!

@philiprhoades
Copy link
Author

philiprhoades commented Mar 16, 2019

I am using FF for these posts for the time being:

OK, now it is getting weirder . . this morning I logged out as phr, and restored .config/vivaldi from the five-week old backup I found to the original "phil" user dir (UID 1000) instead of phr (UID 1002) . I logged in as phil and started vivaldi and except for being asked for a new keyring (the phil dir was mostly empty), it worked fine - BUT - there was no TF icon there either! That should just not be possible - Vivaldi and TF were working fine with user phil 5 weeks ago . . I'm not sure what is going on . . it feels like some virus is automatically purging any occurrence of TF as it appears . .

@philiprhoades
Copy link
Author

I am not sure what you mean "..tfswitch/public" - I do not have a dir "tfswitch" anywhere . .

Does "As such, it should ONLY depend on the absolute filesystem path to the extension folder." mean where I extracted your original zip file (/~/src/javascript/TabFern)? - there is nothing in there but the original code - no sql DBs. I can brute force search every sql DB in the original 5 week old backup in .config/vivladi but is this note saying it could be outside that dir?

@philiprhoades
Copy link
Author

philiprhoades commented Mar 16, 2019

Getting weirder and weirder:

For phr I made a copy of .config/vivaldi and reinstalled 0.2.0.pre4 and then did a dir comparison to see what was different with files between the two dirs - I didn't really make any progress with that so I thought of creating a new user "tst" and installing from scratch - but I had a problem with getting TF to work (see below) - however when I logged out as tst and logged back in as phr and started vivaldi - the TF icon was gone again! I have no idea what is happening . .

Re the tst user when I try to start TF I get an error:

////////////////////////////////////////////////////////////////////////// }}}1
// Miscellaneous functions // {{{1

/// Shortcut for i18n. Call _T("name") to pull the localized "name".
var _T = chrome.i18n.getMessage;

Line 297: Uncaught TypeError: Cannot read property 'getMessage' of undefined

@philiprhoades
Copy link
Author

I am continuing to experiment with the new user "tst' so I can "rm -fr .config" every time. Since there is the issue with .4 and .5 on Vivaldi I have just installed .5 on chrome and used inotifywait to watch what happens to files when I make changes to stuff in TF windows and then exit - as far as I can tell NO TF DBs are being changed (and they don't exist as far as I can tell so far) - only log and cache files. Is it possible that TF data is only ever being saved in the cache files and not in a DB at all?

I will keep testing . .

@philiprhoades
Copy link
Author

It looks like Vivaldi might be a problem so I have switched testing to Chrome FTTB - I logged in again as phr, created a new Profile, and used:

inotifywait -r -q -m -e close_write,moved_to,create . > ./config_chrome_profile21.inotify

in the new profile dir while I installed 0.5 and saved a couple of windows and tabs. None of the files int the output seems to be a DB but chrome+TF continue to work fine:

[phr@phil Profile 21]$ more ./config_chrome_profile21.inotify
./ CREATE .com.google.Chrome.P456DD
./ CLOSE_WRITE,CLOSE .com.google.Chrome.P456DD
./ CLOSE_WRITE,CLOSE .com.google.Chrome.P456DD
./ MOVED_TO Preferences
./ CREATE Extension Cookies
./ CREATE Extension Cookies-journal
./ CLOSE_WRITE,CLOSE Extension Cookies-journal
./ CLOSE_WRITE,CLOSE Extension Cookies-journal
./Local Extension Settings/ CREATE,ISDIR paicjpaedoabmihinafmkjdaneliidpg
./Local Extension Settings/paicjpaedoabmihinafmkjdaneliidpg/ CREATE LOG
./Local Extension Settings/paicjpaedoabmihinafmkjdaneliidpg/ CREATE LOCK
./Local Extension Settings/paicjpaedoabmihinafmkjdaneliidpg/ CREATE MANIFEST-000001
./Local Extension Settings/paicjpaedoabmihinafmkjdaneliidpg/ CLOSE_WRITE,CLOSE MANIFEST-000001
./Local Extension Settings/paicjpaedoabmihinafmkjdaneliidpg/ CREATE 000001.dbtmp
./Local Extension Settings/paicjpaedoabmihinafmkjdaneliidpg/ CLOSE_WRITE,CLOSE 000001.dbtmp
./Local Extension Settings/paicjpaedoabmihinafmkjdaneliidpg/ MOVED_TO CURRENT
./Local Extension Settings/paicjpaedoabmihinafmkjdaneliidpg/ CREATE 000003.log
./Service Worker/ScriptCache/ CLOSE_WRITE,CLOSE 2cc80dabc69f58b6_0
./Service Worker/ScriptCache/ CLOSE_WRITE,CLOSE 2cc80dabc69f58b6_1
./Service Worker/CacheStorage/28da9c56fde4021055a681112c092453f74d8dd8/1661e6d5-f677-48b9-a96e-51a1672648b4/index-dir/ CREATE temp-index
./Service Worker/CacheStorage/28da9c56fde4021055a681112c092453f74d8dd8/1661e6d5-f677-48b9-a96e-51a1672648b4/index-dir/ CLOSE_WRITE,CLOSE temp-index
./Service Worker/CacheStorage/28da9c56fde4021055a681112c092453f74d8dd8/1661e6d5-f677-48b9-a96e-51a1672648b4/index-dir/ MOVED_TO the-real-index
./Service Worker/CacheStorage/28da9c56fde4021055a681112c092453f74d8dd8/1661e6d5-f677-48b9-a96e-51a1672648b4/ CREATE c3d5cfb6a1cf033d_0
./Service Worker/CacheStorage/28da9c56fde4021055a681112c092453f74d8dd8/1661e6d5-f677-48b9-a96e-51a1672648b4/ CLOSE_WRITE,CLOSE c3d5cfb6a1cf033d_0
./ CLOSE_WRITE,CLOSE Origin Bound Certs-journal
./Service Worker/CacheStorage/28da9c56fde4021055a681112c092453f74d8dd8/ CREATE index.txt.tmp
./Service Worker/CacheStorage/28da9c56fde4021055a681112c092453f74d8dd8/ CLOSE_WRITE,CLOSE index.txt.tmp
./Service Worker/CacheStorage/28da9c56fde4021055a681112c092453f74d8dd8/ MOVED_TO index.txt
./ CREATE .com.google.Chrome.eeOLET
./ CLOSE_WRITE,CLOSE .com.google.Chrome.eeOLET
./ CLOSE_WRITE,CLOSE .com.google.Chrome.eeOLET
./ MOVED_TO Preferences
./Service Worker/ScriptCache/index-dir/ CREATE temp-index
./Service Worker/ScriptCache/index-dir/ CLOSE_WRITE,CLOSE temp-index
./Service Worker/ScriptCache/index-dir/ MOVED_TO the-real-index
./Service Worker/CacheStorage/28da9c56fde4021055a681112c092453f74d8dd8/1661e6d5-f677-48b9-a96e-51a1672648b4/index-dir/ CREATE temp-index
./Service Worker/CacheStorage/28da9c56fde4021055a681112c092453f74d8dd8/1661e6d5-f677-48b9-a96e-51a1672648b4/index-dir/ CLOSE_WRITE,CLOSE temp-index
./Service Worker/CacheStorage/28da9c56fde4021055a681112c092453f74d8dd8/1661e6d5-f677-48b9-a96e-51a1672648b4/index-dir/ MOVED_TO the-real-index
./ CLOSE_WRITE,CLOSE Cookies-journal
./ CLOSE_WRITE,CLOSE QuotaManager-journal
./ CLOSE_WRITE,CLOSE Network Action Predictor-journal
./ CLOSE_WRITE,CLOSE Network Action Predictor-journal

@cxw42
Copy link
Owner

cxw42 commented Mar 16, 2019

Would you be willing to move this discussion to Gitter, by any chance? I prefer its interface for extended conversation. Let me know either way.

Your last message agrees with what I understand to be normal operation. Looks like paicjpaedoabmihinafmkjdaneliidpg is the extension id for TF. Chrome/Vivaldi manages the storage for all extensions, including TF. It is creating LevelDB files LOG, MANIFEST, ... . That agrees with your report about saving tabs. You should be able to extract-tf on the directory containing those files and see your saved tabs.

I'll investigate the i18n issue on Vivaldi. That is a Chromium API, so it should work.

Re. #170 (comment) - yes, the path where you unzipped TF. However, it's absolute, so no ~ . If you create /home/phil/src/javascript/TabFern and load from there, you might get the same extension ID. You can do that even if no user phil exists!

Edit In your backup from five weeks ago, do you have a Local Extension Settings directory? If so, have you tried extract-tf on each of its subdirectories? The data should be there. TF doesn't store anything in its code directory (where it loads from).

@philiprhoades
Copy link
Author

I have only used Gitter a couple of times but sure - anything that helps the process - do you want to start the conversation there and invite me to it or something?

@philiprhoades
Copy link
Author

I have only used Gitter a couple of times but sure - anything that helps the process - do you want to start the conversation there and invite me to it or something? - OK, got started with replies for the above. . continue there - I need to eat - back there soon.

@cxw42
Copy link
Owner

cxw42 commented Mar 27, 2019

@philiprhoades Would you please join me on #171? Thanks!

@cxw42
Copy link
Owner

cxw42 commented Apr 8, 2019

@philiprhoades Not really related :) , but attached is a zip of the latest, but with opening one tab at a time put back in. If you would be willing to switch to that version, I'd appreciate it - that way any bugs you find will be easier to fix in the current codebase. Thanks for considering this request!

webstore-0.2.1-pre.1.zip

@philiprhoades
Copy link
Author

Chris,

Seems to work just fine - I opened four windows with 1-4 tabs each and a fifth window with all its tabs (4).

I backed up the data just in case before trying the new version but found it installed into a new extension anyway so now I have both versions running happily. I will let you know if any issue shows up after closing all windows and starting again but would be surprised if that showed some sort of edge case . .

Thanks!
Phil.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
support User requests for support, as opposed to features
Projects
None yet
Development

No branches or pull requests

2 participants