Author Topic: AccountMgr - corrupt DB maybe?  (Read 6922 times)

Dariusz Piatkowski

  • Hero Member
  • *****
  • Posts: 1317
  • Karma: +26/-0
    • View Profile
AccountMgr - corrupt DB maybe?
« on: March 11, 2021, 06:03:08 pm »
Hi Everyone!

I've been using Mario Sebastiani's AccountManager application for a number of years now. Pretty simple way to track various ID/PASS combinations.

However, sometime last week my machine locked up as I was testing some other software, it was a hard lock so only power OFF/ON worked. Re-boot brought things back up (did have a clean CHKDSK run) so it all seemed fine. However attempting to start AccoungManager today produces a DrRexx error, end result being: I cannot get to any of my ID/PASS combos.

Since my drive backups are nightly and I didn't catch this one in time, the previous version of the DB was overwritten with what I presume to be the corrupted one.

I do not know this for a fact, but I'm guessing this is where the problem lies.

The error I'm seeing is:
Code: [Select]
SYNTAX ERROR: Bad arithmetic conversion in:
SAY "  do i ="   do i

I am not familiar with DrRexx, however it would appear that it has the ability to query up the program runtime environment, so I'm wondering if anyone can shed some light on how to do so?

In parallel to this, does anyone know what DB format AccountManager uses? I reached out to Mario but some 20 yrs have passed since he released this app and all links to his emails and website are dead.

There is a text export of the iDB nformation that's about a quarter of the year old, not ideal but heck I'll take it!!! So not all is lost, ideally though I'd rather try to figure out where things are dying now to recover as much info as possible.

Thanks!

ivan

  • Hero Member
  • *****
  • Posts: 1558
  • Karma: +17/-0
    • View Profile
Re: AccountMgr - corrupt DB maybe?
« Reply #1 on: March 11, 2021, 06:50:33 pm »
Hi Dariusz,

No help with your problem but you might be able to stop such problems in the future.  You do nightly backups but I assume you don't have a weekly backup of those nightly backups.  I have two NAS boxes for backups, the first has the nightly backup and the second backups the first once a week - I learnt to do that the hard way when some duff data (a bad drive sector) overwrote the good backup data.  In fact I even go further and backup the second NAS to a DVD RW once a month.

Dave Yeo

  • Hero Member
  • *****
  • Posts: 4787
  • Karma: +99/-1
    • View Profile
Re: AccountMgr - corrupt DB maybe?
« Reply #2 on: March 12, 2021, 01:08:37 am »
Yes, multiple backups of stuff that changes a lot are important.
Try using file to see if it can figure out the database. eg
Code: [Select]
>file cert8.db
cert8.db: Berkeley DB 1.85 (Hash, version 2, native byte-order)

>file cookies.sqlite
cookies.sqlite: SQLite 3.x database, user version 7, last written using SQLite version 3009001

Dariusz Piatkowski

  • Hero Member
  • *****
  • Posts: 1317
  • Karma: +26/-0
    • View Profile
Re: AccountMgr - corrupt DB maybe?
« Reply #3 on: March 12, 2021, 02:10:43 am »
Hi Dave!

...Try using file to see if it can figure out the database. eg
Code: [Select]
>file cert8.db
cert8.db: Berkeley DB 1.85 (Hash, version 2, native byte-order)

>file cookies.sqlite
cookies.sqlite: SQLite 3.x database, user version 7, last written using SQLite version 3009001

Super!!!

So 'file' claims this is actually an OS/2 INI file. Sure enough, attempting to open using 'INI Editor 1.2.0' produces the very same DrRexx error.

This actually may be a good news after all, because that implies I could try reading this INI file structure through regular REXX, even if that means getting at it record at a time.

Before I start diving into how to do so, are there any other INI editors I should look at first?

I have:

1) INI Editor 1.1.0 and 1.2.0 (1.1.0 fails altogether)
2) mINI, shows the following error:
Code: [Select]
ERROR: Problem with INI file.
Probably lost, on removable media, corrupter, empty or no OS/2- or Windows-INI?

Pete

  • Hero Member
  • *****
  • Posts: 1281
  • Karma: +9/-0
    • View Profile
