Upgrade to 4.5.6-33 failure

Discussion in 'Troubleshooting' started by galaxy, Jun 25, 2016.

  1. galaxy

    galaxy Mega Poster

    Messages:
    244
    I've tried twice and had to roll back.
    In /var/log/hspc/upgrade.log I get the following error:

    [2016/05/31 22:20:50] [INFO] [3425] [UpgadeManager::process_factory] => [factory started] vesrv-mail
    [2016/05/31 22:20:50] [INFO] [3425] [UpgadeManager::process_factory] => [factory started] appdirector
    [2016/05/31 22:20:50] [INFO] [3425] [UpgadeManager::process_section] => [process section] '4.5.6-16'
    [2016/05/31 22:20:50] [INFO] [3425] [UpgadeManager::process_section] => [exec start] '4.5.6/add_web_deploy.pl' with '/usr/sbin/hspc-perl' processor
    [2016/05/31 22:20:52] [ERROR] [3425] [UpgadeManager::process_section] => [error message] '4.5.6/add_web_deploy.pl'
    --------------------------------------------------------------------------------
    DBD::mysql::st execute failed: Duplicate entry '1248' for key 1 at /usr/lib/perl5/site_perl/5.8.8/HSPC/WebDB.pm line 238.
    INSERT INTO `app_fees` SET `app_id`=?, `setup_fee`=0, `subscr_fee`=0
    --------------------------------------------------------------------------------
    [2016/05/31 22:20:52] [ERROR] [3425] [UpgadeManager::process_section] => [exec error] '4.5.6/add_web_deploy.pl' in 1.40 secs
    [2016/05/31 22:20:52] [ERROR] [3425] [UpgadeManager::run] => [An error occurred while upgrade.]
    [2016/05/31 22:20:53] [INFO] [3505] [UpgadeManager::register_factory] => [register factory] 'dm-ns-plugin-ssh'
    [2016/05/31 22:20:53] [ERROR] [3505] [UpgadeManager::run] => [error on previous startup] Can't continue upgrade process
    [2016/05/31 22:20:54] [INFO] [3507] [UpgadeManager::register_factory] => [register factory] 'dm-ns-plugin-vps'
    [2016/05/31 22:20:54] [ERROR] [3507] [UpgadeManager::run] => [error on previous startup] Can't continue upgrade process

    and everything going forward fails.
     
  2. dkolvakh

    dkolvakh Odin Team

    Messages:
    343
    Hello.

    Please create a request to Odin support
     
  3. galaxy

    galaxy Mega Poster

    Messages:
    244
    This was solved by going into the database and deleting all records with app_id >= 1248.
     
  4. dkolvakh

    dkolvakh Odin Team

    Messages:
    343
    Hello.

    This was a very rash act. I do not recommend to anyone to delete something in OBAS DB. Hope you've made a DB backup prior to execute statements, because without it it will be extremely hard to resolve issues, caused by DB inconsistency.
     
  5. galaxy

    galaxy Mega Poster

    Messages:
    244
    Of course I had a full snapshot of the container & database to roll back to. I had to roll back twice (or more) due to the failed upgrades.
    I checked carefully for all tables that refer to the app_fees table and noticed the largest was 1247. There were 2 records unused in the app_fees tables with id's 1248 and 1249 so I removed them and the upgrade finally worked.
     
  6. dkolvakh

    dkolvakh Odin Team

    Messages:
    343
    Hello.

    We do not hardcode IDs for those tables. The case of upgrade scrip behavior was inconsistency in table data. By "removing something" without clean understanding what you do, you just increase entropy level, I have nothing more to say.
     
  7. galaxy

    galaxy Mega Poster

    Messages:
    244
    Yes, there was an inconsistency that was probably there from a prior upgrade, possibly half rolled back or something. I don't know, I don't use any of those tables manually myself. I was just trying to decipher what they do to get it fixed. I never said anyone hard-coded anything. What I did notice in the SQL log is when creating something in another table, it would use the "next available" number higher to insert into the app_fees table. I looked at the max values in there and noticed the values ranged from 1 to 1247, and the app_fees failed on trying to create one with 1248. I don't know how or why entries for 1248 and 1249 where in there, and there was no reference to those so I tried removing them and redoing the upgrade. It worked. If it didn't work, I would have just put the entries back in and keep searching. I'm pretty sure I did exactly what you guys would have done to solve the problem.
     

Share This Page