keycloak-ui icon indicating copy to clipboard operation
keycloak-ui copied to clipboard

Keycloak Admin.v2 - Minified React error #306 when opening a client

Open Daryes opened this issue 3 years ago • 6 comments

Describe the bug

On the admin console, in any realm, select the clients panel to view the list of all clients Click on one of the client, to view or edit it : the page will load and show : Error: Minified React error #306; Full error in the browser debug:

 Error: Minified React error #306; visit https://reactjs.org/docs/error-decoder.html?invariant=306&args[]=undefined&args[]= for the full message or use the non-minified dev environment for full errors and additional helpful warnings.
    Ea https://...sensitive:removed.../resources/j6isj/admin/keycloak.v2/assets/index.4ad08902.js:27
    Ma https://...sensitive:removed.../resources/j6isj/admin/keycloak.v2/assets/index.4ad08902.js:27
    o5 https://...sensitive:removed.../resources/j6isj/admin/keycloak.v2/assets/index.4ad08902.js:27
    Tt https://...sensitive:removed.../resources/j6isj/admin/keycloak.v2/assets/index.4ad08902.js:27
    o6 https://...sensitive:removed.../resources/j6isj/admin/keycloak.v2/assets/index.4ad08902.js:25
    z0 https://...sensitive:removed.../resources/j6isj/admin/keycloak.v2/assets/index.4ad08902.js:23
    unstable_runWithPriority https://...sensitive:removed.../resources/j6isj/admin/keycloak.v2/assets/index.4ad08902.js:19
    he https://...sensitive:removed.../resources/j6isj/admin/keycloak.v2/assets/index.4ad08902.js:23
    z0 https://...sensitive:removed.../resources/j6isj/admin/keycloak.v2/assets/index.4ad08902.js:23
    q https://...sensitive:removed.../resources/j6isj/admin/keycloak.v2/assets/index.4ad08902.js:19
    onmessage https://...sensitive:removed.../resources/j6isj/admin/keycloak.v2/assets/index.4ad08902.js:19

Version

19.0.2

Expected behavior

opening a client and being able to view or edit its configuration

Actual behavior

The said error, no much information available aside the message

How to Reproduce?

The error 306 happens on any clients, event the account or account-console default clients And also after a new client is created : the creation works, the client cannot be viewed/edited

If the admin them is changed to keycloak (v1), it works correctly with the old UI.

No idea about the real cause, the browser does not return anything more, and keycloak does not complain on the server side. A possible source could be an extra mapper, activated by default, linked to a ldap server under User Federation.

Anything else?

The installation was previously running Keycloak v16.1.1 (docker).
Then upgraded directly to keycloak v19.0.1, and v19.0.2 after

It is using the docker image from: quay.io/keycloak/keycloak Activated profile is : prod (image default, afaik) Current command line is : [ "start", "--auto-build" ]

No real problem encountered when migrating, and keycloak itself is working correctly with all the clients requesting an authorization.
Only the UI v2 has this bug, the v1 when changing the theme is OK

Using Firefox ESR v91.10, will try with the new ESR v102.1

Daryes avatar Sep 24 '22 13:09 Daryes

@Daryes I don't see this on my end but I don't have an LDAP set up. Anything you can do to give more specific steps to reproduce will help us find a resolution a lot faster. Maybe you can verify that it does have something to do with LDAP and the extra mapper you were talking about?

ssilvert avatar Sep 28 '22 18:09 ssilvert

Dear, I have the same problem with only a browser message: "Minified React error #306; visit https://reactjs.org/docs/error-decoder.html?invariant=306&args[]=undefined&args[]= for the full message or use the non-minified dev environment for full errors and additional helpful warnings." No information in the log sever. I installed keycloak 19.0.1 on Kubernetes with keycloak operator (olm) and I've connected my LDAP without problem. My browser is Firefox 105.0.1 on linux. I tested on Chromium and I can obtain the good UI with no error with keycloak.v2 default theme (version 105.0.5195.125). I changed Admin console theme to v1 and I could use Firefox in this case. Back to keycloak.v2 obtain the same problem with firefox only.

