Skip to content

git push.(pre-receive hook declined) error: failed to push some refs to "xxx"] #22293

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

Closed
WenTao-Love opened this issue Dec 31, 2022 · 18 comments
Closed
Labels
issue/duplicate The issue has already been reported.

Comments

@WenTao-Love
Copy link

Description

when git push.
(pre-receive hook declined) error: failed to push some refs to "xxx"]
but the gitea console error msg:
401 Unauthorized in 3.4ms @ repo/http.go:532(repo.GetInfoRefs).

use gitea 1.17.3 no problem!

Gitea Version

1.18.0

Can you reproduce the bug on the Gitea demo site?

No

Log Gist

repo/http.go

Screenshots

http.go
line 532
h := httpBase(ctx)

then line 159
if !ctx.IsSigned {
// TODO: support digit auth - which would be Authorization header with digit
ctx.Resp.Header().Set("WWW-Authenticate", "Basic realm="."")
ctx.Error(http.StatusUnauthorized)
return
}

Git Version

2.38.1

Operating System

windows

How are you running Gitea?

gitea.exe web

Database

PostgreSQL

@sigma-frossignol
Copy link

Hi

I had the same thing

Went to Site Administration
On the Dashboard tab
Under Maintenance Operations
Run Resynchronize pre-receive, update and post-receive hooks of all repositories.
That fixed it for me

hope this helps

@sinotaotao
Copy link

sinotaotao commented Jan 6, 2023

Same problem on windows7. Same version 1.18.0, but v1.18.0 on linux x86_64 is ok.

Logs when the (pre-receive hook declined) error occurred

2023/01/07 12:09:41 ...y/files/temp_repo.go:314:Push() [I] [63b8f033] Unable to push back to repo from temporary repo due to rejection: Other/Go (D:/gitea/data/tmp/local-repo\upload.git2949402268)
	Stdout: 
	Stderr: remote: 
	remote: Gitea: Internal Server Error        
	remote: * Checking 1 references        
	To D:\gitea\data\gitea-repositories\other\go.git
	 ! [remote rejected] cb0e2ba9efbc8f5fa984a61aebee5781a0d81b83 -> main (pre-receive hook declined)
	error: failed to push some refs to 'D:\gitea\data\gitea-repositories\other\go.git'
	
	Error: exit status 1
2023/01/07 12:09:41 ...tory/files/update.go:448:CreateOrUpdateRepoFile() [E] [63b8f033] *log.ColoredValue PushRejected Error: exit status 1: remote: 
	remote: Gitea: Internal Server Error        
	remote: * Checking 1 references        
	To D:\gitea\data\gitea-repositories\other\go.git
	 ! [remote rejected] cb0e2ba9efbc8f5fa984a61aebee5781a0d81b83 -> main (pre-receive hook declined)
	error: failed to push some refs to 'D:\gitea\data\gitea-repositories\other\go.git'
	
	
2023/01/07 12:09:41 ...y/files/temp_repo.go:50:Close() [E] [63b8f033] Failed to remove temporary path D:/gitea/data/tmp/local-repo\upload.git2949402268: remove D:/gitea/data/tmp/local-repo\upload.git2949402268: The process cannot access the file because it is being used by another process.

@sinotaotao
Copy link

Cannot fix this, fallback to v1.17.4.

@techknowlogick
Copy link
Member

@sinotaotao are you able to try with gogit version of the windows binary?

@zeripath
Copy link
Contributor

zeripath commented Jan 9, 2023

Seeing:

401 Unauthorized in 3.4ms @ repo/http.go:532(repo.GetInfoRefs).

in the logs is normal and the fact that you get to a pre-receive hook declined implies that you have been able to successfully authenticate.

The error will be in the pre-receive hook communicating with the gitea server or there should be something logged in the server logs regarding the pre-receive hook.

@zeripath
Copy link
Contributor

zeripath commented Jan 9, 2023

Therefore please upload a more complete set of logs.

@emehmet
Copy link

emehmet commented Jan 10, 2023

I got this error after reinstalling an existing sqlite3 database and version 1.8.0 from scratch.

@emehmet
Copy link

emehmet commented Jan 10, 2023

I can't push at all. Clone and pull operations are working.

RUN_USER = Administrator
RUN_MODE = prod

[server]
LOCAL_ROOT_URL   = 127.0.0.1// or I tried xxx.com:1881
SSH_DOMAIN       = 127.0.0.1
DOMAIN           = 127.0.0.1
HTTP_PORT        = 1881
ROOT_URL         = http://xxx.com:1881/
DISABLE_SSH      = false
SSH_PORT         = 22
LFS_START_SERVER = false
OFFLINE_MODE     = false

[database]
DB_TYPE  = sqlite3
HOST     = 127.0.0.1:3306
NAME     = gitea
USER     = gitea
PASSWD   = 
SCHEMA   = 
SSL_MODE = disable
CHARSET  = utf8
PATH     = C:/OneDrive/git_data/gitea.db
LOG_SQL  = false

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

[mailer]
ENABLED = false

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

[picture]
ENABLE_FEDERATED_AVATAR = false

[openid]
ENABLE_OPENID_SIGNIN = true
ENABLE_OPENID_SIGNUP = true

[session]
PROVIDER = file

[log]
MODE      = console
LEVEL     = info
ROOT_PATH = C:/git_repo/log
ROUTER    = console

[repository.pull-request]
DEFAULT_MERGE_STYLE = merge

[repository.signing]
DEFAULT_TRUST_MODEL = committer

[security]
INSTALL_LOCK       = true
INTERNAL_TOKEN     = xxx
PASSWORD_HASH_ALGO = xxx

@zeripath
Copy link
Contributor

I don't understand why I repeatedly have to say this:

WE NEED LOGS

Look at:

https://docs.gitea.io/en-us/logging-configuration/#debugging-problems

Give us ALL the logs around the push that fails not just the logs that you think are relevant.

