500 error after restarting docker swarm service

I can do a fresh install of gogs in my docker swarm using the web interface to configure. I can create multiple users and they can log in. It all ends when I restart my service or try to update it. Then I get a 500 error.

2019/11/20 21:28:42 [ INFO] Gogs 0.11.97.1116
2019/11/20 21:28:42 [ INFO] Cache Service Enabled
2019/11/20 21:28:42 [ INFO] Session Service Enabled
2019/11/20 21:28:42 [ INFO] Git Version: 2.22.0
2019/11/20 21:28:42 [ INFO] Git config user.name set to Gogs
2019/11/20 21:28:42 [ INFO] Git config user.email set to [email protected]
2019/11/20 21:28:42 [ INFO] SQLite3 Supported
2019/11/20 21:28:42 [ INFO] Run Mode: Production
2019/11/20 21:28:42 [ INFO] First-time run install finished!
2019/11/20 21:29:56 [ INFO] Gogs 0.11.97.1116
2019/11/20 21:29:56 [ INFO] Cache Service Enabled
2019/11/20 21:29:56 [ INFO] Session Service Enabled
2019/11/20 21:29:56 [ INFO] Git Version: 2.22.0
2019/11/20 21:29:56 [ INFO] SQLite3 Supported
2019/11/20 21:29:56 [ INFO] Run Mode: Production
2019/11/20 21:29:56 [ INFO] Listen: http://0.0.0.0:3000

I don’t see anything in the log. The xorm log is empty. I am building gogs commit 59e9a87d9561c0c4b042250566e34fc4bee02828 using the Dockerfile in the root folder and this docker-compose.yml

version: "3"
  
services:
  gogs:
    image: localhost:5000/gogs
    build: .
    volumes:
      - /g/gogsspace:/data
    networks:
      - sandbox

networks:
  sandbox:
    external: true

I am using the sqlite database option.

The strange thing is that it worked reliably until a few days ago. I had a copy based on commit ddc7a2d that I added a route to and a couple of user dashboard buttons. When it stopped working and I couldn’t see why in my code I checked out 59e9a87 and am getting the same error in an un-modified copy of that.

Hi,

Which log files have you checked? Every 500 error guaranteed to print a log of the error message.

Thanks for replying. I just solved it by chown -R git /app/gogs towards the end of the Dockerfile. It was a permission problem with macaron session .

1 Like