NB: after change v2 to v1, server log show this error. I don't know if it can help you. 12:57:25,544 ERROR [org.keycloak.services.scheduled.ScheduledTaskRunner] (Timer-2) Failed to run scheduled task ClearExpiredClientInitialAccessTokens: java.lang.IllegalAccessError: class org.keycloak.services.scheduled.ClusterAwareScheduledTaskRunner$1 tried to access protected field org.keycloak.services.scheduled.ScheduledTaskRunner.task (org.keycloak.services.scheduled.ClusterAwareScheduledTaskRunner$1 is in unnamed module of loader '[email protected]' @1fa39bf0; org.keycloak.services.scheduled.ScheduledTaskRunner is in unnamed module of loader '[email protected]' @5cea6320) at [email protected]//org.keycloak.services.scheduled.ClusterAwareScheduledTaskRunner$1.call(ClusterAwareScheduledTaskRunner.java:56) at [email protected]//org.keycloak.services.scheduled.ClusterAwareScheduledTaskRunner$1.call(ClusterAwareScheduledTaskRunner.java:52) at [email protected]//org.keycloak.cluster.infinispan.InfinispanClusterProvider.executeIfNotExecuted(InfinispanClusterProvider.java:78) at [email protected]//org.keycloak.services.scheduled.ClusterAwareScheduledTaskRunner.runTask(ClusterAwareScheduledTaskRunner.java:52) at [email protected]//org.keycloak.services.scheduled.ScheduledTaskRunner.run(ScheduledTaskRunner.java:54) at [email protected]//org.keycloak.timer.basic.BasicTimerProvider$1.run(BasicTimerProvider.java:53) at java.base/java.util.TimerThread.mainLoop(Timer.java:556) at java.base/java.util.TimerThread.run(Timer.java:506)

Best

ombarek avatar Sep 29 '22 12:09 ombarek

@Daryes I don't see this on my end but I don't have an LDAP set up. Anything you can do to give more specific steps to reproduce will help us find a resolution a lot faster. Maybe you can verify that it does have something to do with LDAP and the extra mapper you were talking about?

That's the main problem : the error is only on the browser side, and the error stack is from the browser debug console. It occurs immediately when trying to access a client details, from the "clients" panel. Even with a new client freshly created.

The only common element with the new client is the extra mapper that automatically propagate to all clients in a client scope :

  • Under User Federation, a provider is created (Active Directory), with an additional mapper named username (userPrincipalName) : user model attribute=usernameAlt, ldap attribute=userPrincipalName
  • Under Client Scopes : a new scope is created, named username_alt, protocol=openid-connect, include in token scope=on, and with 2 mappers
    • one with the user attribute username set to the token claim name login
    • another with the user attribute usernameAlt set to the token claim name username_alt

This client scope will appear in all client, old or new, under the client scopes tab, as a default or optional available client scope.

Daryes avatar Sep 29 '22 20:09 Daryes

Hi, I don't know if it can help you but I check firefox console to find more information. I obtain these info

Error: Minified React error #306; visit https://reactjs.org/docs/error-decoder.html?invariant=306&args[]=undefined&args[]= for the full message or use the non-minified dev environment for full errors and additional helpful warnings.
    Ea https://MYKEYCLOAKURL/auth/resources/wb7k1/admin/keycloak.v2/assets/index.4ad08902.js:27
    Ma https://MYKEYCLOAKURL/auth/resources/wb7k1/admin/keycloak.v2/assets/index.4ad08902.js:27
    o5 https://MYKEYCLOAKURL/auth/resources/wb7k1/admin/keycloak.v2/assets/index.4ad08902.js:27
    Tt https://MYKEYCLOAKURL/auth/resources/wb7k1/admin/keycloak.v2/assets/index.4ad08902.js:27
    o6 https://MYKEYCLOAKURL/auth/resources/wb7k1/admin/keycloak.v2/assets/index.4ad08902.js:25
    z0 https://MYKEYCLOAKURL/auth/resources/wb7k1/admin/keycloak.v2/assets/index.4ad08902.js:23
    unstable_runWithPriority https://MYKEYCLOAKURL/auth/resources/wb7k1/admin/keycloak.v2/assets/index.4ad08902.js:19
    he https://MYKEYCLOAKURL/auth/resources/wb7k1/admin/keycloak.v2/assets/index.4ad08902.js:23
    z0 https://MYKEYCLOAKURL/auth/resources/wb7k1/admin/keycloak.v2/assets/index.4ad08902.js:23
    q https://MYKEYCLOAKURL/auth/resources/wb7k1/admin/keycloak.v2/assets/index.4ad08902.js:19
    onmessage https://MYKEYCLOAKURL/auth/resources/wb7k1/admin/keycloak.v2/assets/index.4ad08902.js:19
    js https://MYKEYCLOAKURL/auth/resources/wb7k1/admin/keycloak.v2/assets/index.4ad08902.js:19
    __commonJS https://MYKEYCLOAKURL/auth/resources/wb7k1/admin/keycloak.v2/assets/index.4ad08902.js:1
    js https://MYKEYCLOAKURL/auth/resources/wb7k1/admin/keycloak.v2/assets/index.4ad08902.js:19
    __commonJS https://MYKEYCLOAKURL/auth/resources/wb7k1/admin/keycloak.v2/assets/index.4ad08902.js:1
    js https://MYKEYCLOAKURL/auth/resources/wb7k1/admin/keycloak.v2/assets/index.4ad08902.js:19
    __commonJS https://MYKEYCLOAKURL/auth/resources/wb7k1/admin/keycloak.v2/assets/index.4ad08902.js:1
    js https://MYKEYCLOAKURL/auth/resources/wb7k1/admin/keycloak.v2/assets/index.4ad08902.js:27
    __commonJS https://MYKEYCLOAKURL/auth/resources/wb7k1/admin/keycloak.v2/assets/index.4ad08902.js:1
    <anonymous> https://MYKEYCLOAKURL/auth/resources/wb7k1/admin/keycloak.v2/assets/index.4ad08902.js:81
