Cannot access 'Users' application in DHIS2

Hello,

after a fresh DHIS 2.36.4 installation, I can’t access the Users application.
I get this error message:

An error occurred in the DHIS2 application.
The following information may be requested by technical support.
TypeError: a.canCreate is not a function
at hn.userHasAuthorities (https://dhis2-redacted-url:10443/dhis-web-user/static/js/app.c2c3db7f.chunk.js:1:458197)
at routeConfig.nn.reduce.routes (https://dhis2-redacted-url:10443/dhis-web-user/static/js/app.c2c3db7f.chunk.js:1:458019)
at Array.reduce (<anonymous>)
at hn.setRouteConfig (https://dhis2-redacted-url:10443/dhis-web-user/static/js/app.c2c3db7f.chunk.js:1:457962)
at hn.componentWillReceiveProps (https://dhis2-redacted-url:10443/dhis-web-user/static/js/app.c2c3db7f.chunk.js:1:457663)
at pa (https://dhis2-redacted-url:10443/dhis-web-user/static/js/139.dba057a8.chunk.js:2:313221)
at Si (https://dhis2-redacted-url:10443/dhis-web-user/static/js/139.dba057a8.chunk.js:2:329242)
at Ci (https://dhis2-redacted-url:10443/dhis-web-user/static/js/139.dba057a8.chunk.js:2:334212)
at Fo (https://dhis2-redacted-url:10443/dhis-web-user/static/js/139.dba057a8.chunk.js:2:358124)
at Yo (https://dhis2-redacted-url:10443/dhis-web-user/static/js/139.dba057a8.chunk.js:2:358508)
---
in hn
in Connect(hn)
in t
in withRouter(Connect(hn))
in t
in div
in Tn
in t
in Gn
in a
in Unknown
in Suspense
in div
in E
in div
in H
in Q
in Y
in DHIS2RuntimeProvider
in P
in N
in R
in m

Does this sound familiar to anybody ?

Thanks a lot

Hi @Thomas

Welcome back to the community!

You might want to upgrade to one of the latest and supported versions. 2.36 is no longer a supported version and therefore not maintained and the issue that you are facing might have already been fixed in later versions.

There are several things you might want to check:

  1. Is this a cache issue? If you run Maintenance (reload apps, clear application cache) in Data Administration app and then if you open in Guest mode ( Browse Chrome as a guest - Computer - Google Chrome Help) does the issue still occur?
  2. Does this occur to all users including a superuser with ALL authority?
  3. What changes were made that made the app crash?
  4. Are you able to reproduce this in later versions on a clean installation? One option is to try on play.dhis2.org

Additionally, community members sharing solutions and challenges help in expanding the knowledge base and the global support so it might be worth checking other topic posts similar to the issue you posted and share your experience or comments about the solutions provided. I think the topics below are similar:

  1. Unable to access Users App after 2.32 -> 2.37.2 upgrade
  2. Major issues with dhis2 upgrade from 2.36 to 2.37

Please note that using an unsupported version means if there are fixes in later versions the only solution is to probably upgrade. Thanks!

Hi @Gassim,

thanks for your answer.

I caught this in the developers tools :

those calls in red, are failing because they’re going to localhost:8080 instead of the actual domain.

This is how my nginx.conf looks like:

    server {
       listen            10443 ssl;
       server_name  dhis-redacted-url;
       client_max_body_size 10M;
       ssl_certificate      /etc/certs/final.net.chained.crt;
       ssl_certificate_key  /etc/certs/wildcard.final.net.key;
       ssl_dhparam          /etc/nginx/dhparam2048.pem;
       ssl_session_cache    shared:SSL:20m;
       ssl_session_timeout  10m;
       ssl_protocols              TLSv1.2 TLSv1.3;
       ssl_ciphers              EECDH+AESGCM:EDH+AESGCM;
       ssl_prefer_server_ciphers  on;
       add_header  Strict-Transport-Security  'max-age=31536000';
       add_header Cache-Control no-cache;

    # Proxy pass to servlet container

    location / {
      proxy_pass                http://localhost:8080/;
#      proxy_redirect            off;
#      proxy_set_header          Host               $host;
      proxy_set_header          X-Real-IP          $remote_addr;
      proxy_set_header          X-Forwarded-For    $proxy_add_x_forwarded_for;
      proxy_set_header          X-Forwarded-Proto  https;
      proxy_buffer_size         128k;
      proxy_buffers             8 128k;
      proxy_busy_buffers_size   256k;
      proxy_cookie_path         ~*^/(.*) "/$1; SameSite=Lax";
    }
  }

and my Tomcat server.xml Connector part:

    <Connector scheme="https" proxyPort="7443" />

    <Connector port="8080" protocol="HTTP/1.1"
               connectionTimeout="20000"
            redirectPort="8443"
            relaxedQueryChars="[]" />

(For reference, I needed to setup DHIS on another port than 80/443, I had started a thread here : Make DHIS2 listen to another port than 80/443 with a reverse proxy on Nginx)

Thank you!

I can see localhost:8080 in the configuration… shouldn’t we change this?

Right! :+1::+1:

Hi Gassim,

here nginx is acting as a reverse proxy, and DHIS2 (Tomcat) is listening on localhost:8080.
I think that if we change the proxy_pass directive in nginx.conf, it won’t work at all.

Hi,

this got solved by adding the expected remote port where nginx is listening to, to proxy_set_header in nginx.conf

proxy_set_header Host $host:10443;

It works great now :slight_smile:

1 Like