postgres: null value in column "serial" violates not-null constraint
Closed this issue · 2 comments
jfhr commented
I get the below error when running dmarcts-report-parser using a postgres database. The database connection itself is working and the tables were created, but inserting any records fails.
DBD::Pg::db last_insert_id failed: No suitable column found for last_insert_id of table "report" at ./dmarcts-report-parser.pl line 866.
Use of uninitialized value $serial in concatenation (.) or string at ./dmarcts-report-parser.pl line 868.
serial
single record
ip=...
DBD::Pg::db do failed: ERROR: null value in column "serial" violates not-null constraint
I've attached my configuration below:
Click to expand
################################################################################
### configuration ##############################################################
################################################################################
# If IMAP access is not used, config options starting with $imap do not need to
# be set and are ignored.
$debug = 0;
$delete_reports = 0;
# Supported types: mysql, Pg. If unset, defaults to mysql
$dbtype = 'Pg';
$dbname = 'dmarc';
$dbuser = 'dmarc';
$dbpass = '***';
$dbhost = 'localhost'; # Set the hostname if we can't connect to the local socket.
$dbport = '5432';
$imapserver = 'imap.fastmail.com';
$imapuser = 'me@jfhr.de';
$imappass = '***';
$imapport = '993';
$imapssl = '1'; # If set to 1, remember to change server port to 993 and disable imaptls.
$imaptls = '0'; # Enabled as the default and best-practice.
$tlsverify = '1'; # Enable verify server cert as the default and best-practice.
$imapignoreerror = '0'; # set it to 1 if you see an "ERROR: message_string()
# expected 119613 bytes but received 81873 you may
# need the IgnoreSizeErrors option" because of malfunction
# imap server as MS Exchange 2007, ...
$imapreadfolder = 'DMARC Reports';
# If $imapmovefolder is set, processed IMAP messages will be moved (overruled by
# the --delete option!)
$imapmovefolder = 'DMARC Reports/Processed';
# If $imapmovefoldererr is set, IMAP messages that fail will be moved. If unset, failed messages
# will move to $imapmovefolder (if it is set). Overruled by the --delete option!
$imapmovefoldererr = 'Inbox.notProcessed';
# maximum size of XML files to store in database, long files can cause transaction aborts
$maxsize_xml = 50000;
# store XML as base64 encopded gzip in database (save space, harder usable)
$compress_xml = 0;
# if there was an error during file processing (message does not contain XML or ZIP parts,
# or a database error) the parser reports an error and does not delete the file, even if
# delete_reports is set (or --delete is given). Deletion can be enforced by delete_failed,
# however not for database errors.
$delete_failed = 0;
Any idea what might be going wrong? thanks!
techsneeze commented
Did you find a solution? I don't have a postgres setup to debug against. Most of the relates submission has been from users.
jfhr commented
I didn't find a solution, but I switched to MySQL which works well.