I know that there will be some relevant logging after the 401 Unauthorized in 3.4ms @ repo/http.go:532(repo.GetInfoRefs) because there will be some logging related to /api/internal/serv/command and either there is no logging related to /api/internal/hook/pre-receive meaning that that the hooks cannot communicate with the gitea server OR there will be some relevant information there.

@lunny lunny added issue/needs-feedback For bugs, we need more details. For features, the feature must be described in more detail and removed type/bug labels Jan 10, 2023
@zeripath
Copy link
Contributor

I suspect this has the same underlying problem as in #22370 and is just another presentation of it. (Similarly for #22381)

It may be simply that adding the following setting to the app.ini [server] section will fix this:

[server]
LOCAL_ROOT_URL = http://127.0.0.1:3000/
...

@zeripath
Copy link
Contributor

@emehmet that LOCAL_ROOT_URL is not an URL and could never work.

From your app.ini it should be:

[server]
...
LOCAL_ROOT_URL = http://127.0.0.1:1881/
...

@emehmet
Copy link

emehmet commented Jan 10, 2023

Hey @zeripath ,
This is my logs;

I see this logs on client ;

PS D:\node_proje\gps_graphql_servers\mest_gps_bildirim_server> git push -u origin master
warning: redirecting to http://xxx.com:1881/nodejs/gps_bildirim_server/
Enumerating objects: 9, done.
Counting objects: 100% (9/9), done.
Delta compression using up to 8 threads
Compressing objects: 100% (5/5), done.
Writing objects: 100% (5/5), 2.96 KiB | 1.48 MiB/s, done.
Total 5 (delta 3), reused 0 (delta 0), pack-reused 0
remote: 
remote: Gitea: Internal Server Error
To http://xxx.com:1881/nodejs/mest_gps_bildirim_server.git
 ! [remote rejected] master -> master (pre-receive hook declined)
error: failed to push some refs to 'http://xxx.com:1881/nodejs/mest_gps_bildirim_server.git'

And I see this logs on server;