index.4ad08902.js:25:73
    q3 https://MYKEYCLOAKURL/auth/resources/wb7k1/admin/keycloak.v2/assets/index.4ad08902.js:25
    payload https://MYKEYCLOAKURL/auth/resources/wb7k1/admin/keycloak.v2/assets/index.4ad08902.js:25
    vt https://MYKEYCLOAKURL/auth/resources/wb7k1/admin/keycloak.v2/assets/index.4ad08902.js:23
    aa https://MYKEYCLOAKURL/auth/resources/wb7k1/admin/keycloak.v2/assets/index.4ad08902.js:23
    Ea https://MYKEYCLOAKURL/auth/resources/wb7k1/admin/keycloak.v2/assets/index.4ad08902.js:27
    Ma https://MYKEYCLOAKURL/auth/resources/wb7k1/admin/keycloak.v2/assets/index.4ad08902.js:27
    o5 https://MYKEYCLOAKURL/auth/resources/wb7k1/admin/keycloak.v2/assets/index.4ad08902.js:27
    Tt https://MYKEYCLOAKURL/auth/resources/wb7k1/admin/keycloak.v2/assets/index.4ad08902.js:27
    o6 https://MYKEYCLOAKURL/auth/resources/wb7k1/admin/keycloak.v2/assets/index.4ad08902.js:25
    z0 https://MYKEYCLOAKURL/auth/resources/wb7k1/admin/keycloak.v2/assets/index.4ad08902.js:23
    unstable_runWithPriority https://MYKEYCLOAKURL/auth/resources/wb7k1/admin/keycloak.v2/assets/index.4ad08902.js:19
    he https://MYKEYCLOAKURL/auth/resources/wb7k1/admin/keycloak.v2/assets/index.4ad08902.js:23
    z0 https://MYKEYCLOAKURL/auth/resources/wb7k1/admin/keycloak.v2/assets/index.4ad08902.js:23
    q https://MYKEYCLOAKURL/auth/resources/wb7k1/admin/keycloak.v2/assets/index.4ad08902.js:19
    onmessage https://MYKEYCLOAKURL/auth/resources/wb7k1/admin/keycloak.v2/assets/index.4ad08902.js:19
    (Asynchrone : EventHandlerNonNull)
    js https://MYKEYCLOAKURL/auth/resources/wb7k1/admin/keycloak.v2/assets/index.4ad08902.js:19
    __commonJS https://MYKEYCLOAKURL/auth/resources/wb7k1/admin/keycloak.v2/assets/index.4ad08902.js:1
    js https://MYKEYCLOAKURL/auth/resources/wb7k1/admin/keycloak.v2/assets/index.4ad08902.js:19
    __commonJS https://MYKEYCLOAKURL/auth/resources/wb7k1/admin/keycloak.v2/assets/index.4ad08902.js:1
    js https://MYKEYCLOAKURL/auth/resources/wb7k1/admin/keycloak.v2/assets/index.4ad08902.js:19
    __commonJS https://MYKEYCLOAKURL/auth/resources/wb7k1/admin/keycloak.v2/assets/index.4ad08902.js:1
    js https://MYKEYCLOAKURL/auth/resources/wb7k1/admin/keycloak.v2/assets/index.4ad08902.js:27
    __commonJS https://MYKEYCLOAKURL/auth/resources/wb7k1/admin/keycloak.v2/assets/index.4ad08902.js:1
    <anonyme> https://MYKEYCLOAKURL/auth/resources/wb7k1/admin/keycloak.v2/assets/index.4ad08902.js:81

And in another way, (sorry some lines are in french)

b is null mozjexl.js:1
    Identifier resource://gre/modules/components-utils/mozjexl.js:1
[Exception... "Component returned failure code: 0x80004001 (NS_ERROR_NOT_IMPLEMENTED) [nsIAppStartup.secondsSinceLastOSRestart]"  nsresult: "0x80004001 (NS_ERROR_NOT_IMPLEMENTED)"  location: "JS frame :: resource:///modules/BrowserGlue.jsm :: _collectStartupConditionsTelemetry :: line 1590"  data: no] BrowserGlue.jsm:1590:9
    _collectStartupConditionsTelemetry resource:///modules/BrowserGlue.jsm:1590
    BG__onFirstWindowLoaded resource:///modules/BrowserGlue.jsm:1698
    BG_observe resource:///modules/BrowserGlue.jsm:938
    _delayedStartup chrome://browser/content/browser.js:2140
    _delayedStartup self-hosted:1356