Re: AccountMgr - corrupt DB maybe?
« Reply #4 on: March 12, 2021, 02:59:21 am »
Hi Dariusz

Sounds like a corrupt ini file if an INI file editor cannot open it. Possibly your best course of action is to find a backup copy...

Maybe GenINI will be able to read the file and output a human readable version which you can correct - https://hobbes.nmsu.edu/?dir=%2F&stype=all&sort=type_name&search=genini


Is that INI Editor v1.1.0 or v1.10?


Regards

Pete

Andreas Schnellbacher

  • Hero Member
  • *****
  • Posts: 827
  • Karma: +14/-0
    • View Profile
Re: AccountMgr - corrupt DB maybe?
« Reply #5 on: March 12, 2021, 07:24:53 am »
BTW: I prefer the following apps to read and edit OS/2 .ini files:
  • Initor 2.5
  • ini.exe of FM2Tools, part of FM/2
  • OS/2 Registry Editor (\OS2SYSTEM\REGEDIT2.EXE)

Dariusz Piatkowski

  • Hero Member
  • *****
  • Posts: 1317
  • Karma: +26/-0
    • View Profile
Re: AccountMgr - corrupt DB maybe?
« Reply #6 on: March 12, 2021, 02:40:27 pm »
Hi Pete,

...Maybe GenINI will be able to read the file and output a human readable version which you can correct - https://hobbes.nmsu.edu/?dir=%2F&stype=all&sort=type_name&search=genini

Is that INI Editor v1.1.0 or v1.10?

GenINI failed to read, which makes me think that maybe the header information is corrupt. GenINI does have a pretty good help file, enough to point me to some on-line articles, so thanks for that!

Ahh, you are right, INI Eidtor 1.10, sorry.

Dariusz Piatkowski

  • Hero Member
  • *****
  • Posts: 1317
  • Karma: +26/-0
    • View Profile
Re: AccountMgr - corrupt DB maybe?
« Reply #7 on: March 12, 2021, 02:49:17 pm »
Hi Andreas,

BTW: I prefer the following apps to read and edit OS/2 .ini files:
  • Initor 2.5
  • ini.exe of FM2Tools, part of FM/2
  • OS/2 Registry Editor (\OS2SYSTEM\REGEDIT2.EXE)

Initor is a nice app, good call. It wasn't able to open the AccountManager DB, but that's fine as it does look like a fairly robust INI editor otherwise!

No luck with either of the remaining two. Thanks, appreciate the suggestions.

Dariusz Piatkowski

  • Hero Member
  • *****
  • Posts: 1317
  • Karma: +26/-0
    • View Profile
Re: AccountMgr - corrupt DB maybe?
« Reply #8 on: March 15, 2021, 04:14:56 am »
Alright you guys...quick update, I pulled a little REXX script together from the REXX 'The OS/2 Procedures Language 2/REXX ' INF file and specifically used the SysIni function and the sample code shown.

This allowed me to actually pull the keys and the values from the corrupted AccountManager database file.

Once I was able to do that I added a single REXX line into that script to write the KEY and the VALUE out to a new INI file. That file AccountManager was able to successfully open, so I'm back in "business".

Yeah...it's time to move on to something a little more up-to-date for sure!  ;)

Thanks again, appreciate everyone's feedback!

Code: [Select]
/* REXX script */

/****  Type all INI file information to the screen  *****/
call rxfuncadd sysloadfuncs, rexxutil, sysloadfuncs
call sysloadfuncs

   call SysIni "g:\apps\misc\accountmgr\database.INI", 'All:', 'Apps.'

   if Result \= 'ERROR:' then
     do i = 1 to Apps.0
       call SysIni 'g:\apps\misc\accountmgr\database.INI', Apps.i, 'All:', 'Keys'

       say 'APPLICATION #' i ' => ' left(Apps.i, 40)
       say '-------------'

       if Result \= 'ERROR:' then
        do j=1 to Keys.0
          val = SysIni('g:\apps\misc\accountmgr\database.INI', Apps.i, Keys.j)
          say 'KEY # ' j ' => ' left(Keys.j, 10) 'Len=x' Left(d2x(length(val)),8)

  Result = SysIni('g:\apps\misc\accountmgr\database_NEW.INI', Apps.i, Keys.j, val)

        end
       say ''
     end