GeoFence raise an exception with priority 0
Opened this issue · 7 comments
Priority has the unique
constraint: all the rules should be completely ordered.
Anyway the wiki reports 3 types of RUle insertion but, for sake of simplicity of the GUI, I guess the fixedPriority
procedure is used:
fixedPriority
: a fixed priority number. If a Rule already exists with the same priority value, all existing rules with
priority >= value will have their priority incremented by 1.
In the code I see the shift is not called if a rule with the same priority already exists, so the documented behaviour is not honoured.
@etj it seems to be the behaviour in others GeoServer+GeoFence (embedded) installation. But not here in KRIHS.
From the GeoServer Log:
2020-12-11 17:43:33,062 WARN [org.hibernate.util.JDBCExceptionReporter] - SQL Error: 50000, SQLState: HY000
2020-12-11 17:43:33,062 ERROR [org.hibernate.util.JDBCExceptionReporter] - General error: java.lang.ArrayIndexOutOfBoundsException: 512; SQL statement:
update public.gf_rule set priority=priority+? where priority>=? [50000-119]
@randomorder I think better to use the PostgreSQL database instead of H2.
@randomorder never use H2 in production installations of GeoFence, always PostgreSQL!!!