Push issue: "pre-receive hook declined" on fresh install

Hi

I’m facing the following issue on a fresh Gitea install (version 1.15.7; git version 2.34.1) when I push a new repo to gitea:

Énumération des objets: 3, fait.
Décompte des objets: 100% (3/3), fait.
Écriture des objets: 100% (3/3), 236 octets | 236.00 Kio/s, fait.
Total 3 (delta 0), réutilisés 0 (delta 0), réutilisés du pack 0
remote:
remote: Gitea: Internal Server Error
remote: Gitea: Internal Server Error
To https://---/---/test01.git
 ! [remote rejected] master -> master (pre-receive hook declined)
error: impossible de pousser des références vers 'https://---/---/test01.git'

The repository is created on gitea, but remains empty …
I don’t see any particular error related to the “remote: Gitea: Internal Server Error” message in the gitea log file:

2021/12/18 11:16:57 Started GET /---/test01.git/info/refs?service=git-receive-pack for 192.168.1.147:35292
2021/12/18 11:16:57 ...s/context/context.go:751:1() [D] Session ID: aa689893b5e85e84
2021/12/18 11:16:57 ...s/context/context.go:752:1() [D] CSRF Token: ---
2021/12/18 11:16:57 ...rvices/auth/basic.go:73:Verify() [T] Basic Authorization: Attempting login for: ---
2021/12/18 11:16:57 ...rvices/auth/basic.go:118:Verify() [T] Basic Authorization: Attempting SignIn for ---
2021/12/18 11:16:57 ...rvices/auth/basic.go:127:Verify() [T] Basic Authorization: Logged in user 1:---
2021/12/18 11:16:57 ...dules/git/command.go:120:RunInDirTimeoutEnvFullPipelineFunc() [D] /tmp/gitea-info-refs-cache3887987510: /usr/bin/git -c credential.helper= -c protocol.version=2 -c mudge= -c filter.lfs.clean= init --bare
2021/12/18 11:16:57 ...dules/git/command.go:206:RunInDirTimeoutEnv() [T] Stdout:
         Initialized empty Git repository in /tmp/gitea-info-refs-cache3887987510/

2021/12/18 11:16:57 ...dules/git/command.go:120:RunInDirTimeoutEnvFullPipelineFunc() [D] /tmp/gitea-info-refs-cache3887987510: /usr/bin/git -c credential.helper= -c protocol.version=2 -c mudge= -c filter.lfs.clean= receive-pack --stateless-rpc --advertise-refs .
2021/12/18 11:16:57 ...dules/git/command.go:206:RunInDirTimeoutEnv() [T] Stdout:
         00ad0000000000000000000000000000000000000000 capabilities^{}\003dreport-status delete-refs side-band-64k quiet atomic ofs-delta push-options object-format=sha1 agent=git/2.28.0
        0000
2021/12/18 11:16:57 ...ers/web/repo/http.go:328:func1() [D] populating infoRefsCache:
        00ad0000000000000000000000000000000000000000 capabilities^{}\003dreport-status delete-refs side-band-64k quiet atomic ofs-delta push-options object-format=sha1 agent=git/2.28.0
        0000
2021/12/18 11:16:57 Completed GET /---/test01.git/info/refs?service=git-receive-pack 200 OK in 141.467355ms
2021/12/18 11:16:57 Started POST /---/test01.git/git-receive-pack for 192.168.1.147:35294
2021/12/18 11:16:57 ...s/context/context.go:751:1() [D] Session ID: ---
2021/12/18 11:16:57 ...s/context/context.go:752:1() [D] CSRF Token: ---
2021/12/18 11:16:57 ...rvices/auth/basic.go:73:Verify() [T] Basic Authorization: Attempting login for: ---
2021/12/18 11:16:57 ...rvices/auth/basic.go:118:Verify() [T] Basic Authorization: Attempting SignIn for ---
2021/12/18 11:16:58 ...rvices/auth/basic.go:127:Verify() [T] Basic Authorization: Logged in user 1:---
2021/12/18 11:16:58 ...dules/git/command.go:120:RunInDirTimeoutEnvFullPipelineFunc() [D] /var/lib/gitea/data/gitea-repositories/---/test01.git: /usr/bin/git -c credential.helper= -c uired= -c filter.lfs.smudge= -c filter.lfs.clean= init --bare
2021/12/18 11:16:58 ...dules/git/command.go:206:RunInDirTimeoutEnv() [T] Stdout:
         Initialized empty Git repository in /var/lib/gitea/data/gitea-repositories/---/test01.git/

