Port Status Attributes Cause Error 500 in Control center
Port Status Attributes Cause Error 500 in Control center in Keycloak Operational Issues.
Port Status Attributes Cause Error 500 in Control center#
The issue occurs when we try to add port status attributes for any service in Control Center.
Cause:
The producer is not mapped to the KPI. Map the producer to the KPI before adding attributes.

Solution:
Map the KPI to the instance with the producer in metric details.
Delay in Reflecting Control Center Changes on Heal UI#
Issue: The changes in threshold or persistency/suppression values made from Control center is not reflecting in HEAL UI on immediate basis.
Solution: Follow the below steps to rectify the issue:
- The issue is faced for one particular service.
- For this service, the threshold set at service level is getting reflected in
service_kpi_thresholdtable in percona. But not reflecting in the UI. - Set the threshold at instance level and it is successfully getting reflected in the UI.
- Hence, continue to update threshold at instance level as there are only two instances in this service.
Weak SSL/TLS Key Keycloak Ports#

-
Update the Java Security file: Modify the
java.Securityfile to adjust a parameter value. Change thejdk.tls.disabledAlgorithmssetting from DH keySize < 1024 to DH keySize < 2048.The updated line should be as below:
YAML
jdk.tls.disabledAlgorithms=SSLv3, RC4, DES, MD5withRSA, DH keySize < 2048 -
Validate TLS Cipher Key Size: Use the following NPM command to validate the TLS cipher key size:
CSS
nmap -sV --script ssl-enum-ciphers -p <keycloak_port> <keycloak_ip> -
Update Java Options in Configuration File:
-
Modify the
standalone.conffile by mounting it inside the Nomad file:File
`"/tmp/standalone.conf:/opt/jboss/keycloak/bin/standalone.conf"` -
Update the JAVA_OPTS settings as follows:
Bash
JAVA_OPTS="-Xms${min_heap}m -Xmx${max_heap}m -XX:MetaspaceSize=96M - XX:MaxMetaspaceSize=${max_meta_space}m - Djava.net.preferIPv4Stack=true" JAVA_OPTS="$JAVA_OPTS - Djboss.modules.system.pkgs=$JBOSS_MODULES_SYSTEM_PKGS - Djava.awt.headless=true -Djdk.tls.ephemeralDHKeySize=2048"
-
-
Restart Keycloak Service: After the changes, restart the Keycloak service to apply the updates.
Keycloak Restart Issues with Inbound/Outbound Tab Access#
Keycloak was restarting unexpectedly when accessing the inbound/outbound tabs.
The error was due to the logs displayed in the following exception:
Bash
java.lang.NoClassDefFoundError: Could not initialize class
org.elasticsearch.search.builder.SearchSourceBuilder
Solution:
First Solution:
- In a session, modify the value of the consul key
service/elasticsearch/ipto blank. - Restarted Keycloak, but it was operational only for 30 minutes.
- There was high utilization (99%) of the Cassandra service, and observed the increase in its memory from 3GB to 7GB.
Additional Issue:
- Nomad status showed Keycloak as running, but it wasn't visible in
podman ps, indicating that the Keycloak service had stopped. - But the Analytics department was using an outdated Keycloak image, so it was updated to the latest version.
Second Solution:
-
Updated Elasticsearch configurations in Keycloak:
Bash
elasticsearch.host={{ key "service/elasticsearch/ip" }} elasticsearch.port={{ key "service/elasticsearch/port" }} elasticsearch.protocol={{ key "service/elasticsearch/protocol" }} -
Restart Keycloak.
Further Errors Observed:
Logs showed errors, leading the development team to recommend setting certain values as EMPTY:
Bash
docker exited -> driver was unable to get the exit code, unknown
error code
Final Solution:
-
Cleared Podman caches using the below command:
Bash
podman system prune -a -
Resolve the issue with the following database queries and updates:
Bash
select kpi_id kpiId, category_id categoryId, name, category_identifier identifier, kpi_type_id kpiTypeId, is_informative isInformative from view_kpi_category_details where kpi_id = 406 INSERT INTO tag_mapping (tag_id, object_id, object_ref_table, tag_key, tag_value, created_time, updated_time, account_id, user_details_id) VALUES (5, 406, 'mst_kpi_details', 76, 'Success', '2019-08-09 00:00:00', '2019-08-09 00:00:00', 1, '7640123a-fbde- 4fe5-9812-581cd1e3a9c1'); select * from tag_mapping where tag_id = 5 and object_id= 406; update mst_category_details set status = 0 where id = 76;
Addressing No Rate Limiting on Endpoints#
The Nomad services were not starting up on the UAT server.
Network Mode Adjustment: After changing the network mode to ‘host’, which led to the successful operation of the services.
HAProxy Configuration Changes:
- Modify the
haproxy.cfgfile to configure Keycloak to run behind HAProxy. - The changes and the
haproxy.nomadfile are attached in the comment. -
Update the below consul key with the value ‘9998’.
Bash
service/keycloak/port/https
Rate Limiting Implementation in HAProxy:
- Add specific lines to the
haproxy.cfgfile to implement rate limiting for account creation in the Control Center (CC). This includes a stick-table for tracking request rates and conditions to deny requests exceeding the rate limit. -
The configuration snippet is as follows:
Bash
stick-table type binary len 8 size 100k expire 100s store http_req_rate(59s) http-request track-sc0 base32+src http-request set-var(req.rate_limit) path,map_beg(/usr/local/etc/haproxy/rates.map,20000) http-request set-var(req.request_rate) base32+src,table_http_req_rate() acl rate_abuse var(req.rate_limit),sub(req.request_rate) lt 0 http-request deny deny_status 429 if rate_abuse -
Include the
rates.mapfile in the HAProxy directory, specifying the rate limit for account creation requests. -
Content of rates.map file:
/appsone-controlcenter/v2.0/api/accounts 5(indicating the number of accounts allowed in a specific time frame).