Cette page est en mode de compatibilité (quirks). La mise en page peut en être affectée. Pour le mode standard, utilisez « <!DOCTYPE html> ».
hiddenWindow.html
L’évènement « key » n’est pas disponible pour certaines dispositions de clavier : key="r" modifiers="accel,alt" id="key_toggleReaderMode" browser.xhtml
L’évènement « key » n’est pas disponible pour certaines dispositions de clavier : key="x" modifiers="accel,alt" id="" browser.xhtml
L’évènement « key » n’est pas disponible pour certaines dispositions de clavier : key="q" modifiers="accel,alt" id="" browser.xhtml
L’évènement « key » n’est pas disponible pour certaines dispositions de clavier : key="s" modifiers="accel,alt" id="" browser.xhtml
L’évènement « key » n’est pas disponible pour certaines dispositions de clavier : key="t" modifiers="accel,alt" id="" browser.xhtml
L’évènement « key » n’est pas disponible pour certaines dispositions de clavier : key="i" modifiers="accel,alt,shift" id="key_browserToolbox" browser.xhtml
AbortError: Actor 'Conduits' destroyed before query 'RuntimeMessage' was resolved 2 ConduitsParent.jsm:362
    _raceResponses resource://gre/modules/ConduitsParent.jsm:362
Element.releaseCapture() est obsolète. Utilisez Element.releasePointerCapture() à la place. Pour plus d’informations https://developer.mozilla.org/fr/docs/Web/API/Element/releasePointerCapture menupopup.js:166:13
AbortError: Actor 'Conduits' destroyed before query 'RuntimeMessage' was resolved 2 ConduitsParent.jsm:362
    _raceResponses resource://gre/modules/ConduitsParent.jsm:362
b is null mozjexl.js:1
    Identifier resource://gre/modules/components-utils/mozjexl.js:1
New rollout bug-1791587-rollout-revert-unplanned-config-change-release-105-105 does not change any preferences. PreferenceRolloutAction.jsm:144
    _run resource://normandy/actions/PreferenceRolloutAction.jsm:144
    InterpretGeneratorResume self-hosted:1819
    AsyncFunctionNext self-hosted:807
Propriété « -moz-border-radius » inconnue.  Déclaration abandonnée. codemirror.css:244:22
Éléments correspondant au sélecteur : .CodeMirror pre.CodeMirror-line, .CodeMirror pre.CodeMirror-line-like
NodeList []
​length: 0
​<prototype>: NodeListPrototype { item: item(), keys: keys(), values: values(), … }
​​constructor: function ()
​​​isInstance: function isInstance()
​​​length: 0
​​​name: "NodeList"
​​​prototype: NodeListPrototype { item: item(), keys: keys(), values: values(), … }
​​​Symbol(Symbol.hasInstance): function Symbol.hasInstance()
​​​<prototype>: function ()
​​entries: function entries()
​​forEach: function forEach()
​​item: function item()
​​keys: function keys()
​​length: 
​​values: function values()
​​Symbol(Symbol.iterator): function values()
​​Symbol(Symbol.toStringTag): "NodeList"
​​<get length()>: function length()
​​<prototype>: Object { … }

Sorry, I lost some increment in my copy-paste. Best.

ombarek avatar Sep 30 '22 07:09 ombarek

Might not be related, but I encountered a simular issue with the same error message on my Keycloack 19.0.2 installation running on Fedora server 36 inside a docker (moby-engine-20.10.18-1.fc36.x86_64) container. My instance also have a LDAP-connection to an AD-domain (Samba domain controllers). The interesting thing in my scenario was that I had no issues when accessing from my Windows 10 computer using firefox 105.0.1. Same with Firefox 102.3.0esr on Debian 11. The only system with the issue was Firefox 105.0.1 on macOs 12.6.

What i tried on the affected system was deleting everything from "Local storage" and "Cookies" for my keycloack domain in the developer console. That seems to have temporary fixed the issue for me at least.

The interesting thing is that the error returns if I change tenant. I have to delete "Local storage" and "Cookies" even when switching to the same tenant as currently selected from the dropdown.

superspeed500 avatar Oct 05 '22 17:10 superspeed500

I experienced the same issue with a newly installed 19.0.3 (macOS 12.6, Safari 16.0). This was running in docker using the same default image with no external connections setup.

Opening the browser's developer console and disabling the cache solved the issue. Once resolved, the cache was re-enabled and it continued to work. The error re-emerged after adding a new client.

ajcollins avatar Oct 13 '22 21:10 ajcollins