Install PA agent on node failure

Discussion in 'Plesk Automation Suggestions and Feedback' started by ViaHosting, Sep 16, 2015.

  1. ViaHosting

    ViaHosting Kilo Poster

    Messages:
    74
    I'm trying to add a IIS Node, but the task failed.
    I got the folowing log.
    "hosts" violates foreign key constraint "hosts_fk_1";

    Taking a look on sql query, I saw it's trying to ad the host with the proprietor_id = 2,
    but there is no account with id=2.






    Auth::Session::Impl::Impl] <=== EXIT [0.000161]
    Sep 17 00:06:10 ppa : DBG [0:2796:734:4 1:12983:f69ffb70 SharedNodeRegistrator]: [SharedNodeRegistrator_impl::WindowsNodeRegistrator_impl::validateAddHostToken] ===> ENTRY
    Sep 17 00:06:10 ppa : DBG [0:2796:734:4 1:12861:f46e1b70 Kernel]: STMT [Con: 15832, 0xf6874068] ' SELECT 1 FROM registrator_add_host_tokens WHERE host = ? AND token = ?'($0 = 'cs-win01', $1 = '08CCAA8A-5CE9-11E5-8000-06BB3583A5F1')
    Sep 17 00:06:10 ppa : DBG [0:2796:734:4 1:12983:f69ffb70 SharedNodeRegistrator]: [SharedNodeRegistrator_impl::WindowsNodeRegistrator_impl::validateAddHostToken] <=== EXIT [0.001165]
    Sep 17 00:06:10 ppa : DBG [0:2796:734:4 1:12870:f4bffb70 chief]: [Host_impl::getHostPlatformID] ===> ENTRY
    Sep 17 00:06:10 ppa : DBG [0:2796:734:4 1:12861:f63feb70 Kernel]: STMT [Con: 15832, 0xf6874068] ' SELECT platform_id FROM platforms WHERE arch = ? AND opsys = ? AND osrel = ?'($0 = 'x86_64', $1 = 'Win32', $2 = '6.3')
    Sep 17 00:06:10 ppa : DBG [0:2796:734:4 1:12870:f4bffb70 chief]: [Host_impl::getHostPlatformID] <=== EXIT [0.001574]
    Sep 17 00:06:10 ppa : DBG [0:2796:734:4 1:12870:f4bffb70 chief]: [Host_impl::addHost] ===> ENTRY
    Son '42749', timeout 0
    Sep 17 00:06:10 ppa : DBG [0:2796:734:4 1:12924:f62fdb70 AccountManagement]: [txn:42749 AccountManagement::AccountManager_impl::getAccountsByUserId] ===> ENTRY
    Sep 17 00:06:10 ppa : DBG [0:2796:734:4 1:12861:f57f2b70 Kernel]: STMT [Con: 15832, 0xf6874068 txn:42749] ' SELECT scope_id FROM users WHERE user_id = ?'($0 = 2)
    Sep 17 00:06:10 ppa : DBG [0:2796:734:4 1:12924:f62fdb70 AccountManagement]: [txn:42749 AccountManagement::AccountManager_impl::getAccountsByUserId] <=== EXIT [0.002533]
    Sep 17 00:06:10 ppa : DBG [0:2796:734:4 1:12861:f63feb70 Kernel]: STMT [Con: 15832, 0xf6874068 txn:42749] ' SELECT host_id, rt_instance_id, platform_id FROM hosts WHERE primary_name = ?'($0 = 'cs-win01')
    Sep 17 00:06:10 ppa : DBG [0:2796:734:4 1:12870:f4bffb70 chief]: [txn:42749 Resource_impl::getResource] ===> ENTRY
    Sep 17 00:06:10 ppa : DBG [0:2796:734:4 1:12861:f63feb70 Kernel]: STMT [Con: 15832, 0xf6874068 txn:42749] ' SELECT sr.rt_instance_id AS resource_id, sr.sub_id AS sub_id, s.owner_id AS account_id, s.name AS subscription_name, sr.rt_id AS rt_id, sr.sub_limit AS limit, sr.curr_usage AS usage, sr.own_usage AS own_usage, sr.last_update AS last_update, rc.name AS class_name, rt.restype_name AS resource_type_name, rt.description AS description, s.st_id AS st_id FROM subs_resources sr, subscriptions s, resource_types rt, resource_classes rc WHERE sr.rt_id = rt.rt_id AND rt.class_id = rc.class_id AND sr.sub_id = s.sub_id AND sr.rt_instance_id = ?'($0 = 52)
    Sep 17 00:06:10 ppa : DBG [0:2796:734:4 1:12870:f4bffb70 chief]: [txn:42749 Resource_impl::getResource] <=== EXIT [0.006628]
    Sep 17 00:06:10 ppa : DBG [0:2796:734:4 1:12861:f63feb70 Kernel]: STMT [Con: 15832, 0xf6874068 txn:42749] ' SELECT class_id AS rc_id, sc_id, name, partible, license_item, friendly_name AS display_name, mes_unit, mes_type FROM resource_classes WHERE name = ?'($0 = 'WinNodes')
    Sep 17 00:06:10 ppa : DBG [0:2796:734:4 1:12861:f63feb70 Kernel]: STMT [Con: 15832, 0xf6874068 txn:42749] ' SELECT htype FROM host_controls_rc WHERE rc_id = ?'($0 = 52)
    Sep 17 00:06:10 ppa : DBG [0:2796:734:4 1:12870:f4bffb70 chief]: [txn:42749 Host_impl::getHostPlatformByID] ===> ENTRY
    Sep 17 00:06:10 ppa : DBG [0:2796:734:4 1:12861:f63feb70 Kernel]: STMT [Con: 15832, 0xf6874068 txn:42749] ' SELECT arch, opsys, osrel FROM platforms WHERE platform_id= ?'($0 = 26)
    Sep 17 00:06:10 ppa : DBG [0:2796:734:4 1:12870:f4bffb70 chief]: [txn:42749 Host_impl::getHostPlatformByID] <=== EXIT [0.001989]
    Sep 17 00:06:10 ppa : DBG [0:2796:734:4 1:12861:f63feb70 Kernel]: STMT [Con: 15832, 0xf6874068 txn:42749] ' INSERT INTO hosts (hw_host_id, primary_name, platform_id, platform_desc, default_rootpath, proprietor_id, owner_id, rt_instance_id, htype, subscription_id, destination) VALUES ( ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ? )'($0 = NULL, $1 = 'cs-win01', $2 = 26, $3 = 'x86_64 Win32 6.3', $4 = 'C:\Program Files (x86)\SWsoft\PEM', $5 = 2, $6 = 1, $7 = 52, $8 = 'w', $9 = 1, $10 = 1)
    Sep 17 00:06:10 ppa : DBG [0:2796:734:4 1:12861:f63feb70 Kernel]: [txn:42749 DBS::checkSQLError] Diagnostic info about SQL error: sqlreturn=0 state=HY000, nativeCode=7, description=ERROR: insert or update on table "hosts" violates foreign key constraint "hosts_fk_1";
    Error while executing the query
    Sep 17 00:06:10 ppa : DBG [0:2796:734:4 1:12861:f63feb70 lib]: [txn:42749 execQuery] {module_id="db_service"; code="120"} Foreign key 'hosts_fk_1' violation while executing ' INSERT INTO hosts (hw_host_id, primary_name, platform_id, platform_desc, default_rootpath, proprietor_id, owner_id, rt_instance_id, htype, subscription_id, destination) VALUES ( ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ? )'.
    Sep 17 00:06:10 ppa : DBG [0:2796:734:4 1:12861:f63feb70 Kernel]: [txn:42749 DBS::Transaction_impl::rollback_impl] Rolling back transaction '42749'
    Sep 17 00:06:10 ppa : DBG [0:2796:734:4 1:12861:f63feb70 Kernel]: [txn:42749 DBS::DSNResourceCoordinator::rollback] ===> ENTRY
    Sep 17 00:06:10 ppa : DBG [0:2796:734:4 1:12861:f63feb70 Kernel]: [txn:42749 DBS::DSNResourceCoordinator::rollback] <=== EXIT [0.000427]
    Sep 17 00:06:10 ppa : DBG [0:2796:734:4 1:12861:f63feb70 lib]: [txn:42749 SimpleServantActivator::etherealize] ===> ENTRY
    Sep 17 00:06:10 ppa : DBG [0:2796:734:4 1:12861:f63feb70 lib]: [txn:42749 SimpleServantActivator::etherealize] <=== EXIT [0.000292]
    Sep 17 00:06:10 ppa : DBG [0:2796:734:4 1:12870:f4bffb70 chief]: [Host_impl::addHost] <=== EXIT (by exception) [0.028719]
    Sep 17 00:06:10 ppa : DBG [0:2796:734:4 1:12983:f69ffb70 SharedNodeRegistrator]: [SharedNodeRegistrator_impl::WindowsNodeRegistrator_impl::addHost] <=== EXIT (by exception) [0.033407]
    Sep 17 00:06:10 ppa : ERR [task:24226:12379 1:12983:f66ffb70 SharedNodeRegistrator]: [task:24226 command_exec] CommandContextError: Command caused an error. Command finished with non 0 return code
    Sep 17 00:06:10 ppa : DBG [task:24226:12379 1:12983:f66ffb70 lib]: [task:24226 command_exec] {module_id="WindowsNodeRegistrator"; code="5"} Failed to execute command 'PAgent.exe'. Check logs in 'c:\POA_Deploy' at host '10.107.200.144' for more details about the reasons of failure.
     
  2. Starl1ght

    Starl1ght Just a cat

    Messages:
    81
    This is clearly DB inconsistence. I'd recommend you to submit support ticket, since it's not possible to check this via forum.
     
  3. ViaHosting

    ViaHosting Kilo Poster

    Messages:
    74
    Yes, It was a DB problem.
    I had a missing account #2, that is created in installation, for internal usage.
     

Share This Page