2023/01/10 13:24:00 cmd/web.go:106:runWeb() [I] Starting Gitea on PID: 44412
2023/01/10 13:24:00 cmd/web.go:160:runWeb() [I] Global init
2023/01/10 13:24:01 routers/init.go:116:GlobalInitInstalled() [I] Git Version: 2.37.1, Wire Protocol Version 2 Enabled (home: C:\git_repo\data\home)
2023/01/10 13:24:01 routers/init.go:117:GlobalInitInstalled() [I] AppPath: C:/git_repo/gitea-1.12.3-windows-4.0-amd64.exe
2023/01/10 13:24:01 routers/init.go:118:GlobalInitInstalled() [I] AppWorkPath: C:/git_repo
2023/01/10 13:24:01 routers/init.go:119:GlobalInitInstalled() [I] Custom path: C:/git_repo/custom
2023/01/10 13:24:01 routers/init.go:120:GlobalInitInstalled() [I] Log path: C:/git_repo/log
2023/01/10 13:24:01 routers/init.go:121:GlobalInitInstalled() [I] Configuration file: C:/git_repo/custom/conf/app.ini
2023/01/10 13:24:01 routers/init.go:122:GlobalInitInstalled() [I] Run Mode: Prod
2023/01/10 13:24:02 ...dules/setting/log.go:288:newLogService() [I] Gitea v1.18.0 built with GNU Make 4.1, go1.19.4 : bindata, sqlite, sqlite_unlock_notify
2023/01/10 13:24:02 ...dules/setting/log.go:335:newLogService() [I] Gitea Log Mode: Console(Console:info)
2023/01/10 13:24:02 ...dules/setting/log.go:249:generateNamedLogger() [I] Router Log: Console(console:info)
2023/01/10 13:24:02 ...les/setting/cache.go:76:newCacheService() [I] Cache Service Enabled
2023/01/10 13:24:02 ...les/setting/cache.go:91:newCacheService() [I] Last Commit Cache Service Enabled
2023/01/10 13:24:02 ...s/setting/session.go:73:newSessionService() [I] Session Service Enabled
2023/01/10 13:24:02 ...s/storage/storage.go:176:initAttachments() [I] Initialising Attachment storage with type:
2023/01/10 13:24:02 ...les/storage/local.go:46:NewLocalStorage() [I] Creating new Local Storage at C:\git_repo\data\attachments
2023/01/10 13:24:02 ...s/storage/storage.go:170:initAvatars() [I] Initialising Avatar storage with type:
2023/01/10 13:24:02 ...les/storage/local.go:46:NewLocalStorage() [I] Creating new Local Storage at C:\git_repo\data\avatars
2023/01/10 13:24:02 ...s/storage/storage.go:188:initRepoAvatars() [I] Initialising Repository Avatar storage with type:
2023/01/10 13:24:02 ...les/storage/local.go:46:NewLocalStorage() [I] Creating new Local Storage at C:\git_repo\data\repo-avatars
2023/01/10 13:24:02 ...s/storage/storage.go:182:initLFS() [I] Initialising LFS storage with type:
2023/01/10 13:24:02 ...les/storage/local.go:46:NewLocalStorage() [I] Creating new Local Storage at C:\git_repo\data\lfs
2023/01/10 13:24:02 ...s/storage/storage.go:194:initRepoArchives() [I] Initialising Repository Archive storage with type:
2023/01/10 13:24:02 ...les/storage/local.go:46:NewLocalStorage() [I] Creating new Local Storage at C:\git_repo\data\repo-archive
2023/01/10 13:24:02 ...s/storage/storage.go:200:initPackages() [I] Initialising Packages storage with type:
2023/01/10 13:24:02 ...les/storage/local.go:46:NewLocalStorage() [I] Creating new Local Storage at C:\git_repo\data\packages
2023/01/10 13:24:02 routers/init.go:140:GlobalInitInstalled() [I] SQLite3 support is enabled
2023/01/10 13:24:02 routers/common/db.go:20:InitDBEngine() [I] Beginning ORM engine initialization.
2023/01/10 13:24:02 routers/common/db.go:27:InitDBEngine() [I] ORM engine initialization attempt #1/10...
2023/01/10 13:24:02 cmd/web.go:163:runWeb() [I] PING DATABASE sqlite3
2023/01/10 13:24:02 routers/init.go:145:GlobalInitInstalled() [W] Table system_setting Column version db default is , struct default is 1
2023/01/10 13:24:02 routers/init.go:145:GlobalInitInstalled() [W] Table email_address Column lower_email db nullable is true, struct nullable is false
2023/01/10 13:24:02 routers/init.go:145:GlobalInitInstalled() [W] Table hook_task has column repo_id but struct has not related field
2023/01/10 13:24:02 routers/init.go:146:GlobalInitInstalled() [I] ORM engine initialization successful!
2023/01/10 13:24:02 ...er/issues/indexer.go:174:func2() [I] [63bd3cc2-10] PID 44412: Initializing Issue Indexer: bleve
2023/01/10 13:24:02 ...xer/stats/indexer.go:39:populateRepoIndexer() [I] Populating the repo stats indexer with existing repositories
2023/01/10 13:24:02 ...xer/stats/indexer.go:85:populateRepoIndexer() [I] Done (re)populating the repo stats indexer with existing repositories
2023/01/10 13:24:02 ...er/issues/indexer.go:270:func3() [I] [63bd3cc2-10] Issue Indexer Initialization took 2.0002ms
2023/01/10 13:24:02 cmd/web.go:220:listen() [I] [63bd3cc2-32] Listen: http://0.0.0.0:1881
2023/01/10 13:24:02 cmd/web.go:224:listen() [I] [63bd3cc2-32] AppURL(ROOT_URL): http://xxx.com:1881/
2023/01/10 13:24:02 ...s/graceful/server.go:62:NewServer() [I] [63bd3cc2-32] Starting new Web server: tcp:0.0.0.0:1881 on PID: 44412
2023/01/10 13:24:07 [63bd3cc2-31] router: polling   GET /user/events for 212.154.94.120:59249, elapsed 3453.2ms @ events/events.go:19(events.Events)
2023/01/10 13:24:11 [63bd3ccb] router: completed GET /server_productions/mest_gps_bildirim_server.git/info/refs?service=git-upload-pack for 212.154.94.120:59265, 401 Unauthorized in 3.0ms @ repo/http.go:532(repo.GetInfoRefs)
2023/01/10 13:24:18 [63bd3cd2] router: completed GET /nodejs/mest_gps_bildirim_server.git/info/refs?service=git-receive-pack for 212.154.94.120:59295, 307 Temporary Redirect in 2.0ms @ repo/http.go:532(repo.GetInfoRefs)
2023/01/10 13:24:18 [63bd3cd2-2] router: completed GET /nodejs/gps_bildirim_server/info/refs?service=git-receive-pack for 212.154.94.120:59295, 401 Unauthorized in 2.0ms @ repo/http.go:532(repo.GetInfoRefs)
2023/01/10 13:24:30 [63bd3cde] router: completed HEAD / for 212.154.94.120:59360, 200 OK in 1.0ms @ web/web.go:132(web.Routes)
2023/01/10 13:24:35 [63bd3ce3] router: completed GET /server_productions/mest_gps_bildirim_server.git/info/refs?service=git-upload-pack for 212.154.94.120:59265, 200 OK in 78.0ms @ repo/http.go:532(repo.GetInfoRefs)
2023/01/10 13:24:39 [63bd3ce7] router: completed HEAD / for 212.154.94.120:59401, 200 OK in 0.0ms @ web/web.go:132(web.Routes)
2023/01/10 13:24:43 [63bd3ceb] router: completed GET /nodejs/gps_bildirim_server/info/refs?service=git-receive-pack for 212.154.94.120:59295, 200 OK in 77.0ms @ repo/http.go:532(repo.GetInfoRefs)
2023/01/10 13:24:53 [63bd3cf5] router: completed HEAD / for 212.154.94.120:59473, 200 OK in 0.0ms @ web/web.go:132(web.Routes)
2023/01/10 13:24:57 [63bd3cf9] router: completed POST /server_productions/mest_gps_bildirim_server.git/git-upload-pack for 212.154.94.120:59265, 200 OK in 67.0ms @ repo/http.go:492(repo.ServiceUploadPack)
2023/01/10 13:25:01 [63bd3cfd] router: completed HEAD / for 212.154.94.120:59516, 200 OK in 0.0ms @ web/web.go:132(web.Routes)
2023/01/10 13:25:10 [63bd3cc2-31] router: slow      POST /nodejs/gps_bildirim_server/git-receive-pack for 212.154.94.120:59295, elapsed 3713.2ms @ repo/http.go:500(repo.ServiceReceivePack)
2023/01/10 13:25:12 [63bd3d02] router: completed POST /nodejs/gps_bildirim_server/git-receive-pack for 212.154.94.120:59295, 200 OK in 5654.3ms @ repo/http.go:500(repo.ServiceReceivePack)

But after doing what was said in the comment here it worked.

#22370 (comment)

And here's the log of the code that worked:

2023/01/10 13:29:44 cmd/web.go:106:runWeb() [I] Starting Gitea on PID: 43960
2023/01/10 13:29:44 cmd/web.go:160:runWeb() [I] Global init
2023/01/10 13:29:45 routers/init.go:116:GlobalInitInstalled() [I] Git Version: 2.37.1, Wire Protocol Version 2 Enabled (home: C:\git_repo\data\home)
2023/01/10 13:29:45 routers/init.go:117:GlobalInitInstalled() [I] AppPath: C:/git_repo/gitea-1.12.3-windows-4.0-amd64.exe
2023/01/10 13:29:45 routers/init.go:118:GlobalInitInstalled() [I] AppWorkPath: C:/git_repo
2023/01/10 13:29:45 routers/init.go:119:GlobalInitInstalled() [I] Custom path: C:/git_repo/custom
2023/01/10 13:29:45 routers/init.go:120:GlobalInitInstalled() [I] Log path: C:/git_repo/log
2023/01/10 13:29:45 routers/init.go:121:GlobalInitInstalled() [I] Configuration file: C:/git_repo/custom/conf/app.ini
2023/01/10 13:29:45 routers/init.go:122:GlobalInitInstalled() [I] Run Mode: Prod
2023/01/10 13:29:45 ...dules/setting/log.go:288:newLogService() [I] Gitea v1.18.0 built with GNU Make 4.1, go1.19.4 : bindata, sqlite, sqlite_unlock_notify
2023/01/10 13:29:45 ...dules/setting/log.go:335:newLogService() [I] Gitea Log Mode: Console(Console:info)
2023/01/10 13:29:45 ...dules/setting/log.go:249:generateNamedLogger() [I] Router Log: Console(console:info)
2023/01/10 13:29:45 ...les/setting/cache.go:76:newCacheService() [I] Cache Service Enabled
2023/01/10 13:29:45 ...les/setting/cache.go:91:newCacheService() [I] Last Commit Cache Service Enabled
2023/01/10 13:29:45 ...s/setting/session.go:73:newSessionService() [I] Session Service Enabled
2023/01/10 13:29:45 ...s/storage/storage.go:176:initAttachments() [I] Initialising Attachment storage with type:
2023/01/10 13:29:45 ...les/storage/local.go:46:NewLocalStorage() [I] Creating new Local Storage at C:\git_repo\data\attachments
2023/01/10 13:29:45 ...s/storage/storage.go:170:initAvatars() [I] Initialising Avatar storage with type:
2023/01/10 13:29:45 ...les/storage/local.go:46:NewLocalStorage() [I] Creating new Local Storage at C:\git_repo\data\avatars
2023/01/10 13:29:45 ...s/storage/storage.go:188:initRepoAvatars() [I] Initialising Repository Avatar storage with type:
2023/01/10 13:29:45 ...les/storage/local.go:46:NewLocalStorage() [I] Creating new Local Storage at C:\git_repo\data\repo-avatars
2023/01/10 13:29:45 ...s/storage/storage.go:182:initLFS() [I] Initialising LFS storage with type:
2023/01/10 13:29:45 ...les/storage/local.go:46:NewLocalStorage() [I] Creating new Local Storage at C:\git_repo\data\lfs
2023/01/10 13:29:45 ...s/storage/storage.go:194:initRepoArchives() [I] Initialising Repository Archive storage with type:
2023/01/10 13:29:45 ...les/storage/local.go:46:NewLocalStorage() [I] Creating new Local Storage at C:\git_repo\data\repo-archive
2023/01/10 13:29:45 ...s/storage/storage.go:200:initPackages() [I] Initialising Packages storage with type:
2023/01/10 13:29:45 ...les/storage/local.go:46:NewLocalStorage() [I] Creating new Local Storage at C:\git_repo\data\packages
2023/01/10 13:29:45 routers/init.go:140:GlobalInitInstalled() [I] SQLite3 support is enabled
2023/01/10 13:29:45 routers/common/db.go:20:InitDBEngine() [I] Beginning ORM engine initialization.
2023/01/10 13:29:45 routers/common/db.go:27:InitDBEngine() [I] ORM engine initialization attempt #1/10...
2023/01/10 13:29:45 cmd/web.go:163:runWeb() [I] PING DATABASE sqlite3
2023/01/10 13:29:45 routers/init.go:145:GlobalInitInstalled() [W] Table system_setting Column version db default is , struct default is 1
2023/01/10 13:29:45 routers/init.go:145:GlobalInitInstalled() [W] Table email_address Column lower_email db nullable is true, struct nullable is false
2023/01/10 13:29:45 routers/init.go:145:GlobalInitInstalled() [W] Table hook_task has column repo_id but struct has not related field
2023/01/10 13:29:45 routers/init.go:146:GlobalInitInstalled() [I] ORM engine initialization successful!
2023/01/10 13:29:45 ...er/issues/indexer.go:174:func2() [I] [63bd3e19-18] PID 43960: Initializing Issue Indexer: bleve
2023/01/10 13:29:45 ...xer/stats/indexer.go:39:populateRepoIndexer() [I] Populating the repo stats indexer with existing repositories
2023/01/10 13:29:45 ...xer/stats/indexer.go:85:populateRepoIndexer() [I] Done (re)populating the repo stats indexer with existing repositories
2023/01/10 13:29:45 ...er/issues/indexer.go:270:func3() [I] [63bd3e19-18] Issue Indexer Initialization took 13.0014ms
2023/01/10 13:29:45 cmd/web.go:220:listen() [I] [63bd3e19-40] Listen: http://0.0.0.0:1881
2023/01/10 13:29:45 cmd/web.go:224:listen() [I] [63bd3e19-40] AppURL(ROOT_URL): http://xxx.com:1881/
2023/01/10 13:29:45 ...s/graceful/server.go:62:NewServer() [I] [63bd3e19-40] Starting new Web server: tcp:0.0.0.0:1881 on PID: 43960
2023/01/10 13:29:55 [63bd3e19-39] router: polling   GET /user/events for 212.154.94.120:59630, elapsed 3908.2ms @ events/events.go:19(events.Events)
2023/01/10 13:30:03 [63bd3e2b] router: completed GET /nodejs/mest_gps_bildirim_server.git/info/refs?service=git-receive-pack for 212.154.94.120:59651, 307 Temporary Redirect in 4.0ms @ repo/http.go:532(repo.GetInfoRefs)
2023/01/10 13:30:03 [63bd3e2b-2] router: completed GET /nodejs/gps_bildirim_server/info/refs?service=git-receive-pack for 212.154.94.120:59651, 401 Unauthorized in 2.0ms @ repo/http.go:532(repo.GetInfoRefs)
2023/01/10 13:30:24 [63bd3e40] router: completed HEAD / for 212.154.94.120:59706, 200 OK in 0.0ms @ web/web.go:132(web.Routes)
2023/01/10 13:30:29 [63bd3e44] router: completed GET /nodejs/gps_bildirim_server/info/refs?service=git-receive-pack for 212.154.94.120:59651, 200 OK in 614.0ms @ repo/http.go:532(repo.GetInfoRefs)
2023/01/10 13:30:49 [63bd3e59] router: completed HEAD / for 212.154.94.120:59762, 200 OK in 0.0ms @ web/web.go:132(web.Routes)
2023/01/10 13:30:55 [63bd3e5f] router: completed POST /api/internal/hook/pre-receive/nodejs/gps_bildirim_server for 127.0.0.1:0, 200 OK in 10.0ms @ private/hook_pre_receive.go:108(private.HookPreReceive)
2023/01/10 13:30:56 router: completed POST /api/internal/hook/post-receive/nodejs/gps_bildirim_server for 127.0.0.1:0, 200 OK in 13.0ms @ private/hook_post_receive.go:28(private.HookPostReceive)
2023/01/10 13:30:56 [63bd3e5e] router: completed POST /nodejs/gps_bildirim_server/git-receive-pack for 212.154.94.120:59651, 200 OK in 1874.1ms @ repo/http.go:500(repo.ServiceReceivePack)
2023/01/10 13:30:57 ...it/repo_attribute.go:408:func2() [E] [63bd3e61-3] Unable to open checker for 79defd44cc1e83c1549d3d2598978b930aa2b88b. Error: failed to run attr-check. Error: exit status 1
        Stderr:

