Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Wiki creation returns 500 when project's default branch is not master. #16615

Closed
jkiv opened this issue Aug 4, 2021 · 1 comment · Fixed by #16586
Closed

Wiki creation returns 500 when project's default branch is not master. #16615

jkiv opened this issue Aug 4, 2021 · 1 comment · Fixed by #16586
Labels
issue/duplicate The issue has already been reported.

Comments

@jkiv
Copy link

jkiv commented Aug 4, 2021

  • Gitea version: 1.15.0+rc2
  • Git version: 2.25.1
  • Ubuntu Server 20.04LTS (Linux 5.8.0-1039-azure 42~20.04.1-Ubuntu SMP x86_64)
  • Running Gitea in Docker. Followed docker-compose instructions.
  • Using PostgreSQL version 13.3 (Debian 13.3-1.pgdg100+1)

Symptoms

I've been playing around with Gitea on a local VM.

I created an empty repository called "Test" and set the default branch to "main".

I immediately tried to create a WIki and add a page. I used the default body "Welcome to the Wiki." However, the page title was not populated by default. I named the page "Home" and clicked "Save page".

This produced a page that read "500" and the attached error messages.

I was not able to reproduce on try.gitea.io.

Logs

The resulting log output:

2021/08/04 10:20:44 Started POST /jkiv/Test/wiki/_new for 172.19.0.1:46174
2021/08/04 10:20:44 ...ervices/wiki/wiki.go:93:prepareWikiFileName() [E] exit status 128 - fatal: Not a valid object name master
	
2021/08/04 10:20:44 ...ers/web/repo/wiki.go:616:NewWikiPost() [E] AddWikiPage: exit status 128 - fatal: Not a valid object name master
	
2021/08/04 10:20:44 Completed POST /jkiv/Test/wiki/_new 500 Internal Server Error in 28.04429ms

docker-compose.yml:

The docker-compose.yml:

version: "3"

networks:
  gitea:
    external: false

services:
  server:
    image: gitea/gitea:latest
    container_name: gitea
    environment:
      - USER_UID=13000
      - USER_GID=13000
      - GITEA__database__DB_TYPE=postgres
      - GITEA__database__HOST=db:5432
      - GITEA__database__NAME=gitea
      - GITEA__database__USER=gitea
      - GITEA__database__PASSWD=gitea
    restart: always
    networks:
      - gitea
    volumes:
      - /opt/gitea/data:/data
      - /etc/timezone:/etc/timezone:ro
      - /etc/localtime:/etc/localtime:ro
    ports:
      - "3000:3000"
      - "2222:22"
    depends_on:
      - db

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

app.ini

The app.ini with secrets intentionally removed

APP_NAME = GITEA
RUN_MODE = prod
RUN_USER = git

[repository]
ROOT = /data/git/repositories

[repository.local]
LOCAL_COPY_PATH = /data/gitea/tmp/local-repo

[repository.upload]
TEMP_PATH = /data/gitea/uploads

[server]
APP_DATA_PATH    = /data/gitea
DOMAIN           = localhost
SSH_DOMAIN       = localhost
HTTP_PORT        = 3000
ROOT_URL         = http://gitea/
DISABLE_SSH      = false
SSH_PORT         = 22
SSH_LISTEN_PORT  = 22
LFS_START_SERVER = true
LFS_CONTENT_PATH = /data/git/lfs
LFS_JWT_SECRET   = <removed>
OFFLINE_MODE     = true

[database]
PATH     = /data/gitea/gitea.db
DB_TYPE  = postgres
HOST     = db:5432
NAME     = gitea
USER     = gitea
PASSWD   = gitea
LOG_SQL  = false
SCHEMA   = 
SSL_MODE = disable
CHARSET  = utf8

[indexer]
ISSUE_INDEXER_PATH = /data/gitea/indexers/issues.bleve

[session]
PROVIDER_CONFIG = /data/gitea/sessions
PROVIDER        = file

[picture]
AVATAR_UPLOAD_PATH            = /data/gitea/avatars
REPOSITORY_AVATAR_UPLOAD_PATH = /data/gitea/repo-avatars
DISABLE_GRAVATAR              = true
ENABLE_FEDERATED_AVATAR       = false

[attachment]
PATH = /data/gitea/attachments

[log]
MODE      = console
LEVEL     = info
ROUTER    = console
ROOT_PATH = /data/gitea/log

[security]
INSTALL_LOCK                  = true
SECRET_KEY                    = <removed>
REVERSE_PROXY_LIMIT           = 1
REVERSE_PROXY_TRUSTED_PROXIES = *
INTERNAL_TOKEN                = <removed>
PASSWORD_HASH_ALGO            = pbkdf2

[service]
DISABLE_REGISTRATION              = false
REQUIRE_SIGNIN_VIEW               = false
REGISTER_EMAIL_CONFIRM            = false
ENABLE_NOTIFY_MAIL                = false
ALLOW_ONLY_EXTERNAL_REGISTRATION  = true
ENABLE_CAPTCHA                    = false
DEFAULT_KEEP_EMAIL_PRIVATE        = false
DEFAULT_ALLOW_CREATE_ORGANIZATION = false
DEFAULT_ENABLE_TIMETRACKING       = true
NO_REPLY_ADDRESS                  = hidden.gitea.hyperv.local

[mailer]
ENABLED = false

[openid]
ENABLE_OPENID_SIGNIN = false
ENABLE_OPENID_SIGNUP = false

Screenshots

The repo:

1

Creating the wiki:

2

No default title (unlike try.gitea.io):

3

Before submitting:

4

After submitting:

5

@zeripath
Copy link
Contributor

zeripath commented Aug 4, 2021

Fixed by #16586 and its backport #16598 which will be in rc3.

@zeripath zeripath added the issue/duplicate The issue has already been reported. label Aug 4, 2021
@zeripath zeripath closed this as completed Aug 4, 2021
@go-gitea go-gitea locked and limited conversation to collaborators Oct 19, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
issue/duplicate The issue has already been reported.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants