[Resolved] | [Gogs] Error 502 : Bad gateway

Hello,

I installed Gogs on my server some days ago and I could play with it quite well. However, I had to reboot the little machine. After that, Whatever I do, I always encounter that Error 502. I am thinking that there could be some file to delete, but I am not sure.

Did some of you have the same error ?
I am sorry, I wrote the short version, the extensive informations are available below :

I know mbugeia has a life, so I am know turning up to you, because i’d really like to learn git on my own server with private projects, and publish them on my Github account when it’s a reeaally public. Everything is about learning. I finished school some weeks ago, and I do not allow myself to let my brain die in any way.

I digged as long as I could, and I do not want to break my server again, so I didn’t try anything quite risky.

Cheers ! :smiley:

Hello,

Have you tried to launch this command : sudo service gogs start
I don’t know why but sometime gogs don’t start automaticaly when we reboot the server.

:grinning:

Yes I did. But the error remains. :confused:

I see nothing wrong with your logs, i got pretty much the same (even the ldap error) but gogs works fine on my server.

Maybe nginx error logs about the domain upon which gogs is installed would be more useful…?

Yes. There are errors on it :

2015/11/23 21:28:06 [error] 31571#0: *18825 connect() failed (111: Connection refused) while connecting to upstream, client: *IP*, server: git.krands.be, request: "GET /g/ HTTP/1.1", upstream: "http://[::1]:6000/", host: "git.krands.be", referrer: "https://krands.be/yunohost/sso/"
2015/11/24 21:48:52 [error] 31573#0: *28500 connect() failed (111: Connection refused) while connecting to upstream, client: *IP*, server: git.krands.be, request: "GET /g/ HTTP/1.1", upstream: "http://[::1]:6000/", host: "git.krands.be", referrer: "https://krands.be/yunohost/sso/"
2015/11/24 21:48:56 [error] 31573#0: *28500 connect() failed (111: Connection refused) while connecting to upstream, client: *IP*, server: git.krands.be, request: "GET /g/admin HTTP/1.1", upstream: "http://[::1]:6000/admin", host: "git.krands.be"
2015/11/24 21:49:01 [error] 31573#0: *28500 connect() failed (111: Connection refused) while connecting to upstream, client: *IP*, server: git.krands.be, request: "GET /g/?admin HTTP/1.1", upstream: "http://[::1]:6000/?admin", host: "git.krands.be"
2015/11/25 21:20:55 [error] 31573#0: *32596 connect() failed (111: Connection refused) while connecting to upstream, client: *IP*, server: git.krands.be, request: "GET /g/ HTTP/1.1", upstream: "http://[::1]:6000/", host: "git.krands.be", referrer: "https://krands.be/yunohost/sso/"
2015/11/25 21:25:27 [error] 31573#0: *32649 connect() failed (111: Connection refused) while connecting to upstream, client: 2a02:a03f:c76:d800:f606:69ff:fe0c:1d4a, server: git.krands.be, request: "GET /g/ HTTP/1.1", upstream: "http://[::1]:6000/", host: "git.krands.be", referrer: "https://krands.be/yunohost/sso/"
2015/11/26 08:48:01 [error] 31572#0: *34046 connect() failed (111: Connection refused) while connecting to upstream, client: 193.190.77.225, server: git.krands.be, request: "GET /g/ HTTP/1.1", upstream: "http://[::1]:6000/", host: "git.krands.be", referrer: "https://krands.be/yunohost/sso/"

So there are things to reload or delete, which makes it difficult for it to load ?

I see nothing wrong with your logs, i got pretty much the same (even the ldap error) but gogs works fine on my server.

It did, before I reboot the machine :confused:

EDIT : I installed Gogs once, after the reboot, I couldn’t access to it. When I saw that, I reinstalled Gogs to make sure there where new files in it.

When you uninstall an app, are there remaining files ? It’s like something need to be deleted somewhere and/or refresh it.

Double post. Sorry.

Actually, the solution was among the easiest possible in the world.

service nginx restart

That’s all.
But I don’t think that the fact I reinstalled and deleted anything about gogs has anything to do.

Sorry for the waste of time. :sweat:

1 Like

(Yeah I know, one year later :D)

No need to restart, a simple reload does the job too :wink:

I have the same issue, after every server reboot (and the gogs service is running fine). That’s not normal.
Does someone knows how to solve this issue ?