Hacktoberfest 2026: le issue che i maintainer hanno segnato per ottobre, aperte e adatte ai principianti. Sfoglia le issue Hacktoberfest

PostgreSQL data types issue on clear docker installation of hawkbit 1.1.0

Aperta
#3,266 2 commenti 0 reazioni 0 assegnatari Vedi su GitHub

I maintainer di solito rispondono entro 1 giorno

Nessuno ha ancora preso questa issue.

Valutazione

Difficoltà
4/5
Tempo stimato
3-5 giorni
Idoneità per principianti
42/100
Tipo di issue
Bug
Chiarezza
Abbastanza chiara
Stato di attività
Tranquilla
Stack tecnologico
docker, java, postgresql
Ambito
backend, databases

Direzione di ricerca

The failure is an UPDATE on table sp_target_filter_query that binds NULL as VARCHAR for column auto_assign_distribution_set (bigint). Find the JPA/Hibernate entity and repository that map that table and the auto-assign distribution-set field, then see how null is passed when a distribution set is deleted. Reproduce with hawkBit 1.1.0 microservices plus PostgreSQL 16 as described; done when that UPDATE uses a bigint (or typed null) and the distribution set can be removed without SQLState 42804.

Scritto dal modello di indicizzazione a partire dal testo della issue.

Descrizione

Distribution set is unable to be removed. Server returns 500 error.
The reason is NULL type mismatch. It tries to set integer field to varchar NULL value.

The related log messages are the following:

hawkbit-mgmt  | 2026-08-11T06:22:46.414Z TRACE 1 --- [mgmt-server] [DEFAULT:admin] [nio-8080-exec-1] o.postgresql.core.v3.QueryExecutorImpl   :  FE=> Parse(stmt=null,query="UPDATE sp_target_filter_query SET auto_assign_distribution_set = ($1), access_control_context = ($2), optlock_revision = (optlock_revision + $3), auto_assign_action_type = ($4) WHERE ((auto_assign_distribution_set IN ($5)) AND (tenant = $6))",oids={1043,1043,23,1043,20,1043})
hawkbit-mgmt  | 2026-08-11T06:22:46.414Z TRACE 1 --- [mgmt-server] [DEFAULT:admin] [nio-8080-exec-1] o.postgresql.core.v3.QueryExecutorImpl   :  FE=> Bind(stmt=null,portal=null,$1=<(NULL)>,type=VARCHAR,$2=<(NULL)>,type=VARCHAR,$3=<('1'::int4)>,type=INT4,$4=<(NULL)>,type=VARCHAR,$5=<('9'::int8)>,type=INT8,$6=<('DEFAULT')>,type=VARCHAR)
...
hawkbit-mgmt  | 2026-08-11T06:22:46.416Z TRACE 1 --- [mgmt-server] [DEFAULT:admin] [nio-8080-exec-1] o.postgresql.core.v3.QueryExecutorImpl   :  <=BE ErrorMessage(ERROR: column "auto_assign_distribution_set" is of type bigint but expression is of type character varying
hawkbit-mgmt  |   Hint: You will need to rewrite or cast the expression.
hawkbit-mgmt  |   Position: 67
hawkbit-mgmt  |   Location: File: parse_target.c, Routine: transformAssignedExpr, Line: 586
hawkbit-mgmt  |   Server SQLState: 42804)

I've reproduced it using hawkbit docker microservices of version 1.1.0 and PostreSQL:16 container.

  • Uploaded a firmware
  • Created a rollout
  • Waited all device got updated
  • Tried to remove the distribution set

I've worked it around by automate type casting for the related cases:

CREATE OR REPLACE FUNCTION cast_varchar_to_bigint(varchar) 
RETURNS bigint AS $$
SELECT CASE WHEN $1 IS NULL OR $1 = '' THEN NULL ELSE $1::bigint END;
$$ LANGUAGE SQL IMMUTABLE STRICT;

CREATE CAST (varchar AS bigint) 
WITH FUNCTION cast_varchar_to_bigint(varchar) 
AS IMPLICIT;

CREATE OR REPLACE FUNCTION cast_varchar_to_int(varchar) 
RETURNS integer AS $$
SELECT CASE WHEN $1 IS NULL OR $1 = '' THEN NULL ELSE $1::integer END;
$$ LANGUAGE SQL IMMUTABLE STRICT;

CREATE CAST (varchar AS integer) 
WITH FUNCTION cast_varchar_to_int(varchar) 
AS IMPLICIT;
Lingua principale
Java
Stelle
601
Fork
228
Merge medio
15h 58m
PR unite (30g)
62

Preparare l'ambiente

Come iniziare

  1. Leggi tutta la issue e poi la guida ai contributi del progetto.
  2. Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
  3. Fai un fork del repository e lavora su un branch.
  4. Apri una pull request che faccia riferimento al numero della issue.

Altre issue di eclipse-hawkbit/hawkbit

Tutte le issue di eclipse-hawkbit/hawkbit

Issue simili

Altre issue su Java

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.