When i run 'git push -u origin master' will get this error message:'pre-receive hook declined' #1291

Closed
opened 2025-11-02 03:55:41 -06:00 by GiteaMirror · 5 comments
Owner

Originally created by @Mr9esx on GitHub (Nov 29, 2017).

  • Gitea version (or commit ref):f148a4a
  • Git version:1.9.2
  • Operating system:Ubuntu Server 16.04 LTS
  • Database (use [x]):
    • PostgreSQL
    • MySQL
    • MSSQL
    • SQLite
  • Can you reproduce the bug at https://try.gitea.io:
    • Yes (provide example URL)
    • No
    • Not relevant
  • Log gist:

Description

I install gitea with docker,create a new repository on the website,when i run git push -u origin master
get that error message:

 ! [remote rejected] master -> master (pre-receive hook declined)
error: failed to push some refs to 'http://192.168.10.130:10080/mr9esx/test.git'

The command of created the docker container:
sudo docker run -d --name=gitea_service --restart always -p 10022:22 -p 10080:3000 -v /mnt/gitea:/data gitea/gitea:latest

This is my app.ini setting:

APP_NAME = Mr9esx's Github
RUN_MODE = prod
RUN_USER = git

[repository]
ROOT = /data/git/repositories

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

[server]
APP_DATA_PATH    = /data/gitea
SSH_DOMAIN       = 192.168.10.130
HTTP_PORT        = 10080
ROOT_URL         = http://192.168.10.130:10080/
DISABLE_SSH      = false
SSH_PORT         = 10022
DOMAIN           = 192.168.10.130
LFS_START_SERVER = true
LFS_CONTENT_PATH = /data/gitea/lfs
LFS_JWT_SECRET   = oShOkBDcrn5Vdg-J_4UNQtYpCQEVVoNVWYQOyA-nhHM
OFFLINE_MODE     = true

[database]
PATH     = /data/gitea/gitea.db
DB_TYPE  = sqlite3
HOST     = localhost:3306
NAME     = gitea
USER     = root
PASSWD   = 
SSL_MODE = disable

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

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

[attachment]
PATH = /data/gitea/attachments

[log]
ROOT_PATH = /data/gitea/log
MODE      = file
LEVEL     = Info

[security]
INSTALL_LOCK   = true
SECRET_KEY     = 31oMSbCLSG
INTERNAL_TOKEN = eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJuYmYiOjE1MTE5MjMzNDZ9.6wAReQJgEfCpKetJr0A6bO1vi4vWQV_0opb10JdIn6Q

[mailer]
ENABLED = false

[service]
REGISTER_EMAIL_CONFIRM            = false
ENABLE_NOTIFY_MAIL                = false
DISABLE_REGISTRATION              = true
ENABLE_CAPTCHA                    = false
REQUIRE_SIGNIN_VIEW               = true
DEFAULT_KEEP_EMAIL_PRIVATE        = false
DEFAULT_ALLOW_CREATE_ORGANIZATION = true
DEFAULT_ENABLE_TIMETRACKING       = true
NO_REPLY_ADDRESS                  = noreply.example.org

[openid]
ENABLE_OPENID_SIGNIN = true
ENABLE_OPENID_SIGNUP = false

