Hi all,
I'm getting an error when opening Tenant → Device Profiles -> Selecting any specific device profile in the web UI. The page stays blank and shows:
Error deserializing field 'relay_cad_periodicity': Received more than 2 bytes while decoding an i16. Was an Integer expression accidentally marked as SmallInt?
Environment:
- ChirpStack: v4.11.1 (Docker)
- PostgreSQL server: 14.20
What I found:
The relay columns in device_profile are integer in my database, while schema_postgres.rs for v4.11 defines them as Int2 (smallint):
relay_cad_periodicity | integer
relay_default_channel_index | integer
relay_ed_activation_mode | integer
... (all relay_* numeric columns are integer)
relay_second_channel_freq | bigint
What I tried:
- Altered all relay_* integer columns to smallint. After that, the relay error went away, but the next error appeared on a different column:
Error deserializing field 'rx1_delay': Received more than 2 bytes while decoding an i16.
This suggests other columns (e.g. rx1_delay, abp_rx1_delay, class_b_ping_slot_dr, dr, f_port) may also have been created as integer instead of smallint.
2. I reverted the relay columns back to integer for now, so the original error is back.
Questions:
- Is there a known cause for columns ending up as integer instead of smallint (e.g. a migration path, an older version, or a DB restore/conversion)?
- Is it safe to ALTER all columns that v4.11 expects as smallint (per schema_postgres.rs) to smallint, or is there a recommended/official way to repair the schema?
- Would upgrading to v4.12+ (where the relay fields move to relay_params JSONB) resolve this, or would the migration fail given the current column types?
I can share full column-type output or logs if helpful.
Thanks!