@emehmet
Copy link

emehmet commented Jan 10, 2023

@emehmet that LOCAL_ROOT_URL is not an URL and could never work.

From your app.ini it should be:

[server]
...
LOCAL_ROOT_URL = http://127.0.0.1:1881/
...

I had installed from scratch and localhost was written there. It was fixed by typing 127.0.0.1:1881 in app.ini.
Yes you are right. It works. Thank you! 👍

@zeripath
Copy link
Contributor

@emehmet whilst I'm glad you uploaded more logs - you still didn't give us debug logs. Why didn't you change your [log] section as is described in the linked documentation?Is it somehow unclear? I only ask because you're not the only one who fails to do this!! Why are people not doing this?!

In any case it appears that setting the LOCAL_ROOT_URL as I suggested above works.

That means at least for you this is a duplicate of the problem in #22370.

I still don't understand why this has occurred - as far as I can see we have made no changes to the dialer there.

@emehmet
Copy link

emehmet commented Jan 10, 2023

Hey @zeripath,
I missed that point, sorry! I have shared the log of the malfunctioning version below by making LEVEL = debug and ENABLE_SSH_LOG = true

2023/01/10 14:07:17 cmd/web.go:106:runWeb() [I] Starting Gitea on PID: 41528
2023/01/10 14:07:17 cmd/web.go:160:runWeb() [I] Global init
2023/01/10 14:07:18 routers/init.go:116:GlobalInitInstalled() [I] Git Version: 2.37.1, Wire Protocol Version 2 Enabled (home: C:\git_repo\data\home)
2023/01/10 14:07:18 routers/init.go:117:GlobalInitInstalled() [I] AppPath: C:/git_repo/gitea-1.12.3-windows-4.0-amd64.exe
2023/01/10 14:07:18 routers/init.go:118:GlobalInitInstalled() [I] AppWorkPath: C:/git_repo
2023/01/10 14:07:18 routers/init.go:119:GlobalInitInstalled() [I] Custom path: C:/git_repo/custom
2023/01/10 14:07:18 routers/init.go:120:GlobalInitInstalled() [I] Log path: C:/git_repo/log
2023/01/10 14:07:18 routers/init.go:121:GlobalInitInstalled() [I] Configuration file: C:/git_repo/custom/conf/app.ini
2023/01/10 14:07:18 routers/init.go:122:GlobalInitInstalled() [I] Run Mode: Prod
2023/01/10 14:07:18 ...dules/setting/log.go:288:newLogService() [I] Gitea v1.18.0 built with GNU Make 4.1, go1.19.4 : bindata, sqlite, sqlite_unlock_notify
2023/01/10 14:07:18 ...dules/setting/log.go:335:newLogService() [I] Gitea Log Mode: Console(Console:debug)
2023/01/10 14:07:18 ...dules/setting/log.go:249:generateNamedLogger() [I] Router Log: Console(console:debug)
2023/01/10 14:07:18 ...les/setting/cache.go:76:newCacheService() [I] Cache Service Enabled
2023/01/10 14:07:18 ...les/setting/cache.go:91:newCacheService() [I] Last Commit Cache Service Enabled
2023/01/10 14:07:18 ...s/setting/session.go:73:newSessionService() [I] Session Service Enabled
2023/01/10 14:07:18 ...s/storage/storage.go:176:initAttachments() [I] Initialising Attachment storage with type:
2023/01/10 14:07:18 ...les/storage/local.go:46:NewLocalStorage() [I] Creating new Local Storage at C:\git_repo\data\attachments
2023/01/10 14:07:18 ...s/storage/storage.go:170:initAvatars() [I] Initialising Avatar storage with type:
2023/01/10 14:07:18 ...les/storage/local.go:46:NewLocalStorage() [I] Creating new Local Storage at C:\git_repo\data\avatars
2023/01/10 14:07:18 ...s/storage/storage.go:188:initRepoAvatars() [I] Initialising Repository Avatar storage with type:
2023/01/10 14:07:18 ...les/storage/local.go:46:NewLocalStorage() [I] Creating new Local Storage at C:\git_repo\data\repo-avatars
2023/01/10 14:07:18 ...s/storage/storage.go:182:initLFS() [I] Initialising LFS storage with type:
2023/01/10 14:07:18 ...les/storage/local.go:46:NewLocalStorage() [I] Creating new Local Storage at C:\git_repo\data\lfs
2023/01/10 14:07:18 ...s/storage/storage.go:194:initRepoArchives() [I] Initialising Repository Archive storage with type:
2023/01/10 14:07:18 ...les/storage/local.go:46:NewLocalStorage() [I] Creating new Local Storage at C:\git_repo\data\repo-archive
2023/01/10 14:07:18 ...s/storage/storage.go:200:initPackages() [I] Initialising Packages storage with type:
2023/01/10 14:07:18 ...les/storage/local.go:46:NewLocalStorage() [I] Creating new Local Storage at C:\git_repo\data\packages
2023/01/10 14:07:18 ...ueue_disk_channel.go:159:Run() [D] [63bd46e6-17] PersistableChannelQueue: notification-service Starting
2023/01/10 14:07:18 ...ueue_disk_channel.go:194:Run() [D] [63bd46e6-17] PersistableChannelQueue: notification-service Skipping running the empty level queue
2023/01/10 14:07:18 ...ue/queue_bytefifo.go:335:Shutdown() [D] [63bd46e6-17] level: notification-service-level Shutdown
2023/01/10 14:07:18 ...ueue_disk_channel.go:188:Run() [D] [63bd46e6-19] PersistableChannelUniqueQueue: repo-archive Starting
2023/01/10 14:07:18 ...ueue_disk_channel.go:223:Run() [D] [63bd46e6-19] PersistableChannelUniqueQueue: repo-archive Skipping running the empty level queue
2023/01/10 14:07:18 ...ue/queue_bytefifo.go:335:Shutdown() [D] [63bd46e6-19] unique-level: repo-archive-level Shutdown
2023/01/10 14:07:18 routers/init.go:140:GlobalInitInstalled() [I] SQLite3 support is enabled
2023/01/10 14:07:18 routers/common/db.go:20:InitDBEngine() [I] Beginning ORM engine initialization.
2023/01/10 14:07:18 routers/common/db.go:27:InitDBEngine() [I] ORM engine initialization attempt #1/10...
2023/01/10 14:07:18 cmd/web.go:163:runWeb() [I] PING DATABASE sqlite3
2023/01/10 14:07:18 routers/init.go:145:GlobalInitInstalled() [W] Table system_setting Column version db default is , struct default is 1
2023/01/10 14:07:18 routers/init.go:145:GlobalInitInstalled() [W] Table email_address Column lower_email db nullable is true, struct nullable is false
2023/01/10 14:07:18 routers/init.go:145:GlobalInitInstalled() [W] Table hook_task has column repo_id but struct has not related field
2023/01/10 14:07:18 routers/init.go:146:GlobalInitInstalled() [I] ORM engine initialization successful!
2023/01/10 14:07:18 ...ueue_disk_channel.go:159:Run() [D] [63bd46e6-21] PersistableChannelQueue: push_update Starting
2023/01/10 14:07:18 ...ueue_disk_channel.go:194:Run() [D] [63bd46e6-21] PersistableChannelQueue: push_update Skipping running the empty level queue
2023/01/10 14:07:18 ...ue/queue_bytefifo.go:335:Shutdown() [D] [63bd46e6-21] level: push_update-level Shutdown
2023/01/10 14:07:18 ...er/issues/indexer.go:174:func2() [I] [63bd46e6-23] PID 41528: Initializing Issue Indexer: bleve
2023/01/10 14:07:18 ...ueue_disk_channel.go:188:Run() [D] [63bd46e6-25] PersistableChannelUniqueQueue: repo_stats_update Starting
2023/01/10 14:07:18 ...xer/stats/indexer.go:39:populateRepoIndexer() [I] Populating the repo stats indexer with existing repositories
2023/01/10 14:07:18 ...ueue_disk_channel.go:188:Run() [D] [63bd46e6-27] PersistableChannelUniqueQueue: mirror Starting
2023/01/10 14:07:18 ...ueue_disk_channel.go:188:Run() [D] [63bd46e6-29] PersistableChannelUniqueQueue: webhook_sender Starting
2023/01/10 14:07:18 ...ueue_disk_channel.go:223:Run() [D] [63bd46e6-25] PersistableChannelUniqueQueue: repo_stats_update Skipping running the empty level queue
2023/01/10 14:07:18 ...ueue_disk_channel.go:188:Run() [D] [63bd46e6-31] PersistableChannelUniqueQueue: pr_patch_checker Starting
2023/01/10 14:07:18 ...ueue_disk_channel.go:188:Run() [D] [63bd46e6-33] PersistableChannelUniqueQueue: pr_auto_merge Starting
2023/01/10 14:07:18 ...ueue_disk_channel.go:159:Run() [D] [63bd46e6-35] PersistableChannelQueue: task Starting
2023/01/10 14:07:18 ...ueue_disk_channel.go:223:Run() [D] [63bd46e6-27] PersistableChannelUniqueQueue: mirror Skipping running the empty level queue
2023/01/10 14:07:18 ...xer/stats/indexer.go:85:populateRepoIndexer() [I] Done (re)populating the repo stats indexer with existing repositories
2023/01/10 14:07:18 ...er/issues/indexer.go:204:func2() [D] [63bd46e6-23] Created Bleve Indexer
2023/01/10 14:07:18 ...ueue_disk_channel.go:223:Run() [D] [63bd46e6-29] PersistableChannelUniqueQueue: webhook_sender Skipping running the empty level queue
2023/01/10 14:07:18 ...ue/queue_bytefifo.go:335:Shutdown() [D] [63bd46e6-25] unique-level: repo_stats_update-level Shutdown
2023/01/10 14:07:18 ...ueue_disk_channel.go:223:Run() [D] [63bd46e6-31] PersistableChannelUniqueQueue: pr_patch_checker Skipping running the empty level queue
2023/01/10 14:07:18 ...ueue_disk_channel.go:223:Run() [D] [63bd46e6-33] PersistableChannelUniqueQueue: pr_auto_merge Skipping running the empty level queue
2023/01/10 14:07:18 ...ueue_disk_channel.go:194:Run() [D] [63bd46e6-35] PersistableChannelQueue: task Skipping running the empty level queue
2023/01/10 14:07:18 ...ue/queue_bytefifo.go:335:Shutdown() [D] [63bd46e6-27] unique-level: mirror-level Shutdown
2023/01/10 14:07:18 ...er/issues/indexer.go:270:func3() [I] [63bd46e6-23] Issue Indexer Initialization took 5.0001ms
2023/01/10 14:07:18 ...ue/queue_bytefifo.go:159:Run() [D] [63bd46e6-24] level: issue_indexer Starting
2023/01/10 14:07:18 ...ue/queue_bytefifo.go:335:Shutdown() [D] [63bd46e6-29] unique-level: webhook_sender-level Shutdown
2023/01/10 14:07:18 ...ue/queue_bytefifo.go:335:Shutdown() [D] [63bd46e6-31] unique-level: pr_patch_checker-level Shutdown
2023/01/10 14:07:18 ...ue/queue_bytefifo.go:335:Shutdown() [D] [63bd46e6-33] unique-level: pr_auto_merge-level Shutdown
2023/01/10 14:07:18 ...ue/queue_bytefifo.go:335:Shutdown() [D] [63bd46e6-35] level: task-level Shutdown
2023/01/10 14:07:18 ...rvices/cron/tasks.go:148:RegisterTask() [D] [63bd46e6-38] Registering task: update_mirrors
2023/01/10 14:07:18 ...rvices/cron/tasks.go:148:RegisterTask() [D] [63bd46e6-38] Registering task: repo_health_check
2023/01/10 14:07:18 ...rvices/cron/tasks.go:148:RegisterTask() [D] [63bd46e6-38] Registering task: check_repo_stats
2023/01/10 14:07:18 ...rvices/cron/tasks.go:148:RegisterTask() [D] [63bd46e6-38] Registering task: archive_cleanup
2023/01/10 14:07:18 ...rvices/cron/tasks.go:148:RegisterTask() [D] [63bd46e6-38] Registering task: sync_external_users
2023/01/10 14:07:18 ...rvices/cron/tasks.go:148:RegisterTask() [D] [63bd46e6-38] Registering task: deleted_branches_cleanup
2023/01/10 14:07:18 ...rvices/cron/tasks.go:148:RegisterTask() [D] [63bd46e6-38] Registering task: update_migration_poster_id
2023/01/10 14:07:18 ...rvices/cron/tasks.go:148:RegisterTask() [D] [63bd46e6-38] Registering task: cleanup_hook_task_table
2023/01/10 14:07:18 ...rvices/cron/tasks.go:148:RegisterTask() [D] [63bd46e6-38] Registering task: cleanup_packages
2023/01/10 14:07:18 ...rvices/cron/tasks.go:148:RegisterTask() [D] [63bd46e6-38] Registering task: delete_inactive_accounts
2023/01/10 14:07:18 ...rvices/cron/tasks.go:148:RegisterTask() [D] [63bd46e6-38] Registering task: delete_repo_archives
2023/01/10 14:07:18 ...rvices/cron/tasks.go:148:RegisterTask() [D] [63bd46e6-38] Registering task: git_gc_repos
2023/01/10 14:07:18 ...rvices/cron/tasks.go:148:RegisterTask() [D] [63bd46e6-38] Registering task: resync_all_sshkeys
2023/01/10 14:07:18 ...rvices/cron/tasks.go:148:RegisterTask() [D] [63bd46e6-38] Registering task: resync_all_sshprincipals
2023/01/10 14:07:18 ...rvices/cron/tasks.go:148:RegisterTask() [D] [63bd46e6-38] Registering task: resync_all_hooks
2023/01/10 14:07:18 ...rvices/cron/tasks.go:148:RegisterTask() [D] [63bd46e6-38] Registering task: reinit_missing_repos
2023/01/10 14:07:18 ...rvices/cron/tasks.go:148:RegisterTask() [D] [63bd46e6-38] Registering task: delete_missing_repos
2023/01/10 14:07:18 ...rvices/cron/tasks.go:148:RegisterTask() [D] [63bd46e6-38] Registering task: delete_generated_repository_avatars
2023/01/10 14:07:18 ...rvices/cron/tasks.go:148:RegisterTask() [D] [63bd46e6-38] Registering task: delete_old_actions
2023/01/10 14:07:18 ...rvices/cron/tasks.go:148:RegisterTask() [D] [63bd46e6-38] Registering task: update_checker
2023/01/10 14:07:18 ...rvices/cron/tasks.go:148:RegisterTask() [D] [63bd46e6-38] Registering task: delete_old_system_notices
2023/01/10 14:07:18 routers/init.go:179:NormalRoutes() [D] Creating static HTML Renderer
2023/01/10 14:07:18 cmd/web.go:220:listen() [I] [63bd46e6-45] Listen: http://0.0.0.0:1881
2023/01/10 14:07:18 cmd/web.go:224:listen() [I] [63bd46e6-45] AppURL(ROOT_URL): http://xxx.com:1881/
2023/01/10 14:07:18 ...s/graceful/server.go:62:NewServer() [I] [63bd46e6-45] Starting new Web server: tcp:0.0.0.0:1881 on PID: 41528
2023/01/10 14:07:18 ...s/graceful/server.go:75:func1() [D] [63bd46e6-45] Starting server on tcp:0.0.0.0:1881 (PID: 41528)
2023/01/10 14:07:22 [63bd46ea] router: completed GET /expo/gps-arayuz.git/info/refs?service=git-upload-pack for 212.154.94.120:61665, 401 Unauthorized in 1.0ms @ repo/http.go:532(repo.GetInfoRefs)
2023/01/10 14:07:29 [63bd46e6-44] router: polling   GET /user/events for 212.154.94.120:61690, elapsed 3926.2ms @ events/events.go:19(events.Events)
2023/01/10 14:07:44 [63bd4700] router: completed HEAD / for 212.154.94.120:61737, 200 OK in 0.0ms @ web/web.go:132(web.Routes)
2023/01/10 14:07:49 ...dules/git/command.go:215:Run() [D] [63bd4705] C:\OneDrive\gitea-repositories\expo\gps-arayuz.git: C:\Program Files\Git\cmd\git.exe -c protocol.version=2 -c credential.helper= upload-pack --stateless-rpc --advertise-refs .
2023/01/10 14:07:49 [63bd4705] router: completed GET /expo/gps-arayuz.git/info/refs?service=git-upload-pack for 212.154.94.120:61665, 200 OK in 90.0ms @ repo/http.go:532(repo.GetInfoRefs)
2023/01/10 14:08:07 [63bd4717] router: completed HEAD / for 212.154.94.120:61824, 200 OK in 0.0ms @ web/web.go:132(web.Routes)
2023/01/10 14:08:11 ...dules/git/command.go:215:Run() [D] [63bd471b] C:\OneDrive\gitea-repositories\expo\gps-arayuz.git: C:\Program Files\Git\cmd\git.exe -c protocol.version=2 -c credential.helper= upload-pack --stateless-rpc C:\OneDrive\gitea-repositories\expo\gps-arayuz.git
2023/01/10 14:08:11 [63bd471b] router: completed POST /expo/gps-arayuz.git/git-upload-pack for 212.154.94.120:61665, 200 OK in 69.0ms @ repo/http.go:492(repo.ServiceUploadPack)
2023/01/10 14:08:43 ...dules/git/command.go:215:Run() [D] [63bd473b] C:\OneDrive\gitea-repositories\nodejs\gps_bildirim_server.git: C:\Program Files\Git\cmd\git.exe -c protocol.version=2 -c credential.helper= rev-list --count 79defd44cc1e83c1549d3d2598978b930aa2b88b
2023/01/10 14:08:43 ...ers/web/repo/view.go:192:findReadmeFile() [D] [63bd473b] Potential readme file: README.md
2023/01/10 14:08:43 ...s/charset/charset.go:154:DetectEncoding() [D] [63bd473b] Detected encoding: utf-8 (fast)
2023/01/10 14:08:43 ...s/context/context.go:220:HTML() [D] [63bd473b] Template: repo/home
2023/01/10 14:08:43 modules/base/tool.go:266:EntryIcon() [D] [63bd473b] GpsGraphqlTypes.graphql: points outside of repo
2023/01/10 14:08:43 modules/base/tool.go:266:EntryIcon() [D] [63bd473b] MongoGraphqlTypes.graphql: points outside of repo
2023/01/10 14:08:43 modules/base/tool.go:266:EntryIcon() [D] [63bd473b] MysqlGraphqlTypes.graphql: points outside of repo
2023/01/10 14:08:43 [63bd473b] router: completed GET /nodejs/gps_bildirim_server for 212.154.94.120:61857, 200 OK in 177.0ms @ repo/view.go:722(repo.Home)
2023/01/10 14:08:44 ...dules/git/command.go:215:Run() [D] [63bd473c] C:\OneDrive\gitea-repositories\server_productions\mest_gps_bildirim_server.git: C:\Program Files\Git\cmd\git.exe -c protocol.version=2 -c credential.helper= rev-list --count aece60e48e36bfd0526b1d5f2599fd4d914bc70c
2023/01/10 14:08:44 ...s/context/context.go:220:HTML() [D] [63bd473c] Template: repo/home
2023/01/10 14:08:44 [63bd473c] router: completed GET /server_productions/mest_gps_bildirim_server for 185.92.2.70:55580, 200 OK in 81.0ms @ repo/view.go:722(repo.Home)
2023/01/10 14:08:44 [63bd473c-3] router: completed GET /avatar/0b1d732f54f881156be7a38c4b5296c1?size=72 for 212.154.94.120:61857, 303 See Other in 90.0ms @ user/avatar.go:49(user.AvatarByEmailHash)
2023/01/10 14:08:45 [63bd473d] router: completed GET /avatar/959d85235bebcf1e877d933821bad93c?size=72 for 185.92.2.70:55580, 303 See Other in 2.0ms @ user/avatar.go:49(user.AvatarByEmailHash)
2023/01/10 14:08:45 [63bd473d-2] router: completed GET /avatar/0b1d732f54f881156be7a38c4b5296c1?size=72 for 185.92.2.70:55580, 303 See Other in 2.0ms @ user/avatar.go:49(user.AvatarByEmailHash)
2023/01/10 14:08:49 [63bd46e6-44] router: polling   GET /user/events for 185.92.2.70:55580, elapsed 3240.2ms @ events/events.go:19(events.Events)

@DuaneDu
Copy link

DuaneDu commented Jan 11, 2023

push_reject

log config

[log]
MODE      = file,traceconsole
LEVEL     = trace
ROOT_PATH = D:/work/gitea/log
[log.traceconsole]
MODE = console
LEVEL = trace

showSql=true
gitea.log

showSql=false
gitea.log

@zeripath
Copy link
Contributor

@DuaneDu set your LOCAL_ROOT_URL as described above.

These problems have the same root cause and are all duplicates of each other.

@zeripath zeripath added issue/duplicate The issue has already been reported. and removed issue/needs-feedback For bugs, we need more details. For features, the feature must be described in more detail labels Jan 11, 2023
@zeripath
Copy link
Contributor

Duplicate of #22370.

Users affected should set LOCAL_ROOT_URL as their hosts file most likely doesn't contain a valid alias for localhost. I don't understand why go has suddenly broke this but it's not our fault - we'll investigate more in the other issue.

@go-gitea go-gitea locked and limited conversation to collaborators May 3, 2023
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

No branches or pull requests

8 participants