2021/12/18 11:16:58 ...dules/git/command.go:120:RunInDirTimeoutEnvFullPipelineFunc() [D] /var/lib/gitea/data/gitea-repositories/---/test01.git: /usr/bin/git -c credential.helper= -c uired= -c filter.lfs.smudge= -c filter.lfs.clean= symbolic-ref HEAD refs/heads/master
2021/12/18 11:16:58 ...dules/git/command.go:120:RunInDirTimeoutEnvFullPipelineFunc() [D] /var/lib/gitea/data/gitea-repositories/---/test01.git: /usr/bin/git -c credential.helper= -c uired= -c filter.lfs.smudge= -c filter.lfs.clean= cat-file --batch
2021/12/18 11:16:58 ...dules/git/command.go:120:RunInDirTimeoutEnvFullPipelineFunc() [D] /var/lib/gitea/data/gitea-repositories/---/test01.git: /usr/bin/git -c credential.helper= -c uired= -c filter.lfs.smudge= -c filter.lfs.clean= cat-file --batch-check
2021/12/18 11:16:58 ...dules/git/command.go:120:RunInDirTimeoutEnvFullPipelineFunc() [D] /var/lib/gitea/data/gitea-repositories/---/test01.git: /usr/bin/git -c credential.helper= -c uired= -c filter.lfs.smudge= -c filter.lfs.clean= update-server-info
2021/12/18 11:16:58 models/repo.go:349:getUnits() [T] repo.Units: [0xc0039a2b40 0xc003a0e570 0xc00410ccc0 0xc00435cd50 0xc0045176b0 0xc00333b080]
2021/12/18 11:16:58 ...s/webhook/deliver.go:229:DeliverHooks() [T] DeliverHooks [repo_id: 1]
2021/12/18 11:16:58 ...s/repo_permission.go:154:func1() [T] Permission Loaded for 1:--- in 1:---/test01:
        Permissions: AccessMode: 4:owner, 6 Units, 0 UnitsMode(s): [
        Units[0]: ID: 1 RepoID: 1 Type: 1:UnitTypeCode Config: {}
        Units[1]: ID: 2 RepoID: 1 Type: 2:UnitTypeIssues Config: {"EnableTimetracker":true,"AllowOnlyContributorsToTrackTime":true,"EnableDependencies":true}
        Units[2]: ID: 3 RepoID: 1 Type: 3:UnitTypePullRequests Config: {"IgnoreWhitespaceConflicts":false,"AllowMerge":true,"AllowRebase":true,"AllowRebaseMerge":true,"AllowSquash":true,ManualMerge":false,"DefaultDeleteBranchAfterMerge":false,"DefaultMergeStyle":"merge"}
        Units[3]: ID: 4 RepoID: 1 Type: 4:UnitTypeReleases Config: {}
        Units[4]: ID: 5 RepoID: 1 Type: 5:UnitTypeWiki Config: {}
        Units[5]: ID: 6 RepoID: 1 Type: 8:UnitTypeProjects Config: {} ]
2021/12/18 11:16:58 Completed POST /---/test01.git/git-receive-pack 200 OK in 779.743236ms

I’ve also run gitea -c /etc/gitea/app.ini doctor -all, but it didn’t notice any issue:

[1] Check paths and basic configuration
 - [I] Configuration File Path:    "/etc/gitea/app.ini"
 - [I] Repository Root Path:       "/var/lib/gitea/data/gitea-repositories"
 - [I] Data Root Path:             "/var/lib/gitea/data"
 - [I] Custom File Root Path:      "/var/lib/gitea/custom"
 - [I] Work directory:             "/var/lib/gitea/"
 - [I] Log Root Path:              "/var/lib/gitea/log"
OK
[2] Check if there is garbage storage files
OK
[3] Check Database Version
OK
[4] Check consistency of database
OK
[5] Check if user with wrong type exist
OK
[6] Check if OpenSSH authorized_keys file is up-to-date
OK
[7] Check if SCRIPT_TYPE is available
 - [I] ScriptType bash is on the current PATH at /usr/sbin/bash
OK
[8] Check if hook files are up-to-date and executable
OK
[9] Recalculate Stars number for all user
OK
[10] Check old archives
 - [I] 0 old archives in repository need to be deleted
OK
[11] Enable push options
 - [I] Checked 0 repositories, 0 need updates.
OK
[12] Check for incorrectly dumped repo_units (See #16961)
 - [W] Found 0 broken repo_units
OK
[13] Recalculate merge bases
 - [W] 0 PRs with incorrect mergebases of 0 PRs total in 0 repos
OK
[14] Check git-daemon-export-ok files
 - [I] Checked 0 repositories, 0 need updates.
OK

Here is my gitea config file:

APP_NAME = Gitea: Git with a cup of tea
RUN_USER = gitea
RUN_MODE = prod

[repository]
ROOT                    = /var/lib/gitea/data/gitea-repositories
ENABLE_PUSH_CREATE_USER = true
ENABLE_PUSH_CREATE_ORG  = true

[server]
PROTOCOL            = http
DOMAIN              = my.domain.com
ROOT_URL            = https://my.domain.com/
HTTP_ADDR           = 0.0.0.0
HTTP_PORT           = 3000
REDIRECT_OTHER_PORT = false
LOCAL_ROOT_URL      = http://localhost:3000
DISABLE_SSH         = false
START_SSH_SERVER    = true
LFS_START_SERVER    = true
LFS_MAX_FILE_SIZE   = 0
SSH_DOMAIN          = my.domain.com
SSH_PORT            = 22
OFFLINE_MODE        = false
LFS_JWT_SECRET      = ---
LFS_CONTENT_PATH    = /var/lib/gitea/data/lfs

[database]
DB_TYPE  = sqlite3
HOST     = 127.0.0.1:3306
NAME     = gitea
USER     = gitea
CHARSET  = utf8
PATH     = /var/lib/gitea/data/gitea.db
LOG_SQL  = false

[openid]
ENABLE_OPENID_SIGNUP = false
ENABLE_OPENID_SIGNIN = false

[service]
ALLOW_ONLY_EXTERNAL_REGISTRATION  = false
ENABLE_NOTIFY_MAIL                = false
DISABLE_REGISTRATION              = true
ENABLE_CAPTCHA                    = false
DEFAULT_KEEP_EMAIL_PRIVATE        = false
DEFAULT_ALLOW_CREATE_ORGANIZATION = true
DEFAULT_ENABLE_TIMETRACKING       = true
NO_REPLY_ADDRESS                  = noreply.my.domain.com
SHOW_REGISTRATION_BUTTON          = false
REGISTER_EMAIL_CONFIRM            = false
REQUIRE_SIGNIN_VIEW               = true

[service.explore]
REQUIRE_SIGNIN_VIEW = true

[log]
ROOT_PATH = /var/lib/gitea/log
MODE      = console
LEVEL     = trace
ROUTER    = console

[security]
INTERNAL_TOKEN     = ---
INSTALL_LOCK       = true
SECRET_KEY         = ---
PASSWORD_HASH_ALGO = pbkdf2

[mailer]
ENABLED = false

[picture]
DISABLE_GRAVATAR        = false
ENABLE_FEDERATED_AVATAR = true

[session]
PROVIDER = file

[git]
PATH = /usr/bin/git

What am I missing ? Does anyone have an idea ?

Change prod to dev and push again, then you will see the error log returned.

I’ve switched RUN_MODE to dev but there isn’t any failure reported in the log, here is my gitea startup log:

2021/12/19 20:22:20 cmd/web.go:102:runWeb() [I] Starting Gitea on PID: 43656
2021/12/19 20:22:20 cmd/web.go:146:runWeb() [I] Global init
2021/12/19 20:22:20 routers/init.go:74:GlobalInit() [I] Git Version: 2.34.1, Wire Protocol Version 2 Enabled
2021/12/19 20:22:20 routers/init.go:77:GlobalInit() [I] AppPath: /usr/bin/gitea
2021/12/19 20:22:20 routers/init.go:78:GlobalInit() [I] AppWorkPath: /var/lib/gitea
2021/12/19 20:22:20 routers/init.go:79:GlobalInit() [I] Custom path: /var/lib/gitea/custom
2021/12/19 20:22:20 routers/init.go:80:GlobalInit() [I] Log path: /var/lib/gitea/log
2021/12/19 20:22:20 routers/init.go:81:GlobalInit() [I] Run Mode: Dev
2021/12/19 20:22:20 ...dules/setting/log.go:286:newLogService() [I] Gitea v1.15.7 built with GNU Make 4.3, go1.17.3 : bindata, sqlite, sqlite_unlock_notify, pam
2021/12/19 20:22:20 ...dules/setting/log.go:333:newLogService() [I] Gitea Log Mode: Console(Console:)
2021/12/19 20:22:20 ...dules/setting/log.go:333:newLogService() [I] Gitea Log Mode: File(File:)
2021/12/19 20:22:20 ...dules/setting/log.go:249:generateNamedLogger() [I] Router Log: Console(console:)
2021/12/19 20:22:20 ...les/setting/cache.go:78:newCacheService() [I] Cache Service Enabled
2021/12/19 20:22:20 ...les/setting/cache.go:93:newCacheService() [I] Last Commit Cache Service Enabled
2021/12/19 20:22:20 ...s/setting/session.go:77:newSessionService() [I] Session Service Enabled
2021/12/19 20:22:20 ...s/storage/storage.go:171:initAttachments() [I] Initialising Attachment storage with type:
2021/12/19 20:22:20 ...les/storage/local.go:47:NewLocalStorage() [I] Creating new Local Storage at /var/lib/gitea/data/attachments
2021/12/19 20:22:20 ...s/storage/storage.go:165:initAvatars() [I] Initialising Avatar storage with type:
2021/12/19 20:22:20 ...les/storage/local.go:47:NewLocalStorage() [I] Creating new Local Storage at /var/lib/gitea/data/avatars
2021/12/19 20:22:20 ...s/storage/storage.go:183:initRepoAvatars() [I] Initialising Repository Avatar storage with type:
2021/12/19 20:22:20 ...les/storage/local.go:47:NewLocalStorage() [I] Creating new Local Storage at /var/lib/gitea/data/repo-avatars
2021/12/19 20:22:20 ...s/storage/storage.go:177:initLFS() [I] Initialising LFS storage with type:
2021/12/19 20:22:20 ...les/storage/local.go:47:NewLocalStorage() [I] Creating new Local Storage at /var/lib/gitea/data/lfs
2021/12/19 20:22:20 ...s/storage/storage.go:189:initRepoArchives() [I] Initialising Repository Archive storage with type:
2021/12/19 20:22:20 ...les/storage/local.go:47:NewLocalStorage() [I] Creating new Local Storage at /var/lib/gitea/data/repo-archive
2021/12/19 20:22:20 ...les/queue/manager.go:134:Add() [T] Queue Manager registered: push_update-channel (QID: 1)
2021/12/19 20:22:20 ...les/queue/manager.go:134:Add() [T] Queue Manager registered: push_update-level (QID: 2)
2021/12/19 20:22:20 ...les/queue/manager.go:134:Add() [T] Queue Manager registered: push_update (QID: 3)
2021/12/19 20:22:20 ...les/queue/manager.go:134:Add() [T] Queue Manager registered: notification-service-channel (QID: 4)
2021/12/19 20:22:20 ...ueue_disk_channel.go:137:Run() [D] PersistableChannelQueue: push_update Starting
2021/12/19 20:22:20 ...les/queue/manager.go:134:Add() [T] Queue Manager registered: notification-service-level (QID: 5)
2021/12/19 20:22:20 .../queue/workerpool.go:234:commonRegisterWorkers() [T] WorkerPool: 1 (for push_update-channel) adding 0 workers with group id: 1
2021/12/19 20:22:20 ...ueue_disk_channel.go:172:Run() [D] PersistableChannelQueue: push_update Skipping running the empty level queue
2021/12/19 20:22:20 ...les/queue/manager.go:134:Add() [T] Queue Manager registered: notification-service (QID: 6)
2021/12/19 20:22:20 ...ue/queue_bytefifo.go:235:Shutdown() [T] level: push_update-level Shutting down
2021/12/19 20:22:20 ...les/queue/manager.go:134:Add() [T] Queue Manager registered: repo-archive-channel (QID: 7)
2021/12/19 20:22:20 ...ueue_disk_channel.go:137:Run() [D] PersistableChannelQueue: notification-service Starting
2021/12/19 20:22:20 ...ue/queue_bytefifo.go:242:Shutdown() [D] level: push_update-level Shutdown
2021/12/19 20:22:20 .../queue/workerpool.go:234:commonRegisterWorkers() [T] WorkerPool: 4 (for notification-service-channel) adding 0 workers with group id: 1
2021/12/19 20:22:20 ...ueue_disk_channel.go:172:Run() [D] PersistableChannelQueue: notification-service Skipping running the empty level queue
2021/12/19 20:22:20 ...les/queue/manager.go:143:Remove() [T] Queue Manager removed: QID: 2
2021/12/19 20:22:20 ...ue/queue_bytefifo.go:235:Shutdown() [T] level: notification-service-level Shutting down
2021/12/19 20:22:20 ...les/queue/manager.go:134:Add() [T] Queue Manager registered: repo-archive-level (QID: 8)
2021/12/19 20:22:20 ...ue/queue_bytefifo.go:242:Shutdown() [D] level: notification-service-level Shutdown
2021/12/19 20:22:20 ...les/queue/manager.go:134:Add() [T] Queue Manager registered: repo-archive (QID: 9)
2021/12/19 20:22:20 ...les/queue/manager.go:143:Remove() [T] Queue Manager removed: QID: 5
2021/12/19 20:22:20 ...ueue_disk_channel.go:162:Run() [D] PersistableChannelUniqueQueue: repo-archive Starting
2021/12/19 20:22:20 .../queue/workerpool.go:234:commonRegisterWorkers() [T] WorkerPool: 7 (for repo-archive-channel) adding 0 workers with group id: 1
2021/12/19 20:22:20 ...ueue_disk_channel.go:196:Run() [D] PersistableChannelUniqueQueue: repo-archive Skipping running the empty level queue
2021/12/19 20:22:20 ...ue/queue_bytefifo.go:235:Shutdown() [T] unique-level: repo-archive-level Shutting down
2021/12/19 20:22:20 ...ue/queue_bytefifo.go:242:Shutdown() [D] unique-level: repo-archive-level Shutdown
2021/12/19 20:22:20 ...les/queue/manager.go:143:Remove() [T] Queue Manager removed: QID: 8
2021/12/19 20:22:20 routers/init.go:93:GlobalInit() [I] SQLite3 Supported
2021/12/19 20:22:20 routers/common/db.go:20:InitDBEngine() [I] Beginning ORM engine initialization.
2021/12/19 20:22:20 routers/common/db.go:27:InitDBEngine() [I] ORM engine initialization attempt #1/10...
2021/12/19 20:22:20 ...e/cli@v1.22.5/app.go:524:HandleAction() [I] PING DATABASE sqlite3
2021/12/19 20:22:21 routers/init.go:98:GlobalInit() [I] ORM engine initialization successful!
2021/12/19 20:22:21 ...odules/cron/tasks.go:120:RegisterTask() [D] Registering task: update_mirrors
2021/12/19 20:22:21 ...odules/cron/tasks.go:120:RegisterTask() [D] Registering task: repo_health_check
2021/12/19 20:22:21 ...odules/cron/tasks.go:120:RegisterTask() [D] Registering task: check_repo_stats
2021/12/19 20:22:21 ...odules/cron/tasks.go:120:RegisterTask() [D] Registering task: archive_cleanup
2021/12/19 20:22:21 ...odules/cron/tasks.go:120:RegisterTask() [D] Registering task: sync_external_users
2021/12/19 20:22:21 ...odules/cron/tasks.go:120:RegisterTask() [D] Registering task: deleted_branches_cleanup
2021/12/19 20:22:21 ...odules/cron/tasks.go:120:RegisterTask() [D] Registering task: update_migration_poster_id
2021/12/19 20:22:21 ...odules/cron/tasks.go:120:RegisterTask() [D] Registering task: cleanup_hook_task_table
2021/12/19 20:22:21 ...odules/cron/tasks.go:120:RegisterTask() [D] Registering task: delete_inactive_accounts
2021/12/19 20:22:21 ...odules/cron/tasks.go:120:RegisterTask() [D] Registering task: delete_repo_archives
2021/12/19 20:22:21 ...odules/cron/tasks.go:120:RegisterTask() [D] Registering task: git_gc_repos
2021/12/19 20:22:21 ...odules/cron/tasks.go:120:RegisterTask() [D] Registering task: resync_all_sshkeys
2021/12/19 20:22:21 ...odules/cron/tasks.go:120:RegisterTask() [D] Registering task: resync_all_sshprincipals
2021/12/19 20:22:21 ...odules/cron/tasks.go:120:RegisterTask() [D] Registering task: resync_all_hooks
2021/12/19 20:22:21 ...odules/cron/tasks.go:120:RegisterTask() [D] Registering task: reinit_missing_repos
2021/12/19 20:22:21 ...odules/cron/tasks.go:120:RegisterTask() [D] Registering task: delete_missing_repos
2021/12/19 20:22:21 ...odules/cron/tasks.go:120:RegisterTask() [D] Registering task: delete_generated_repository_avatars
2021/12/19 20:22:21 ...odules/cron/tasks.go:120:RegisterTask() [D] Registering task: delete_old_actions
2021/12/19 20:22:21 models/repo.go:1879:CheckRepoStats() [T] Doing: CheckRepoStats
2021/12/19 20:22:21 ...les/queue/manager.go:134:Add() [T] Queue Manager registered: issue_indexer (QID: 10)
2021/12/19 20:22:21 models/repo.go:1806:DeleteOldRepositoryArchives() [T] Doing: ArchiveCleanup
2021/12/19 20:22:21 models/branches.go:566:RemoveOldDeletedBranches() [T] Doing: DeletedBranchesCleanup
2021/12/19 20:22:21 ...les/queue/manager.go:134:Add() [T] Queue Manager registered: repo_stats_update-channel (QID: 11)
2021/12/19 20:22:21 ...er/issues/indexer.go:142:func2() [I] PID 43656: Initializing Issue Indexer: bleve
2021/12/19 20:22:21 ...les/queue/manager.go:134:Add() [T] Queue Manager registered: repo_stats_update-level (QID: 12)
2021/12/19 20:22:21 ...les/queue/manager.go:134:Add() [T] Queue Manager registered: repo_stats_update (QID: 13)
2021/12/19 20:22:21 ...ueue_disk_channel.go:162:Run() [D] PersistableChannelUniqueQueue: repo_stats_update Starting
2021/12/19 20:22:21 ...les/queue/manager.go:134:Add() [T] Queue Manager registered: pr_patch_checker-channel (QID: 14)
2021/12/19 20:22:21 ...les/queue/manager.go:134:Add() [T] Queue Manager registered: pr_patch_checker-level (QID: 15)
2021/12/19 20:22:21 .../queue/workerpool.go:234:commonRegisterWorkers() [T] WorkerPool: 11 (for repo_stats_update-channel) adding 0 workers with group id: 1
2021/12/19 20:22:21 ...xer/stats/indexer.go:38:populateRepoIndexer() [I] Populating the repo stats indexer with existing repositories
2021/12/19 20:22:21 ...les/queue/manager.go:134:Add() [T] Queue Manager registered: pr_patch_checker (QID: 16)
2021/12/19 20:22:21 ...ueue_disk_channel.go:196:Run() [D] PersistableChannelUniqueQueue: repo_stats_update Skipping running the empty level queue
2021/12/19 20:22:21 ...les/queue/manager.go:134:Add() [T] Queue Manager registered: task-channel (QID: 17)
2021/12/19 20:22:21 ...ue/queue_bytefifo.go:235:Shutdown() [T] unique-level: repo_stats_update-level Shutting down
2021/12/19 20:22:21 ...ue/queue_bytefifo.go:242:Shutdown() [D] unique-level: repo_stats_update-level Shutdown
2021/12/19 20:22:21 ...les/queue/manager.go:134:Add() [T] Queue Manager registered: task-level (QID: 18)
2021/12/19 20:22:21 ...les/queue/manager.go:143:Remove() [T] Queue Manager removed: QID: 12
2021/12/19 20:22:21 ...les/queue/manager.go:134:Add() [T] Queue Manager registered: task (QID: 19)
2021/12/19 20:22:21 modules/ssh/ssh.go:312:Listen() [I] Adding SSH host key: /var/lib/gitea/data/ssh/gitea.rsa
2021/12/19 20:22:21 ...ueue_disk_channel.go:137:Run() [D] PersistableChannelQueue: task Starting
2021/12/19 20:22:21 .../queue/workerpool.go:234:commonRegisterWorkers() [T] WorkerPool: 17 (for task-channel) adding 0 workers with group id: 1
2021/12/19 20:22:21 ...ueue_disk_channel.go:172:Run() [D] PersistableChannelQueue: task Skipping running the empty level queue
2021/12/19 20:22:21 ...ue/queue_bytefifo.go:235:Shutdown() [T] level: task-level Shutting down
2021/12/19 20:22:21 ...ue/queue_bytefifo.go:242:Shutdown() [D] level: task-level Shutdown
2021/12/19 20:22:21 ...les/queue/manager.go:143:Remove() [T] Queue Manager removed: QID: 18
2021/12/19 20:22:21 ...ueue_disk_channel.go:162:Run() [D] PersistableChannelUniqueQueue: pr_patch_checker Starting
2021/12/19 20:22:21 .../queue/workerpool.go:234:commonRegisterWorkers() [T] WorkerPool: 14 (for pr_patch_checker-channel) adding 0 workers with group id: 1
2021/12/19 20:22:21 ...ueue_disk_channel.go:196:Run() [D] PersistableChannelUniqueQueue: pr_patch_checker Skipping running the empty level queue
2021/12/19 20:22:21 ...ue/queue_bytefifo.go:235:Shutdown() [T] unique-level: pr_patch_checker-level Shutting down
2021/12/19 20:22:21 ...ue/queue_bytefifo.go:242:Shutdown() [D] unique-level: pr_patch_checker-level Shutdown
2021/12/19 20:22:21 ...les/queue/manager.go:143:Remove() [T] Queue Manager removed: QID: 15
2021/12/19 20:22:21 routers/init.go:131:GlobalInit() [I] SSH server started on :22. Cipher list ([aes128-ctr aes192-ctr aes256-ctr aes128-gcm@openssh.com arcfour256 arcfour128]), key exchange algorithms ([diffie-hellman-group1-sha1 diffie-hellman-group14-sha1 ecdh-sha2-nistp256 ecdh-sha2-nistp384 ecdh-sha2-nistp521 curve25519-sha256@libssh.org]), MACs ([hmac-sha2-256-etm@openssh.com hmac-sha2-256 hmac-sha1 hmac-sha1-96])
2021/12/19 20:22:21 ...s/graceful/server.go:62:NewServer() [I] Starting new SSH server: tcp::22 on PID: 43656
2021/12/19 20:22:21 ...er/issues/indexer.go:171:func2() [D] Created Bleve Indexer
2021/12/19 20:22:21 ...s/graceful/server.go:75:func1() [D] Starting server on tcp::22 (PID: 43656)
2021/12/19 20:22:21 ...er/issues/indexer.go:221:func3() [I] Issue Indexer Initialization took 47.703231ms
2021/12/19 20:22:21 ...ue/queue_bytefifo.go:116:Run() [D] level: issue_indexer Starting
2021/12/19 20:22:21 .../queue/workerpool.go:234:commonRegisterWorkers() [T] WorkerPool: 10 (for issue_indexer) adding 0 workers with group id: 1
2021/12/19 20:22:21 ...ue/queue_bytefifo.go:120:Run() [T] level: issue_indexer Now running
2021/12/19 20:22:21 ...ue/queue_bytefifo.go:151:readToChan() [T] level: issue_indexer Waiting on Empty
2021/12/19 20:22:21 models/repo.go:1829:DeleteOldRepositoryArchives() [T] Finished: ArchiveCleanup
2021/12/19 20:22:21 ...xer/stats/indexer.go:84:populateRepoIndexer() [I] Done (re)populating the repo stats indexer with existing repositories
2021/12/19 20:22:22 cmd/web.go:196:listen() [I] Listen: http://0.0.0.0:3000
2021/12/19 20:22:22 cmd/web.go:200:listen() [I] AppURL(ROOT_URL): https://---/
2021/12/19 20:22:22 cmd/web.go:203:listen() [I] LFS server enabled
2021/12/19 20:22:22 ...s/graceful/server.go:62:NewServer() [I] Starting new Web server: tcp:0.0.0.0:3000 on PID: 43656
2021/12/19 20:22:22 ...s/graceful/server.go:75:func1() [D] Starting server on tcp:0.0.0.0:3000 (PID: 43656)
2021/12/19 20:22:31 ...ource/manager_run.go:40:Run() [T] Event source has no listeners
2021/12/19 20:22:31 ...ource/manager_run.go:50:Run() [T] Pausing the eventsource

And here is the log while pushing the repo, i don’t see anything related to the “pre-recieved hook declined” :

2021/12/19 20:24:54 Started GET /---/test01.git/info/refs?service=git-receive-pack for 192.168.1.147:35450
2021/12/19 20:24:55 ...s/context/context.go:751:1() [D] Session ID: ---
2021/12/19 20:24:55 ...s/context/context.go:752:1() [D] CSRF Token: ---
2021/12/19 20:24:55 Completed GET /---/test01.git/info/refs?service=git-receive-pack 401 Unauthorized in 168.536119ms                                                           [0/1958]
2021/12/19 20:25:03 Started GET /---/test01.git/info/refs?service=git-receive-pack for 192.168.1.147:35452
2021/12/19 20:25:03 ...s/context/context.go:751:1() [D] Session ID: ---
2021/12/19 20:25:03 ...s/context/context.go:752:1() [D] CSRF Token: ---
2021/12/19 20:25:03 ...rvices/auth/basic.go:73:Verify() [T] Basic Authorization: Attempting login for: ---
2021/12/19 20:25:03 ...rvices/auth/basic.go:118:Verify() [T] Basic Authorization: Attempting SignIn for ---
2021/12/19 20:25:03 ...rvices/auth/basic.go:127:Verify() [T] Basic Authorization: Logged in user 1:---
2021/12/19 20:25:03 models/repo.go:349:getUnits() [T] repo.Units: [0xc00565eed0 0xc00565f350 0xc0056662a0 0xc005676a20 0xc005676ff0 0xc0056772c0]
2021/12/19 20:25:03 ...s/repo_permission.go:154:func1() [T] Permission Loaded for 1:--- in 2:---/test01:
        Permissions: AccessMode: 4:owner, 6 Units, 0 UnitsMode(s): [
        Units[0]: ID: 7 RepoID: 2 Type: 1:UnitTypeCode Config: {}
        Units[1]: ID: 8 RepoID: 2 Type: 2:UnitTypeIssues Config: {"EnableTimetracker":true,"AllowOnlyContributorsToTrackTime":true,"EnableDependencies":true}
        Units[2]: ID: 9 RepoID: 2 Type: 3:UnitTypePullRequests Config: {"IgnoreWhitespaceConflicts":false,"AllowMerge":true,"AllowRebase":true,"AllowRebaseMerge":true,"AllowSquash":true,"AllowManualMerge":false,"AutodetectManualMerge":false,"DefaultDeleteBranchAfterMerge":false,"DefaultMergeStyle":"merge"}
        Units[3]: ID: 10 RepoID: 2 Type: 4:UnitTypeReleases Config: {}
        Units[4]: ID: 11 RepoID: 2 Type: 5:UnitTypeWiki Config: {}
        Units[5]: ID: 12 RepoID: 2 Type: 8:UnitTypeProjects Config: {} ]
2021/12/19 20:25:03 ...dules/git/command.go:120:RunInDirTimeoutEnvFullPipelineFunc() [D] /var/lib/gitea/data/gitea-repositories/---/test01.git: /usr/bin/git -c credential.helper= -c protocol.version=2 -c filter.lfs.required= -c filter.lfs.smudge= -c filter.lfs.clean= receive-pack --stateless-rpc --advertise-refs .
2021/12/19 20:25:03 Completed GET /---/test01.git/info/refs?service=git-receive-pack 200 OK in 164.495365ms
2021/12/19 20:25:03 ...dules/git/command.go:206:RunInDirTimeoutEnv() [T] Stdout:
         00be0000000000000000000000000000000000000000 capabilities^{}\003dreport-status report-status-v2 delete-refs side-band-64k quiet atomic ofs-delta push-options object-format=sha1 agent=git/2.34.1
        0000
2021/12/19 20:25:03 Started POST /---/test01.git/git-receive-pack for 192.168.1.147:35454
2021/12/19 20:25:03 ...s/context/context.go:751:1() [D] Session ID: ae7b748e48d77a95
2021/12/19 20:25:03 ...s/context/context.go:752:1() [D] CSRF Token: opWI9SN37uIxwvb91OpA87jAV4E6MTYzOTk0MTkwMzQ0OTU3MTIyOA
2021/12/19 20:25:03 ...rvices/auth/basic.go:73:Verify() [T] Basic Authorization: Attempting login for: ---
2021/12/19 20:25:03 ...rvices/auth/basic.go:118:Verify() [T] Basic Authorization: Attempting SignIn for ---
2021/12/19 20:25:03 ...rvices/auth/basic.go:127:Verify() [T] Basic Authorization: Logged in user 1:---
2021/12/19 20:25:03 models/repo.go:349:getUnits() [T] repo.Units: [0xc005809f20 0xc0058342d0 0xc005835170 0xc005835740 0xc005835c80 0xc005838150]
2021/12/19 20:25:03 ...s/repo_permission.go:154:func1() [T] Permission Loaded for 1:--- in 2:---/test01:
        Permissions: AccessMode: 4:owner, 6 Units, 0 UnitsMode(s): [
        Units[0]: ID: 7 RepoID: 2 Type: 1:UnitTypeCode Config: {}
        Units[1]: ID: 8 RepoID: 2 Type: 2:UnitTypeIssues Config: {"EnableTimetracker":true,"AllowOnlyContributorsToTrackTime":true,"EnableDependencies":true}
        Units[2]: ID: 9 RepoID: 2 Type: 3:UnitTypePullRequests Config: {"IgnoreWhitespaceConflicts":false,"AllowMerge":true,"AllowRebase":true,"AllowRebaseMerge":true,"AllowSquash":true,"AllowManualMerge":false,"AutodetectManualMerge":false,"DefaultDeleteBranchAfterMerge":false,"DefaultMergeStyle":"merge"}
        Units[3]: ID: 10 RepoID: 2 Type: 4:UnitTypeReleases Config: {}
        Units[4]: ID: 11 RepoID: 2 Type: 5:UnitTypeWiki Config: {}
        Units[5]: ID: 12 RepoID: 2 Type: 8:UnitTypeProjects Config: {} ]
2021/12/19 20:25:04 Completed POST /---/test01.git/git-receive-pack 200 OK in 904.081715ms

The response from your client-side.

Here the output on the client side:

~/test01> git push -v -u origin master
Poussée vers https://---/---/test01.git
Énumération des objets: 3, fait.
Décompte des objets: 100% (3/3), fait.
Écriture des objets: 100% (3/3), 236 octets | 236.00 Kio/s, fait.
Total 3 (delta 0), réutilisés 0 (delta 0), réutilisés du pack 0
POST git-receive-pack (411 bytes)
remote:
remote: Gitea: Internal Server Error
remote: Unable to contact gitea: parse "http://localhost:3000api/internal/hook/pre-receive/---/test01": invalid port ":3000api" after host
remote: Gitea: Internal Server Error
To https://---/---/test01.git
 ! [remote rejected] master -> master (pre-receive hook declined)
error: impossible de pousser des références vers 'https://---/---/test01.git'

The issue is very clear, it’s a configuration typo:

LOCAL_ROOT_URL      = http://localhost:3000

should be (note trailing /):

LOCAL_ROOT_URL      = http://localhost:3000/

Thanks for the help!