Lokasi ngalangkungan proxy:   [ UP ]  
[Ngawartoskeun bug]   [Panyetelan cookie]                
Skip to content

Bad Gateway 502 error - nginx #17

Closed

Description

@riaanvddool

After new install I get a 502 Bad Gateway error. This problem is described here: https://github.com/gitlabhq/gitlabhq/issues/1527

I noticed that #5 addresses this issue, but even with a timeout of 600 I get the 502 error.

What should I try next?

Activity

  1. sameersbn commented on Feb 3, 2014

    @sameersbn
    Owner

    Please make sure that you are allowing the application enough time to start.
    A typical docker log will look like this https://gist.github.com/sameersbn/b5b99fb72ed4eb22908f

    You have to wait until you see the below lines in the log.

    --2014-02-03 10:20:55--  http://localhost/
    Resolving localhost (localhost)... ::1, 127.0.0.1
    Connecting to localhost (localhost)|::1|:80... failed: Connection refused.
    Connecting to localhost (localhost)|127.0.0.1|:80... connected.
    HTTP request sent, awaiting response... 302 Found
    Location: http://localhost/users/sign_in [following]
    --2014-02-03 10:20:55--  http://localhost/users/sign_in
    Reusing existing connection to localhost:80.
    HTTP request sent, awaiting response... 200 OK
    Length: unspecified [text/html]
    Saving to: `/dev/null'
    
         0K ..                                                      347M=0s
    
    2014-02-03 10:20:56 (347 MB/s) - `/dev/null' saved [2589]
    

    If you make requests to the gitlab application before this you will see the 500 errors since the application has not started yet, but should respond correctly once its up. Please check if this is the case.

    If you are still seeing this issue then just try restarting the container.
    A few people have reported this issue but they have found that restarting the container fixes this issue. I think that its got something with gitlab.

    If you are seeing this issue consistently, try running the image without any arguments

    docker run -i -t sameersbn/gitlab

    If you do not see the issue after this, then maybe it could be a problem with the application arguments.

  2. riaanvddool commented on Feb 3, 2014

    @riaanvddool
    Author

    OK, I will try that.

    This is what I see in unicorn.stderr.log:

    I, [2014-02-03T11:10:18.193141 #234]  INFO -- : Refreshing Gem list
    fatal: Not a git repository (or any of the parent directories): .git
    /home/git/gitlab/vendor/bundle/ruby/2.0.0/gems/mysql2-0.3.11/lib/mysql2/client.rb:44:in `connect': Host '172.17.42.1' is blocked because of many connection errors; unblock with 'mysqladmin flush-hosts' (Mysql2::Error)
    
  3. riaanvddool commented on Feb 3, 2014

    @riaanvddool
    Author

    Via docker logs:

    fatal: Not a git repository (or any of the parent directories): .git
    rake aborted!
    Host '172.17.42.1' is blocked because of many connection errors; unblock with 'mysqladmin flush-hosts'
    

    Later on in the log:

    --2014-02-03 11:40:19--  http://localhost/
    Resolving localhost (localhost)... ::1, 127.0.0.1
    Connecting to localhost (localhost)|::1|:80... failed: Connection refused.
    Connecting to localhost (localhost)|127.0.0.1|:80... connected.
    HTTP request sent, awaiting response... 502 Bad Gateway
    2014-02-03 11:40:19 ERROR 502: Bad Gateway.
    
  4. sameersbn commented on Feb 3, 2014

    @sameersbn
    Owner

    @riaanvddool If the mysql error, can you add the parameter

    -e "DB_POOL=10"

    to the run command and retry. If it still does not work, try increasing the number.

  5. riaanvddool commented on Feb 3, 2014

    @riaanvddool
    Author

    I restarted the (separate) mysql docker and the "is blocked because of many connection errors" message disappeared.

    Now I get:

    Access denied for user 'gitlab'@'172.17.42.1' (using password: YES)
    

    Looking into that now...

  6. sameersbn commented on Feb 3, 2014

    @sameersbn
    Owner

    @riaanvddool You mean you are using the mysql docker container? i.e. https://github.com/sameersbn/docker-mysql
    If yes, then edit the https://github.com/sameersbn/docker-mysql/blob/master/resources/setup/commands.sql file appropriately and rebuild the mysql docker images.

  7. riaanvddool commented on Feb 4, 2014

    @riaanvddool
    Author

    I am using https://github.com/orchardup/docker-mysql.

    The problem seemed to be with a line in https://github.com/orchardup/docker-mysql/blob/master/run

    GRANT ALL PRIVILEGES ON . TO 'root'@'%';
    should have read
    GRANT ALL PRIVILEGES ON . TO 'root'@'%' WITH GRANT OPTION;

    The omission of the "WITH GRANT OPTION" part stopped root from granting privileges to the gitlab user.

    I see that in your file (https://github.com/sameersbn/docker-mysql/blob/master/resources/setup/commands.sql) you have the "WITH GRANT OPTION" part.

    Thanks for the pointers, I hope this might help someone else.

  8. sameersbn commented on Feb 4, 2014

    @sameersbn
    Owner

    @riaanvddool glad to hear that the issue is resolved for you.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions