This discussion has been locked.
You can no longer post new replies to this discussion. If you have a question you can start a new discussion

After update to 7.3 not getting daily executive report

/usr/local/bin # report_render.plx --type daily --sendmail
------
product: ASG | Astaro Security Gateway Software
running get_summary
DBD:[[:P]]g::st execute failed: ERROR: invalid page header in block 4356 of relation "accounting"
DBD:[[:P]]g::st execute failed: ERROR: invalid page header in block 4356 of relation "accounting"

/var/log/system.log
 
2008:09:04-09:40:20 (none) postgres[13697]: [3-1] LOG:  unexpected EOF on client connection
2008:09:04-09:40:21 (none) ulogd[2983]: input key `flow.start.sec' already has source
2008:09:04-09:40:21 (none) ulogd[2983]: stack_fsm_timer_cb: error
2008:09:04-09:40:27 (none) postgres[13737]: [3-1] ERROR:  invalid page header in block 4358 of relation "accounting"
2008:09:04-09:40:27 (none) postgres[13737]: [3-2] STATEMENT:  INSERT INTO public.accounting
2008:09:04-09:40:27 (none) postgres[13737]: [3-3]  (ip_saddr,ip_daddr,ip_protocol,l4_dport,raw_in_pktlen,raw_in_pktcount,raw_out_pktlen,raw_out_pktcount,flow_start_day,flow_start
2008:09:04-09:40:27 (none) postgres[13737]: [3-4] _sec,flow_duration) VALUES ($1,$2,$3,$4,$5,$6,$7,$8,$9,$10,$11);
2008:09:04-09:40:27 (none) ulogd[2983]: pg1: ERROR:  invalid page header in block 4358 of relation "accounting"
2008:09:04-09:40:27 (none) ulogd[2983]: pg1: commit failed
2008:09:04-09:40:32 (none) ulogd[2983]: input key `flow.start.sec' already has source
2008:09:04-09:40:32 (none) ulogd[2983]: stack_fsm_timer_cb: error


This thread was automatically locked due to age.
Parents
  • Hi AndreyS, 

    we have seen some rare database corruption of the reporting database and tried to make it more robust with the 7.301 up2date, which has been released earliert today.

    Can you please install that and check weather it fixes the problem?

    thanks
    Gert
Reply
  • Hi AndreyS, 

    we have seen some rare database corruption of the reporting database and tried to make it more robust with the 7.301 up2date, which has been released earliert today.

    Can you please install that and check weather it fixes the problem?

    thanks
    Gert
