hobbit-project / platform

HOBBIT benchmarking platform
GNU General Public License v2.0
23 stars 9 forks source link

Failed to init user authentication. Please contact a system administrator #142

Closed smirnp closed 6 years ago

smirnp commented 6 years ago

I have deployed the platform, which successfully works via localhost. When I try to access GUI via ip-address I receive the exception.

May be because it fails to load keycloak-config from localhost:8080 , but where I don't know where I c modify it See console trace https://gyazo.com/10337fbe1ae9d62802359c68e95f32ca

MichaelRoeder commented 6 years ago

Sorry, but I am partly confused regarding your setup. From #140 it looked like you want to access the platfrom via http://localhost:8082. But now, it seems like you are using 192.168.56.20:8080.

Which OS are you using? Which address should the platform have and which address should Keycloak have?

smirnp commented 6 years ago

I did different attempts with configurations during setup. Finally it works with the default values (8080):

gui:
    build: ./hobbit-gui/gui-serverbackend
    ports:
      - "8080:8080"
    networks:
      - hobbit-core
      - hobbit
    depends_on:
      - platform-controller
      - rabbit
      - virtuoso
    environment:
      - HOBBIT_RABBIT_HOST=rabbit
      - KEYCLOAK_AUTH_URL=http://keycloak:8181/auth
      - CHECK_REALM_URL=false
      - KEYCLOAK_DIRECT_URL=http://keycloak:8080/auth

  # Keycloak user management (used by the GUI)
  keycloak:
    image: git.project-hobbit.eu:4567/gitadmin/hobbit-keycloak:1.0.0
    container_name: keycloak
    restart: always
    ports:
      - "8181:8080"
    networks:
      - hobbit
    volumes:
      - ./config/keycloak:/opt/jboss/keycloak/standalone/data/db

But it works only via localhost:8080. Attempts for access it via 192.168.56.20:8080 fail with the provided exception, while Keycloak interface is available via http://192.168.56.20:8181. Here is its configuration.

Ennosigaeon commented 6 years ago

This exception occures when the UI isn't able initialise the Keycloak configuration correctly. This is probably caused by unsuccessfull communication with the UI backend (see the last request in your network log). I am not sure, how this is configured via docker-compose, but the UI backend is configured here. As you can see, localhost:8080 is the default configuration. If you would like to run the UI backend somewhere else, you have to change this config.

smirnp commented 6 years ago

I have changed the backendUrl in environment.ts and environment.prod.ts, did "npm run build" and "docker-compose build gui", restarted gui docker, cleared browser cache but nothing changed. May be I missed something?

Ennosigaeon commented 6 years ago

I am not sure about your setup.... Have you split UI frontend (HTML) and UI backend to run on different servers? Or do you run them in the default way?

smirnp commented 6 years ago

I run all the platform services on a single machine 192.168.56.20 (which is headless vm), but cannot work with it properly from other machines in the network (using the address http://192.168.56.20:8080 in browser). The only way I can access it is via accessing vm via VirtualBox gui and localhost:8080. Or making tunnels to vm via ssh. Which is not convenient way of use.

The problem is that gui requests some resources from localhost, which is not working in case I access the Gui from some other machine in the network. Your solution above should be helpful, but I'm not sure if I properly performed all the steps to rebuild the gui with modified configuration

Ennosigaeon commented 6 years ago

Ok , so you basically have to run the Makefile again after changing envirement.prod.ts, as the UI has to be compiled into the UI backend. More specifically, only the commands

cd hobbit-gui/gui-client && npm install && npm run build-prod cd hobbit-gui/gui-serverbackend && mvn clean package

smirnp commented 6 years ago

"npm build" helped me, thank you.

PS: I suppose it is worth to add this piece of knowledge configuration into the Readme files.

PPS: npm build-prod gave me the following:

Hash: 87222bba916990805fdd
Time: 113107ms
chunk    {0} polyfills.573be4a90f3fea2689e4.bundle.js (polyfills) 191 kB {5} [initial] [rendered]
chunk    {1} main.02bafddaccf7ba2deaba.bundle.js (main) 432 kB {4} [initial] [rendered]
chunk    {2} scripts.9768741302f1b543fa2d.bundle.js (scripts) 444 kB {5} [initial] [rendered]
chunk    {3} styles.4b3db1ec68a87b86ce92.bundle.css (styles) 334 bytes {5} [initial] [rendered]
chunk    {4} vendor.a997c70d06ff70c1d1b2.bundle.js (vendor) 3.85 MB [initial] [rendered]
chunk    {5} inline.c4c517d777e23aaca1fa.bundle.js (inline) 0 bytes [entry] [rendered]

ERROR in ng:///home/vagrant/Projects/hobbit-platform/hobbit-gui/gui-client/src/app/challenges/edit/edit.component.html (3,3): Property 'userInfo' is private and only accessible within class 'EditComponent'.

ERROR in ng:///home/vagrant/Projects/hobbit-platform/hobbit-gui/gui-client/src/app/challenges/edit/edit.component.html (10,11): Property 'userInfo' is private and only accessible within class 'EditComponent'.
(node:20784) DeprecationWarning: Chunk.modules is deprecated. Use Chunk.getNumberOfModules/mapModules/forEachModule/containsModule instead.

npm ERR! Linux 3.13.0-133-generic
npm ERR! argv "/usr/bin/node" "/usr/bin/npm" "run" "build-prod"
npm ERR! node v6.11.5
npm ERR! npm  v3.10.10
npm ERR! code ELIFECYCLE
npm ERR! hobbit-gui@2.0.0 build-prod: `ng build --prod`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the hobbit-gui@2.0.0 build-prod script 'ng build --prod'.
npm ERR! Make sure you have the latest version of node.js and npm installed.
npm ERR! If you do, this is most likely a problem with the hobbit-gui package,
npm ERR! not with npm itself.
npm ERR! Tell the author that this fails on your system:
npm ERR!     ng build --prod
npm ERR! You can get information on how to open an issue for this project with:
npm ERR!     npm bugs hobbit-gui
npm ERR! Or if that isn't available, you can get their info via:
npm ERR!     npm owner ls hobbit-gui
npm ERR! There is likely additional logging output above.

npm ERR! Please include the following file with any support request:
npm ERR!     /home/vagrant/Projects/hobbit-platform/hobbit-gui/gui-client/npm-debug.log
Ennosigaeon commented 6 years ago

Your npm version is quite outdated. Try to run npm install npm@latest -g to upgrade to the latest version and check again if npm run build-prod still fails (works for me with npm v5.4.2 and node v6.11.2).

smirnp commented 6 years ago

Update did not helped npm 5.5.1, node v6.11.5 But this is not critical if built and build-prod differ only with configuration parameters

Ennosigaeon commented 6 years ago

In your stacktrace above npm 3.10.10 is listed...

npm ERR! npm v3.10.10