Hacktoberfest 2026: the issues maintainers tagged for October, open and beginner-friendly. Browse Hacktoberfest issues

PostgreSQL data types issue on clear docker installation of hawkbit 1.1.0

Open
#3,266 2 comments 0 reactions 0 assignees View on GitHub

Maintainers usually reply within 1 day

Nobody has claimed this yet.

Assessment

Difficulty
4/5
Estimated time
3-5 days
Newbie friendliness
42/100
Issue type
Bug
Clarity
Mostly clear
Activity status
Quiet
Tech stack
docker, java, postgresql
Domain
backend, databases

Research direction

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.

Written by the indexing model from the issue text.

Description

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;
Dominant language
Java
Stars
601
Forks
228
Avg merge
15h 58m
Merged PRs (30d)
62

Getting set up

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from eclipse-hawkbit/hawkbit

All issues in eclipse-hawkbit/hawkbit

Similar issues

More Java issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.