question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

replication issue: null value in column "id" violates not-null constraint

See original GitHub issue
Jul 18 08:13:44: [ERROR] - global_lib.py (413): An error occurred during the replica. (<class 'psycopg2.IntegrityError'>, IntegrityError('null value in column "id" violates not-null constraint
DETAIL:  Failing row contains (null, null, null, null, null, 2, null, null, b:1:144,b:2:144, null, null, null, null, null, null, null, 0, 0, 0, null).
CONTEXT:  SQL statement "
UPDATE  switchv2.rate
  SET
   day=NULL,
   data=NULL,
   tier0='b:1:144,b:2:144',
   tier1=NULL,
   tier2=NULL,
   tier3=NULL,
   tier4=NULL,
   tier5=NULL,
   tier6=NULL,
   tier7=NULL,
   max_los=NULL,
   min_los='2',
   id=NULL,
   tier_active='0',
   max_los_thru=NULL,
   min_los_thru=NULL,
   rateplan_code=NULL,
   number_of_units=NULL,
   close_to_arrival='0',
   close_to_departure='0'
  WHERE ("id","rateplan_code","day")=('S000186','ST_BAR4','2017-08-25');
"
PL/pgSQL function sch_chameleon.fn_process_batch(integer,integer) line 216 at EXECUTE
',), <traceback object at 0x7f99ac2c5148>)

Mysql does do this correctly in the replication (I am replicating of a slave), but I do not know the exact sql statement right now that would trigger this.

I guess it is a rowlevel entry that fails.

Issue Analytics

  • State:closed
  • Created 6 years ago
  • Comments:9 (5 by maintainers)

github_iconTop GitHub Comments

1reaction
ghostcommented, Jul 18, 2017

with binlog_row_image=FULL on the mysql slave acting as master now everything seems to work fine.

1reaction
ghostcommented, Jul 18, 2017

as soon as the issue is confirmed fix I shall close it

Read more comments on GitHub >

github_iconTop Results From Across the Web

Postgres error: null value in column "id" - during insert ...
Since you don't explicitly set it, it's implicitly given a null value, which is, of course, not a valid value for a primary...
Read more >
null value in column violates not-null constraint" for an ...
I have an AWS Database Migration Service (AWS DMS) task that is both full load and change data capture (CDC). I received an...
Read more >
ERROR: null value in column "id" violates not-null constraint
The workaround is to replicate long strings of fragile code, violating DRY. My situation is that 22 fields (the maximum supported) must be ......
Read more >
null value in column "project_id" violates not-null constraint ...
It's very hard to reproduce the issue. A working way is: to create the project manually leaving defaults, then; to use GitLabracadabra to...
Read more >
ERROR: null value in column "payload" violates not...
ERROR : null value in column "payload" violates not-null constraint QlikSensePrintingWebSocketProxy in Windows Event Logs.
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found