SafeExamBrowser / seb-server-setup

Cotains resources and packages to setup and install SEB-Server. Currently only docker-based setup is supported
Mozilla Public License 2.0
7 stars 12 forks source link

Wrong username or password with the credentials displayed with docker-compose logs -f #12

Closed fishfree closed 1 year ago

fishfree commented 1 year ago

image

image

I ran and logged in SEB server successfully a week ago. I accidentally deleted the docker-compose.yml folder yesterday. Now:

  1. I reconstruct the docker-compose .yml file and .env file, the latter contains only DB_SA_PWDand SEBSERVER_PWD.
  2. run docker-compose down -v
  3. run docker-compose up -d
  4. Try the username & passwords displayed with docker-compose logs -f and set in the .env file, both failed.

I cannot figure out why.

anhefti commented 1 year ago

Hi,

fishfree commented 1 year ago

@anhefti Sorry to reply late. I even ran docker-compose down -v && docker image prune -a -y && docker-compose up -d . Still no luck. This is the log file. Thank you! sebserverdocker.log

anhefti commented 1 year ago

You have to delete the sebserver-admin account on your database that was automatically generated by SEB Server on the very first startup with empty database. Once you have deleted this account on your database SEB Server should create a new one for you and prints the password as usual within the logs.

Or if this is not working just make a database dump with the data you want to preserve and start from scratch with a very new installation. Then insert the preserved data into the new database.

fishfree commented 1 year ago

@anhefti I ran:

docker exec -it seb-server-mariadb /bin/bash
mysql
use SEBServer;
DELETE FROM user_role;
DELETE FROM user;
exit
exit
docker-compose restart seb-server

Now use the newly-generated password to login in, the same error.

Did you notice this line in my log: [36mseb-server | 07:19:37.090 INFO [main]:[ch.ethz.seb.SEB_SERVER_INIT] ----> Webservice connection: https://examserver.example.com:8080/admin-api/v1

I cannot access this URL publicly.

anhefti commented 1 year ago

If your SEB server is not accessible from the internet, please set the following settings to an URL on that the SEB Server is available outside of docker:

  • sebserver_webservice_http_external_scheme=http
  • sebserver_webservice_http_external_servername=[IP Address]
    • sebserver_webservice_http_external_port=8080

And use the following to make the communication inside docker possible:

sebserver_gui_webservice_protocol=http sebserver_gui_webservice_address=[insert seb-server container name of your setup here, usually seb-server] sebserver_gui_webservice_port=8080

If this doesn't work and it once was working I recommend you to start from scratch with a new installation since we don't know how your setup exactly looks like.

fishfree commented 1 year ago

Thank you for your tip! After manually adding these in the docker-compose.yml file, it works now.

sebserver_gui_webservice_protocol=http
sebserver_gui_webservice_address=seb-server
sebserver_gui_webservice_port=8080