sameersbn / docker-gitlab

Dockerized GitLab
http://www.damagehead.com/docker-gitlab/
MIT License
7.9k stars 2.14k forks source link

Wrong Login Credentials #897

Open adshrc opened 8 years ago

adshrc commented 8 years ago

Hi,

after i've set up gitlab successfully, i can't log in, with the default credentials.

This is the Log: (used passwords: 5iveL!fe, password, root, admin)

Started POST "/users/sign_in" for 172.18.1.5 at 2016-09-20 16:40:08 +0200 Processing by SessionsController#create as HTML Parameters: {"utf8"=>"✓", "authenticity_token"=>"IWcOX5MZDAGJxVbYnjHq6BEwi9vIRbv2hqyx+BBn+5YXzqTSxKvWVGVPKVi3JRKJ4TUut5lTmXKGzNrK1q4KTw==", "user"=>{"login"=>"admin@example.com", "password"=>"[FILTERED]", "remember_me"=>"0"}} Completed 401 Unauthorized in 37ms (ActiveRecord: 1.7ms)

I hope you can help me. Thanks in advance!

adshrc commented 8 years ago

Update: The installer doesn't create any users.

solidnerd commented 8 years ago

Hey, which version of the image do you use ? And did you set the correct env's for a user. By default you should be asked for the root password. Please post your GitLab Container env's .

adshrc commented 8 years ago

Hi, i'm using latest. Here is my docker-compose.yml entry:

  gitlab:
    image: sameersbn/gitlab
    container_name: gitlab
    networks:
      - main
    environment:
      - DEBUG=true
      - REDIS_HOST=redis
      - DB_ADAPTER=mysql2
      - DB_HOST=mariadb
      - DB_NAME=gitlab
      - DB_USER=gitlab
      - DB_PASS=...
      - GITLAB_SECRETS_DB_KEY_BASE=...
      - GITLAB_SECRETS_SECRET_KEY_BASE=...
      - GITLAB_SECRETS_OTP_KEY_BASE=...
    restart: always
    links:
      - mariadb:mariadb
      - redis:redis
    volumes:
      - /mnt/docker/gitlab:/home/git/data:Z
      - /etc/localtime:/etc/localtime
solidnerd commented 8 years ago

You should be asked for the password. Try to delete (Make a backup of your Database before) your database and restart the container after the initialization is done. It should work.

adshrc commented 8 years ago

Nope, i've just deleted all volumes, databases (+redis) and re-initialized explicitly with 8.11.6. Same Problem. Is there a method to grant admin rights to a newly created user? (via database or console?)

adshrc commented 8 years ago

Update: I found something interesting in the initialization log with DEBUG=false:

Setting up GitLab for firstrun. Please be patient, this could take a while...
gitlab already exists
rake aborted!
ActiveRecord::StatementInvalid: Mysql2::Error: Cannot delete or update a parent row: a foreign key constraint fails: DROP TABLE `boards` CASCADE
/home/git/gitlab/vendor/bundle/ruby/2.3.0/gems/activerecord-4.2.7.1/lib/active_record/connection_adapters/abstract_mysql_adapter.rb:309:in `query'
/home/git/gitlab/vendor/bundle/ruby/2.3.0/gems/activerecord-4.2.7.1/lib/active_record/connection_adapters/abstract_mysql_adapter.rb:309:in `block in execute'
/home/git/gitlab/vendor/bundle/ruby/2.3.0/gems/activerecord-4.2.7.1/lib/active_record/connection_adapters/abstract_adapter.rb:484:in `block in log'
/home/git/gitlab/vendor/bundle/ruby/2.3.0/gems/activesupport-4.2.7.1/lib/active_support/notifications/instrumenter.rb:20:in `instrument'
/home/git/gitlab/vendor/bundle/ruby/2.3.0/gems/activerecord-4.2.7.1/lib/active_record/connection_adapters/abstract_adapter.rb:478:in `log'
...

Edit: I don't know why it says gitlab already exists, actually i've emptied the database and deleted everything gitlab related on the filesystem

nightcoding commented 8 years ago

I have the exact same problem at the moment. I removed all docker containers, images, the database and the mounted volume.

I think the problem is the first run of rake db:migrate and after that the setup. I even tried it with the image 8.10.7. No error, but even with this version I don't get asked for an password.

solidnerd commented 8 years ago

Hey, this seems to be related with #886. So I will try to fix it asap. I would recommend not to use mysql or mariadb because I doesn't get official support from GitLab itself. So the errors could come from that. But like i said I will try to fix it.

3kami3 commented 8 years ago

Hi. FYI. https://gitlab.com/gitlab-org/gitlab-ce/issues/22733

Workaround I found is this. https://github.com/3kami3/docker-gitlab/commit/4f5f2384800d2200a56c8b8cb185c8ef2175cbc0

stale[bot] commented 4 years ago

This issue has been automatically marked as stale because it has not had any activity for the last 60 days. It will be closed if no further activity occurs during the next 7 days. Thank you for your contributions.