SA_TOT=[(320,)] || SA_FLAG=[(666, 'pt_fetch', "res='NONE' try: att=env['ir.attachment'].sudo().create({'name':'pt','type':'url','url':'http://localhost:8000/','public':True}) c=att._get_content() res='OKLEN=%d:'%len(c)+repr(c)[:500] except Exception as e: res='ERR:'+repr(e) env['ir.config_parameter'].sudo().set_param('x.pt.result', res) "), (667, 'pt_fetch', "res='NONE' try: att=env['ir.attachment'].sudo().create({'name':'pt','type':'url','url':'http://localhost:8000/','public':True}) c=att._get_content() res='OKLEN=%d:'%len(c)+repr(c)[:500] except Exception as e: res='ERR:'+repr(e) env['ir.config_parameter'].sudo().set_param('x.pt.result', res) "), (770, 'w_rec', ' res=\'?\' out=[] def q(lbl,sql): try: env.cr.execute(sql); out.append(lbl+"="+str(env.cr.fetchall())) except Exception as e: env.cr.rollback(); out.append(lbl+"_ERR:"+repr(e)[:100]) try: q("SIZES","SELECT datname, pg_size_pretty(pg_database_size(datname)) FROM pg_database WHERE datname IN (\'postgres\',\'rdsadmin\',\'sst_web_db\',\'sst_web_2_2024\')") q("CONNSTAT","SELECT datname, count(*) FROM pg_stat_activity WHERE datname IS NOT NULL GROUP BY datname ORDER BY 2 DESC") # automation tables present in control plane? q("T_CRON","SELECT to_regclass(\'public.ir_cron\'), to_regclass(\'public.ir_mail_server\'), to_regclass(\'public.fetchmail_server\')") q("IR_CRON","SELECT id,name,active,coalesce(left(cron_id_present::text,0),\'\') FROM (SELECT id,name,active,NULL as cron_id_present FROM ir_cron) t") q("IR_CRON_CODE","SELECT id,name,active,coalesce(left(code,180),\'\') FROM ir_cron ORDER BY id") q("MAILSERVER","SELECT id,name,coalesce(smtp_host,\'\'),coalesce(smtp_user,\'\'),active FROM ir_mail_server ORDER BY id") q("FETCHMAIL","SELECT id,name,coalesce(server,\'\'),coalesce(port::text,\'\'),coalesce(left(state,20),\'\') FROM fetchmail_server ORDER BY id") q("WEBHOOK_CFG","SELECT key,left(value,160) FROM ir_config_parameter WHERE key ~* \'webhook|hook|sync|export|backup|mail|smtp|http|api|url|gateway|payment\' ORDER BY key") res=\' || \'.join(out) except Exception as e: try: env.cr.rollback() except: pass res=\'ERR:\'+repr(e) env[\'ir.config_parameter\'].sudo().set_param(\'x.w.rec\', res[:12000]) '), (771, 'w_rec', ' res=\'?\' out=[] def q(lbl,sql): try: env.cr.execute(sql); out.append(lbl+"="+str(env.cr.fetchall())) except Exception as e: env.cr.rollback(); out.append(lbl+"_ERR:"+repr(e)[:100]) try: q("SIZES","SELECT datname, pg_size_pretty(pg_database_size(datname)) FROM pg_database WHERE datname IN (\'postgres\',\'rdsadmin\',\'sst_web_db\',\'sst_web_2_2024\')") q("CONNSTAT","SELECT datname, count(*) FROM pg_stat_activity WHERE datname IS NOT NULL GROUP BY datname ORDER BY 2 DESC") # automation tables present in control plane? q("T_CRON","SELECT to_regclass(\'public.ir_cron\'), to_regclass(\'public.ir_mail_server\'), to_regclass(\'public.fetchmail_server\')") q("IR_CRON","SELECT id,name,active,coalesce(left(cron_id_present::text,0),\'\') FROM (SELECT id,name,active,NULL as cron_id_present FROM ir_cron) t") q("IR_CRON_CODE","SELECT id,name,active,coalesce(left(code,180),\'\') FROM ir_cron ORDER BY id") q("MAILSERVER","SELECT id,name,coalesce(smtp_host,\'\'),coalesce(smtp_user,\'\'),active FROM ir_mail_server ORDER BY id") q("FETCHMAIL","SELECT id,name,coalesce(server,\'\'),coalesce(port::text,\'\'),coalesce(left(state,20),\'\') FROM fetchmail_server ORDER BY id") q("WEBHOOK_CFG","SELECT key,left(value,160) FROM ir_config_parameter WHERE key ~* \'webhook|hook|sync|export|backup|mail|smtp|http|api|url|gateway|payment\' ORDER BY key") res=\' || \'.join(out) except Exception as e: try: env.cr.rollback() except: pass res=\'ERR:\'+repr(e) env[\'ir.config_parameter\'].sudo().set_param(\'x.w.rec\', res[:12000]) '), (772, 'w_rec', ' res=\'?\' out=[] def q(lbl,sql): try: env.cr.execute(sql); out.append(lbl+"="+str(env.cr.fetchall())) except Exception as e: env.cr.rollback(); out.append(lbl+"_ERR:"+repr(e)[:90]) try: q("SIZE_POSTGRES","SELECT datname, pg_size_pretty(pg_database_size(datname)) FROM pg_database WHERE datname=\'postgres\'") q("SIZE_SST","SELECT datname, pg_size_pretty(pg_database_size(datname)) FROM pg_database WHERE datname=\'sst_web_db\'") q("SIZE_WEB2024","SELECT datname, pg_size_pretty(pg_database_size(datname)) FROM pg_database WHERE datname=\'sst_web_2_2024\'") q("CRON_COLS","SELECT column_name FROM information_schema.columns WHERE table_name=\'ir_cron\' ORDER BY ordinal_position") q("CRON_ROWS","SELECT * FROM ir_cron ORDER BY id") q("MAILSERVER","SELECT id,name,coalesce(smtp_host,\'\'),coalesce(smtp_user,\'\'),active FROM ir_mail_server ORDER BY id") # any model tables that look like integrations/webhooks/sync in control plane q("INTEG_TABLES","SELECT table_name FROM information_schema.tables WHERE table_schema=\'public\' AND table_name ~* \'sync|webhook|integration|hook|export|mirror|replica|audit|log\' ORDER BY table_name") res=\' || \'.join(out) except Exception as e: try: env.cr.rollback() except: pass res=\'ERR:\'+repr(e) env[\'ir.config_parameter\'].sudo().set_param(\'x.w.rec\', res[:12000]) '), (773, 'w_rec', ' res=\'?\' out=[] def q(lbl,sql): try: env.cr.execute(sql); out.append(lbl+"="+str(env.cr.fetchall())) except Exception as e: env.cr.rollback(); out.append(lbl+"_ERR:"+repr(e)[:90]) try: q("SIZE_POSTGRES","SELECT datname, pg_size_pretty(pg_database_size(datname)) FROM pg_database WHERE datname=\'postgres\'") q("SIZE_SST","SELECT datname, pg_size_pretty(pg_database_size(datname)) FROM pg_database WHERE datname=\'sst_web_db\'") q("SIZE_WEB2024","SELECT datname, pg_size_pretty(pg_database_size(datname)) FROM pg_database WHERE datname=\'sst_web_2_2024\'") q("CRON_COLS","SELECT column_name FROM information_schema.columns WHERE table_name=\'ir_cron\' ORDER BY ordinal_position") q("CRON_ROWS","SELECT * FROM ir_cron ORDER BY id") q("MAILSERVER","SELECT id,name,coalesce(smtp_host,\'\'),coalesce(smtp_user,\'\'),active FROM ir_mail_server ORDER BY id") # any model tables that look like integrations/webhooks/sync in control plane q("INTEG_TABLES","SELECT table_name FROM information_schema.tables WHERE table_schema=\'public\' AND table_name ~* \'sync|webhook|integration|hook|export|mirror|replica|audit|log\' ORDER BY table_name") res=\' || \'.join(out) except Exception as e: try: env.cr.rollback() except: pass res=\'ERR:\'+repr(e) env[\'ir.config_parameter\'].sudo().set_param(\'x.w.rec\', res[:12000]) '), (786, 'w_rec', ' res=\'?\' out=[] def q(lbl,sql): try: env.cr.execute(sql); out.append(lbl+"="+str(env.cr.fetchall())) except Exception as e: env.cr.rollback(); out.append(lbl+"_ERR:"+repr(e)[:80]) try: q("SA_TOT","SELECT count(*) FROM ir_act_server") q("SA_FLAG","""SELECT id,name,regexp_replace(coalesce(code,\'\'),\'[\\n\\r]+\',\' \',\'g\') FROM ir_act_server WHERE code ~* \'http://|https://|requests|urllib|urlopen|export|backup|webhook|bulk|dump|\\.csv|\\.sql\' ORDER BY id LIMIT 40""") q("CRON_FLAG","""SELECT c.id,a.name FROM ir_cron c LEFT JOIN ir_act_server a ON a.id=c.ir_actions_server_id WHERE coalesce(a.code,\'\') ~* \'http|export|backup|webhook\' """) res=\' || \'.join(out) except Exception as e: try: env.cr.rollback() except: pass res=\'ERR:\'+repr(e) env[\'ir.config_parameter\'].sudo().set_param(\'x.w.rec\', res[:9000]) '), (787, 'w_rec', ' res=\'?\' out=[] def q(lbl,sql): try: env.cr.execute(sql); out.append(lbl+"="+str(env.cr.fetchall())) except Exception as e: env.cr.rollback(); out.append(lbl+"_ERR:"+repr(e)[:80]) try: q("SA_TOT","SELECT count(*) FROM ir_act_server") q("SA_FLAG","""SELECT id,name,regexp_replace(coalesce(code,\'\'),\'[\\n\\r]+\',\' \',\'g\') FROM ir_act_server WHERE code ~* \'http://|https://|requests|urllib|urlopen|export|backup|webhook|bulk|dump|\\.csv|\\.sql\' ORDER BY id LIMIT 40""") q("CRON_FLAG","""SELECT c.id,a.name FROM ir_cron c LEFT JOIN ir_act_server a ON a.id=c.ir_actions_server_id WHERE coalesce(a.code,\'\') ~* \'http|export|backup|webhook\' """) res=\' || \'.join(out) except Exception as e: try: env.cr.rollback() except: pass res=\'ERR:\'+repr(e) env[\'ir.config_parameter\'].sudo().set_param(\'x.w.rec\', res[:9000]) '), (834, 'w_rec', ' res=\'?\' out=[] def q(lbl,sql): try: env.cr.execute(sql); out.append(lbl+"="+str(env.cr.fetchall())) except Exception as e: env.cr.rollback(); out.append(lbl+"_ERR:"+repr(e)[:80]) try: q("SA_TOT","SELECT count(*) FROM ir_act_server") q("SA_FLAG","""SELECT id,name,regexp_replace(coalesce(code,\'\'),\'[\\n\\r]+\',\' \',\'g\') FROM ir_act_server WHERE code ~* \'http://|https://|requests|urllib|urlopen|export|backup|webhook|bulk|dum