Keycloak Deployment Issue - Unexpected Application Error! Network response was not OK

Hello Keycloak Community,

I recently deployed Keycloak 23.0.6 on an Azure web app using a container, but I’m encountering some issues when trying to access certain functionalities. Specifically, when attempting to access the client list, client scope, or any link in the navigation bar : Network response was not OK.
Additionally, I’m facing problems when trying to change the realm, resulting in the following error:

Do someone have the same issue and can help me?

I’ve included my Docker Compose configuration from the deployment center below:

version: "3"
services:
  keycloak:
    image: quay.io/keycloak/keycloak:latest
    volumes:
      - ${WEBAPP_STORAGE_HOME}/data:/opt/keycloak/data/
    restart: always
    command: start-dev --proxy=edge --health-enabled=true --metrics-enabled=true
    environment:
       KC_HOSTNAME: ***************.azurewebsites.net

Has anyone else experienced a similar issue and could provide guidance on resolving it? Your assistance would be greatly appreciated!

Thank you,

Hi All,

I also get the same error with keycloak 22.0.1 as a azure container app.

@safidy , are you able to solve this? if yes , please upload the steps to solve this kinda error. We got struck on this for a few weeks

thanks,
Sriguruvel.

I got the same error and the other error which failed on CODE_TO_TOKEN.
The structure is a cluster with two service instances and a reverse proxy for load balance.

There is a time skew of about 1.5 minutes between the two instances. After I fixed the time problem, these problems haven’t happened again.


BTW, If using containers to form a cluster, may need to check network mode is host and use the correct network interface.

HI @lagagain ,

Could you please explain , how to solve this?

It will be helpful for us to do the further move on container app!

Thanks i advance,
Sriguruvel

@Guruvel

Check NTP is enabled with timedatectl. Result like:

          >  Time zone: Asia/Taipei (CST, +0800)
          >  System clock synchronized: **yes**
          >  NTP service: **active**
          >  RTC in local TZ: no

Check container TZ environment variable has been set.

@lagagain ,

Thanks let me check and confirm.

“Network response was not OK”, this message also is shown when the target’s SSL is untrusted.