Article ID: 121591, created on May 16, 2014, last review on Oct 26, 2016

  • Applies to:
  • Plesk Automation 11.1
  • Plesk Automation 11.5

Symptoms

Plesk Automation (PA) upgrade from 11.1 to 11.5 fails with error:

    ERROR OperationalError (['executing stmt with params:', 'INSERT INTO iptr_consumers VALUES (%s, 0, %s)', ((5, 'PPA_host_1'),), 'ERROR:  insert or update on table "iptr_consumers" violates foreign key constraint "iptr_consumers_fk1"\nDETAIL:  Key (iptr_id, port_frontnet)=(5, 0) is not present in table "iptr_translations_ports".\n'],) while executing atomic action 153021-PPA-144668-1-iptr-resync-consumers owner PleskIntegration
     ERROR poaupdater.uSysDB.OperationalError

    [LOGTEE]: ['executing stmt with params:', 'INSERT INTO iptr_consumers VALUES (%s, 0, %s)', ((5, 'PPA_host_1'),), 'ERROR:  insert or update on table "iptr_consumers" violates foreign key constraint "iptr_consumers_fk1"\nDETAIL:  Key (iptr_id, port_frontnet)=(5, 0) is not present in table "iptr_translations_ports".\n']

Cause

Inconsistent in plesk database. Absent record in iptr_translations_ports table.

Resolution

  1. Check iptr_translations table:

    plesk=> select iptr_id, ip_publicnet FROM iptr_translations;
     iptr_id |  ip_publicnet  |
    ---------+----------------+
           1 | 1.2.3.4        |
           2 | 1.2.3.5        |
           3 | 1.2.3.6        |
           5 | 1.2.3.7        |
    
  2. Compare iptr_id from iptr_translations with iptr_translations_ports table.

    plesk=> select * from iptr_translations_ports;
     iptr_id | port_publicnet | port_frontnet
    ---------+----------------+---------------
           1 |              0 |             0
           2 |              0 |             0
           3 |              0 |             0
    

    It should be the same ID and number of IDs should be equal.

  3. If you see that some ID is absent, add it as below:

    plesk=> begin;insert into iptr_translations_ports values (5,0,0);
    INSERT 1461117 1
    plesk=> commit;
    COMMIT
    
  4. Launch upgrade again.

Search Words

insert or update on table "iptr_consumers" violates foreign key constraint

Key (iptr_id, port_frontnet) is not present in table "iptr_translations_ports"

33a70544d00d562bbc5b17762c4ed2b3 e0aff7830fa22f92062ee4db78133079 caea8340e2d186a540518d08602aa065 c1ecc6010feff26cb42d1d14a7881dd6

Email subscription for changes to this article
Save as PDF