Children
  • after update to 7.301 and restart in /var/log/system.log
    2008:09:05-09:32:01 (none) /usr/sbin/cron[6013]: (root) CMD (  nice -n19 /usr/local/bin/gen_inline_reporting_data.plx)
    2008:09:05-09:32:04 (none) postgres[6018]: [3-1] ERROR:  invalid page header in block 1 of relation "imp2p"
    2008:09:05-09:32:04 (none) postgres[6018]: [3-2] STATEMENT:  SELECT int2ip(srcip) as srcip,transform_common(CAST(sum(count) AS BIGINT)) as sum_pac_str,sum(count) as
    2008:09:05-09:32:04 (none) postgres[6018]: [3-3]  sum_pac_int,transform_common(count(DISTINCT(protocol))) as cnt_proto_str,count(DISTINCT(protocol)) as
    2008:09:05-09:32:04 (none) postgres[6018]: [3-4]  cnt_proto_int,transform_common(count(DISTINCT(srcip))) as cnt_srcip_str,count(DISTINCT(srcip)) as cnt_srcip_int FROM imp2p_data
    2008:09:05-09:32:04 (none) postgres[6018]: [3-5]  WHERE dayabs = 733290 AND type LIKE 'im' GROUP BY srcip ORDER BY sum_pac_int DESC
    2008:09:05-09:32:04 (none) postgres[6018]: [4-1] ERROR:  invalid page header in block 1 of relation "imp2p"
    2008:09:05-09:32:04 (none) postgres[6018]: [4-2] STATEMENT:  SELECT protocol,transform_common(CAST(sum(count) AS BIGINT)) as sum_pac_str,sum(count) as
    2008:09:05-09:32:04 (none) postgres[6018]: [4-3]  sum_pac_int,transform_common(count(DISTINCT(dstip))) as cnt_dstip_str,count(DISTINCT(dstip)) as
    2008:09:05-09:32:04 (none) postgres[6018]: [4-4]  cnt_dstip_int,transform_common(count(DISTINCT(srcip))) as cnt_srcip_str,count(DISTINCT(srcip)) as
    2008:09:05-09:32:04 (none) postgres[6018]: [4-5]  cnt_srcip_int,transform_common(count(DISTINCT(protocol))) as cnt_proto_str,count(DISTINCT(protocol)) as cnt_proto_int FROM
    2008:09:05-09:32:04 (none) postgres[6018]: [4-6]  imp2p_data WHERE dayabs = 733290 AND type LIKE 'im' GROUP BY protocol ORDER BY sum_pac_int DESC
    2008:09:05-09:32:04 (none) postgres[6018]: [5-1] ERROR:  invalid page header in block 1 of relation "imp2p"
    2008:09:05-09:32:04 (none) postgres[6018]: [5-2] STATEMENT:  SELECT int2ip(srcip) as srcip,transform_common(CAST(sum(count) AS BIGINT)) as sum_pac_str,sum(count) as
    2008:09:05-09:32:04 (none) postgres[6018]: [5-3]  sum_pac_int,transform_common(count(DISTINCT(protocol))) as cnt_proto_str,count(DISTINCT(protocol)) as
    2008:09:05-09:32:04 (none) postgres[6018]: [5-4]  cnt_proto_int,transform_common(count(DISTINCT(srcip))) as cnt_srcip_str,count(DISTINCT(srcip)) as cnt_srcip_int FROM imp2p_data
    2008:09:05-09:32:04 (none) postgres[6018]: [5-5]  WHERE dayabs = 733290 AND type LIKE 'p2p' GROUP BY srcip ORDER BY sum_pac_int DESC
    2008:09:05-09:32:04 (none) postgres[6018]: [6-1] ERROR:  invalid page header in block 1 of relation "imp2p"
    2008:09:05-09:32:04 (none) postgres[6018]: [6-2] STATEMENT:  SELECT protocol,transform_common(CAST(sum(count) AS BIGINT)) as sum_pac_str,sum(count) as
    2008:09:05-09:32:04 (none) postgres[6018]: [6-3]  sum_pac_int,transform_common(count(DISTINCT(dstip))) as cnt_dstip_str,count(DISTINCT(dstip)) as
    2008:09:05-09:32:04 (none) postgres[6018]: [6-4]  cnt_dstip_int,transform_common(count(DISTINCT(srcip))) as cnt_srcip_str,count(DISTINCT(srcip)) as
    2008:09:05-09:32:04 (none) postgres[6018]: [6-5]  cnt_srcip_int,transform_common(count(DISTINCT(protocol))) as cnt_proto_str,count(DISTINCT(protocol)) as cnt_proto_int FROM
    2008:09:05-09:32:04 (none) postgres[6018]: [6-6]  imp2p_data WHERE dayabs = 733290 AND type LIKE 'p2p' GROUP BY protocol ORDER BY sum_pac_int DESC

    if running /usr/local/bin/report_render.plx --type daily --sendmail in /var/log/system.log

    2008:09:05-09:42:32 (none) postgres[6938]: [3-1] ERROR:  invalid page header in block 4358 of relation "accounting"
    2008:09:05-09:42:32 (none) postgres[6938]: [3-2] STATEMENT:  INSERT INTO public.accounting
    2008:09:05-09:42:32 (none) postgres[6938]: [3-3]  (ip_saddr,ip_daddr,ip_protocol,l4_dport,raw_in_pktlen,raw_in_pktcount,raw_out_pktlen,raw_out_pktcount,flow_start_day,flow_start
    2008:09:05-09:42:32 (none) postgres[6938]: [3-4] _sec,flow_duration) VALUES ($1,$2,$3,$4,$5,$6,$7,$8,$9,$10,$11);
    2008:09:05-09:42:32 (none) ulogd[3000]: pg1: ERROR:  invalid page header in block 4358 of relation "accounting"
    2008:09:05-09:42:32 (none) ulogd[3000]: pg1: commit failed
    2008:09:05-09:42:37 (none) ulogd[3000]: input key `flow.start.sec' already has source
    2008:09:05-09:42:37 (none) ulogd[3000]: stack_fsm_timer_cb: error
  • Hi,
    it sounds like you have some breakage in the at least two database tables. The least invasive thing is to drop the affect tables, and re-create them manually using /usr/share/postgresql/contrib/astaro_reporting_tables.sql as a guideline, but this is a bit tricky. The easy alternative, if you don't mind lost reporting data, is to just run /var/storage/pgsql/init/reporting_db_init.sh which will drop the reporting database and create everything from scratch. It's advisable to stop the reporting processes and the ulog daemon while operating on the databases, use /etc/init.d/ulog stop,  /etc/init.d/syslogng stop, do database operations, start services again.

    Cheers,
     andreas

    EDIT: do this as root, and become root by using "su -". Getting a login shell is imperative for the reporting_db_init.sh script to work properly!
  • Hello

    I have the same problem but if I execute the command (after stopped services):
    /var/storage/pgsql/init/reporting_db_init.sh
    I have the errors:

    psql: FATAL:  database "root" does not exist
    createdb: could not connect to database postgres: FATAL:  role "root" does not exist
    createlang: could not connect to database reporting: FATAL:  role "root" does not exist
    psql:/usr/share/postgresql/contrib/astaro_reporting_tables.sql:21: ERROR:  relation "accounting" already exists
    psql:/usr/share/postgresql/contrib/astaro_reporting_tables.sql:23: ERROR:  relation "accounting_dayidx" already exists
    *** other relations errors ***
    psql:/usr/share/postgresql/contrib/astaro_reporting_tables.sql:500: ERROR:  relation "websec_au_data" already exists
    psql:/usr/share/postgresql/contrib/astaro_reporting_tables.sql:525: ERROR:  relation "websec_bud_data" already exists
    psql: FATAL:  role "root" does not exist

    How can I resolve this problem?
    Thank you

  • I have the same problem but if I execute the command (after stopped services):
    /var/storage/pgsql/init/reporting_db_init.sh
    I have the errors:

    psql: FATAL:  database "root" does not exist
    createdb: could not connect to database postgres: FATAL:  role "root" does not exist
    createlang: could not connect to database reporting: FATAL:  role "root" does not exist
    psql:/usr/share/postgresql/contrib/astaro_reporting_tables.sql:21: ERROR:  relation "accounting" already exists
    psql:/usr/share/postgresql/contrib/astaro_reporting_tables.sql:23: ERROR:  relation "accounting_dayidx" already exists
    *** other relations errors ***
    psql:/usr/share/postgresql/contrib/astaro_reporting_tables.sql:500: ERROR:  relation "websec_au_data" already exists
    psql:/usr/share/postgresql/contrib/astaro_reporting_tables.sql:525: ERROR:  relation "websec_bud_data" already exists
    psql: FATAL:  role "root" does not exist

    How can I resolve this problem?
    Thank you


    It just came to my attention that you need a root shell with a complete environment for the reporting_db_init.sh script to work. So you need to become root using "su -" (the minus is important, it means you want to have a login shell) before using the above script.

    Cheers,
     andreas