Originally created by @Mr9esx on GitHub (Nov 29, 2017). <!-- 1. Please speak English, this is the language all of us can speak and write. 2. Please ask questions or configuration/deploy problems on our Discord server (https://discord.gg/NsatcWJ) or forum (https://discourse.gitea.io). 3. Please take a moment to check that your issue doesn't already exist. 4. Please give all relevant information below for bug reports, because incomplete details will be handled as an invalid report. --> - Gitea version (or commit ref):f148a4a - Git version:1.9.2 - Operating system:Ubuntu Server 16.04 LTS - Database (use `[x]`): - [ ] PostgreSQL - [ ] MySQL - [ ] MSSQL - [x] SQLite - Can you reproduce the bug at https://try.gitea.io: - [x] Yes (provide example URL) - [ ] No - [ ] Not relevant - Log gist: ## Description I install gitea with docker,create a new repository on the website,when i run `git push -u origin master` get that error message: ``` ! [remote rejected] master -> master (pre-receive hook declined) error: failed to push some refs to 'http://192.168.10.130:10080/mr9esx/test.git' ``` The command of created the docker container: ```sudo docker run -d --name=gitea_service --restart always -p 10022:22 -p 10080:3000 -v /mnt/gitea:/data gitea/gitea:latest``` This is my app.ini setting: ``` APP_NAME = Mr9esx's Github RUN_MODE = prod RUN_USER = git [repository] ROOT = /data/git/repositories [repository.upload] TEMP_PATH = /data/gitea/uploads [server] APP_DATA_PATH = /data/gitea SSH_DOMAIN = 192.168.10.130 HTTP_PORT = 10080 ROOT_URL = http://192.168.10.130:10080/ DISABLE_SSH = false SSH_PORT = 10022 DOMAIN = 192.168.10.130 LFS_START_SERVER = true LFS_CONTENT_PATH = /data/gitea/lfs LFS_JWT_SECRET = oShOkBDcrn5Vdg-J_4UNQtYpCQEVVoNVWYQOyA-nhHM OFFLINE_MODE = true [database] PATH = /data/gitea/gitea.db DB_TYPE = sqlite3 HOST = localhost:3306 NAME = gitea USER = root PASSWD = SSL_MODE = disable [session] PROVIDER_CONFIG = /data/gitea/sessions PROVIDER = file [picture] AVATAR_UPLOAD_PATH = /data/gitea/avatars DISABLE_GRAVATAR = true ENABLE_FEDERATED_AVATAR = false [attachment] PATH = /data/gitea/attachments [log] ROOT_PATH = /data/gitea/log MODE = file LEVEL = Info [security] INSTALL_LOCK = true SECRET_KEY = 31oMSbCLSG INTERNAL_TOKEN = eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJuYmYiOjE1MTE5MjMzNDZ9.6wAReQJgEfCpKetJr0A6bO1vi4vWQV_0opb10JdIn6Q [mailer] ENABLED = false [service] REGISTER_EMAIL_CONFIRM = false ENABLE_NOTIFY_MAIL = false DISABLE_REGISTRATION = true ENABLE_CAPTCHA = false REQUIRE_SIGNIN_VIEW = true DEFAULT_KEEP_EMAIL_PRIVATE = false DEFAULT_ALLOW_CREATE_ORGANIZATION = true DEFAULT_ENABLE_TIMETRACKING = true NO_REPLY_ADDRESS = noreply.example.org [openid] ENABLE_OPENID_SIGNIN = true ENABLE_OPENID_SIGNUP = false ```
Author
Owner

@lunny commented on GitHub (Nov 29, 2017):

related with #2270

@lunny commented on GitHub (Nov 29, 2017): related with #2270
Author
Owner

@Mr9esx commented on GitHub (Nov 29, 2017):

fixed!
sudo docker run -d --name=gitea_service --restart always -p 10022:22 -p 10080:3000 -v /mnt/gitea:/data gitea/gitea:latest

to

sudo docker run -d --name=gitea_service --restart always -p 10022:22 -p 3000:3000 -v /mnt/gitea:/data gitea/gitea:latest

@Mr9esx commented on GitHub (Nov 29, 2017): fixed! ```sudo docker run -d --name=gitea_service --restart always -p 10022:22 -p 10080:3000 -v /mnt/gitea:/data gitea/gitea:latest``` to ```sudo docker run -d --name=gitea_service --restart always -p 10022:22 -p 3000:3000 -v /mnt/gitea:/data gitea/gitea:latest```
Author
Owner

@BarbosaThaKid727 commented on GitHub (Sep 4, 2019):

Hi I am having the same issue, I have tried to apply the solution provided here #2270 still having issues.
Its a new install.

@BarbosaThaKid727 commented on GitHub (Sep 4, 2019): Hi I am having the same issue, I have tried to apply the solution provided here #2270 still having issues. Its a new install.
Author
Owner

@BarbosaThaKid727 commented on GitHub (Sep 4, 2019):

I'm running Windows Server 2012

@BarbosaThaKid727 commented on GitHub (Sep 4, 2019): I'm running Windows Server 2012
Author
Owner

@BarbosaThaKid727 commented on GitHub (Sep 4, 2019):

APP_NAME = <>
RUN_USER = <<RUN_USER>>
RUN_MODE = prod

[oauth2]
JWT_SECRET = [...]

[security]
INTERNAL_TOKEN = [...]
INSTALL_LOCK = true
SECRET_KEY = [...]

[database]
DB_TYPE = postgres
HOST = 127.0.0.1:5432
NAME = gitea
USER = user
PASSWD = [...]
SSL_MODE = disable
CHARSET = utf8
PATH = C:\gitea\data\gitea.db

[repository]
ROOT = C:/gitea/gitea-repositories

[server]
SSH_DOMAIN = localhost
DOMAIN = localhost
HTTP_PORT = 3000
ROOT_URL = http://server-name:3000/
DISABLE_SSH = false
SSH_PORT = 22
LFS_START_SERVER = true
LFS_CONTENT_PATH = C:/gitea/data/lfs
LFS_JWT_SECRET = [...]
OFFLINE_MODE = false
LOCAL_ROOT_URL = http://localhost:3000/

[mailer]
ENABLED = false

@BarbosaThaKid727 commented on GitHub (Sep 4, 2019): APP_NAME = <<APP NAME>> RUN_USER = <<RUN_USER>> RUN_MODE = prod [oauth2] JWT_SECRET = [...] [security] INTERNAL_TOKEN = [...] INSTALL_LOCK = true SECRET_KEY = [...] [database] DB_TYPE = postgres HOST = 127.0.0.1:5432 NAME = gitea USER = user PASSWD = [...] SSL_MODE = disable CHARSET = utf8 PATH = C:\gitea\data\gitea.db [repository] ROOT = C:/gitea/gitea-repositories [server] SSH_DOMAIN = localhost DOMAIN = localhost HTTP_PORT = 3000 ROOT_URL = http://server-name:3000/ DISABLE_SSH = false SSH_PORT = 22 LFS_START_SERVER = true LFS_CONTENT_PATH = C:/gitea/data/lfs LFS_JWT_SECRET = [...] OFFLINE_MODE = false LOCAL_ROOT_URL = http://localhost:3000/ [mailer] ENABLED = false
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: github-starred/gitea#1291