Skip to content

Error when creating new repo: branch does not have any commits #18413

Closed
@mmoomocow

Description

@mmoomocow

Gitea Version

1.16.0+rc1

Git Version

2.30.2

Operating System

Ubuntu server 20.04.3 LTS

How are you running Gitea?

Running on docker, config file:

version: "3"

networks:
  gitea:
    external: false

services:
  server:
    image: gitea/gitea:latest
    container_name: gitea
    environment:
      - USER_UID=1004
      - USER_GID=1005
      - GITEA__SERVER__DOMAIN=git.example.com
      - GITEA__SERVER__ROOT_URL=https://git.example.com
      - GITEA__database__DB_TYPE=postgres
      - GITEA__database__HOST=db:5432
      - GITEA__database__NAME=gitea
      - GITEA__database__USER=gitea
      - GITEA__database__PASSWD=password
      - GITEA__mailer__ENABLED=true
      - GITEA__mailer__FROM=noreply@example.com
      - GITEA__mailer__MAILER_TYPE=smtp
      - GITEA__mailer__HOST=smtp.example.com:465
      - GITEA__mailer__IS_TLS_ENABLED=true
      - GITEA__mailer__USER=noreply@example.com
      - GITEA__mailer__PASSWD=password
      - GITEA__service__DEFAULT_BRANCH=main
      - GITEA__security__DISABLE_GIT_HOOKS=false
    restart: always
    networks:
      - gitea
    volumes:
      - ./gitea:/data
      - /etc/timezone:/etc/timezone:ro
      - /etc/localtime:/etc/localtime:ro
      - /home/git/.ssh/:/data/git/.ssh
    ports:
      - "8095:3000"
      - "127.0.0.1:2222:22"
    depends_on:
      - db

  db:
    image: postgres:13
    restart: always
    environment:
      - POSTGRES_USER=gitea
      - POSTGRES_PASSWORD=password
      - POSTGRES_DB=gitea
    networks:
      - gitea
    volumes:
      - ./postgres:/var/lib/postgresql/data

Database

PostGres

Can you reproduce the bug on the Gitea demo site?

Yes

Log Gist

https://gist.github.com/mmoomocow/6eb9413b0d756551ebe8b225a890e730

Description

I created a repo, and set the default branch to main
Then when attempting to view the repo it shows error 500 and the error appears in the logs.
Repo on demo site mmoomocow/test

Screenshots

image

Metadata

Metadata

Assignees

No one assigned

    Labels

    issue/confirmedIssue has been reviewed and confirmed to be present or accepted to be implementedtype/bug

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions