Hello.... I have run into a problem. My
# umh-support
b
Hello.... I have run into a problem. My stack is no longer writing to the timescale DB.... When I look in the Kafka to Postgres data-bridge I see this error: 2025-09-03T15:35:06.209237312+02:00 level=error msg="Failed to send message to sql_insert: pq: there is no unique or exclusion constraint matching the ON CONFLICT specification" @service=benthos label="" path=root.output.broker.outputs.0.switch.cases.0.output
j
@krgrsebastian did you have it before? @buff_07286 is this UMH classic, or UMH core with a custom bridge? if it is the later, can you give us the bridge code you used?
b
Hi @jermuk this is classic... I have not had this problem before. Is there a way for me to perhaps restart the bridge? My problem is that there is not enough info for me to isolate the cause of the problem
r
in the bridge template you have: suffix: ON CONFLICT (timestamp,name,asset_id) DO NOTHING. It seems there is some problems with the tables. Either there is a key problem or an index problem as far as i can tell. It seems a bit strange if it has worked before. Have you done any manual inserts or fiddling in the DB?
b
Hi @runeston3 . Yes we have added tables and indexes. We want to use the asset table as the seed table for a bunch of other tables. That way we can use UMH to collect data dynamically from our broker and can add additional functionality through other tables referencing the asset table.
I just compared to our working instances and I can see that the dependencies and references are not the same... I think we may have changed the table from being a hypertable
This may have happened when we did a restore of the database... or a migrate... Is there a way to reset the database without a complete reinstall??
Oh, I see... we have the same issue with tag and tag_string... that is probably the cause of the error??
If I manually create the hypertable will that fix the problem??
f
Yes, you can reset the database using:
Copy code
DROP DATABASE umh_v2;
⚠️ Keep in mind that there is no way to go back or recover data after doing this ! Afterwards to re-create the DB and all tables do execute the SQL statements from the attachment. https://cdn.discordapp.com/attachments/1412828747555537067/1413481386538696734/create_db.sql?ex=68bc169f&is=68bac51f&hm=9524085910c00db1990cbf0b8f293fdaec19a516f8ee16111744a33caa5dd2dc&
⚠️ This will also wipe all of your custom tables and functions, ... if they are in our database !
Btw, if you want more information, about how we setup timescaledb, you can also read our [init script](https://github.com/united-manufacturing-hub/united-manufacturing-hub/blob/staging/deployment/united-manufacturing-hub/templates/timescaledb/configmap.yaml).
b
Thankx @Ferdinand ... I did think of the init script. What I see is that the tag_string and tag tables are not included here. These are actually the tables that I think are causing the error. I am firstly going to try to recreate them as hyper tables and see if that fixes the problem... Failing that I will reset the database and start afresh...
That seemed to fix the problem... I had to additionally add constraints and had a few problems because I think kafka was replaying old interactions with asset ids that were no longer in the database. I manually added them and that fixed the constraints problem...