instructure / canvas-lms

The open LMS by Instructure, Inc.
https://github.com/instructure/canvas-lms/wiki
GNU Affero General Public License v3.0
5.43k stars 2.43k forks source link

Local development Quick Startup on mac, what's the default username/password? #2133

Open dvuke opened 1 year ago

dvuke commented 1 year ago

Summary:

Steps to reproduce:

  1. get local github project
  2. install docker desktop
  3. run the ./script/docker_dev_setup.env
  4. during installation, you have to choose to MIGRATE the existing db, it finds one, and if i try to select DROP the installation fails
  5. it goes through the process successfully, i run docker-compose up and the application comes up successfully and I can navigate to the login page
  6. i have no idea what username/password to type in. (Need help here..)

As a workaround, i tried to do the following:

docker exec -u 0 -it /bin/bash run rails db:initial_setup

It did prompt me for my username and password i wanted to use to login, but after i logged in with those credentials i got an error in canvas:

ActiveRecord::InvalidForeignKey in Login::CanvasController#create PG::ForeignKeyViolation: ERROR: insert or update on table "terms_of_services" violates foreign key constraint "fk_rails_337ba633a9" DETAIL: Key (account_id)=(10000000000002) is not present in table "accounts".

so no matter which route I go, I can't login with default credentials and I can't initialize the db and provide my own credentials to login bc it throws an exception

Expected behavior:

Actual behavior:

Additional notes:

dvuke commented 1 year ago

.... no help on this one? or where to even submit this? BUMP?

jlebo commented 1 year ago

If anyone runs into this in the future, you can open a rails console docker-compose run --rm web bundle exec rails console then run Account.default.save! and that should allow you to log in with the username and password entered when setting up the dbs.