Web interface not showing new commits #6836

Closed
opened 2025-11-02 07:08:05 -06:00 by GiteaMirror · 10 comments
Owner

Originally created by @jackm on GitHub (Feb 10, 2021).

  • Gitea version (or commit ref): 1.13.1
  • Git version: 2.26.2
  • Operating system: Alpine Linux 3.12.3, running gitea as a service with openrc init system
  • Database:
    • PostgreSQL
    • MySQL
    • MSSQL
    • SQLite
  • Can you reproduce the bug at https://try.gitea.io:
    • Yes (provide example URL)
    • No
  • Log gist:

Description

I can push to Gitea hosted repositories, however new commits do not show up on the web interface. However I know that the remote server has the commits because I can also clone the same repository from the Gitea server and all of the commits are there. Why would there be a disconnect between what commits the web interface sees and what the backend git server has?

Whenever I push new commits to the remote, it reports back an internal server error saying "invalid character '<' looking for beginning of value". This happens on the first push to an empty repo as well as on subsequent pushes. I am unsure if this is related to the problem above.

After git push (sanitized):

Enumerating objects: 3, done.
Counting objects: 100% (3/3), done.
Writing objects: 100% (3/3), 222 bytes | 222.00 KiB/s, done.
Total 3 (delta 0), reused 0 (delta 0), pack-reused 0
remote: Gitea: Internal Server Error
remote: invalid character '<' looking for beginning of value
To https://git.example.com/myuser/testrepo.git
 * [new branch]      master -> master
Branch 'master' set up to track remote branch 'master' from 'origin'.

Debug log (sanitized):

2021/02/09 18:31:24 Started GET /myuser/testrepo.git/info/refs?service=git-receive-pack for xxx.xxx.xxx.170
2021/02/09 18:31:24 ...s/context/context.go:332:func1() [D] Session ID: 5488dc4b1fc5fc7e
2021/02/09 18:31:24 ...s/context/context.go:333:func1() [D] CSRF Token: wzL0T8FeuqdgLd8lE6ktXH6vEWg6qTYxMjkxMz24PDY5Nzc5MDQ1NQ
2021/02/09 18:31:24 Completed GET /myuser/testrepo.git/info/refs?service=git-receive-pack 401 Unauthorized in 1.820473ms
2021/02/09 18:31:24 Started GET /myuser/testrepo.git/info/refs?service=git-receive-pack for xxx.xxx.xxx.170
2021/02/09 18:31:24 ...s/context/context.go:332:func1() [D] Session ID: 989b761d6c819834
2021/02/09 18:31:24 ...s/context/context.go:333:func1() [D] CSRF Token: ZMr4nc8rS9Hz70l7ra2Y5cqeUeA6M22xMjkxMzQ4NDczOTM0MzczMQ
2021/02/09 18:31:25 Completed GET /myuser/testrepo.git/info/refs?service=git-receive-pack 200 OK in 357.426572ms
2021/02/09 18:31:25 Started POST /myuser/testrepo.git/git-receive-pack for xxx.xxx.xxx.170
2021/02/09 18:31:25 ...s/context/context.go:332:func1() [D] Session ID: ac96f9afed63d6a1
2021/02/09 18:31:25 ...s/context/context.go:333:func1() [D] CSRF Token: W_geL2ni2PCH9O52p3lulOgVJNx6MTYxMjk5MzQ4NTE0N9IxMzB0Nw
2021/02/09 18:31:27 Completed POST /myuser/testrepo.git/git-receive-pack 200 OK in 2.047183554s
Originally created by @jackm on GitHub (Feb 10, 2021). - Gitea version (or commit ref): 1.13.1 - Git version: 2.26.2 - Operating system: Alpine Linux 3.12.3, running gitea as a service with openrc init system - Database: - [ ] PostgreSQL - [ ] MySQL - [ ] MSSQL - [x] SQLite - Can you reproduce the bug at https://try.gitea.io: - [ ] Yes (provide example URL) - [x] No - Log gist: ## Description I can push to Gitea hosted repositories, however new commits do not show up on the web interface. However I know that the remote server has the commits because I can also clone the same repository from the Gitea server and all of the commits are there. Why would there be a disconnect between what commits the web interface sees and what the backend git server has? Whenever I push new commits to the remote, it reports back an internal server error saying "invalid character '<' looking for beginning of value". This happens on the first push to an empty repo as well as on subsequent pushes. I am unsure if this is related to the problem above. After git push (sanitized): ``` Enumerating objects: 3, done. Counting objects: 100% (3/3), done. Writing objects: 100% (3/3), 222 bytes | 222.00 KiB/s, done. Total 3 (delta 0), reused 0 (delta 0), pack-reused 0 remote: Gitea: Internal Server Error remote: invalid character '<' looking for beginning of value To https://git.example.com/myuser/testrepo.git * [new branch] master -> master Branch 'master' set up to track remote branch 'master' from 'origin'. ``` Debug log (sanitized): ``` 2021/02/09 18:31:24 Started GET /myuser/testrepo.git/info/refs?service=git-receive-pack for xxx.xxx.xxx.170 2021/02/09 18:31:24 ...s/context/context.go:332:func1() [D] Session ID: 5488dc4b1fc5fc7e 2021/02/09 18:31:24 ...s/context/context.go:333:func1() [D] CSRF Token: wzL0T8FeuqdgLd8lE6ktXH6vEWg6qTYxMjkxMz24PDY5Nzc5MDQ1NQ 2021/02/09 18:31:24 Completed GET /myuser/testrepo.git/info/refs?service=git-receive-pack 401 Unauthorized in 1.820473ms 2021/02/09 18:31:24 Started GET /myuser/testrepo.git/info/refs?service=git-receive-pack for xxx.xxx.xxx.170 2021/02/09 18:31:24 ...s/context/context.go:332:func1() [D] Session ID: 989b761d6c819834 2021/02/09 18:31:24 ...s/context/context.go:333:func1() [D] CSRF Token: ZMr4nc8rS9Hz70l7ra2Y5cqeUeA6M22xMjkxMzQ4NDczOTM0MzczMQ 2021/02/09 18:31:25 Completed GET /myuser/testrepo.git/info/refs?service=git-receive-pack 200 OK in 357.426572ms 2021/02/09 18:31:25 Started POST /myuser/testrepo.git/git-receive-pack for xxx.xxx.xxx.170 2021/02/09 18:31:25 ...s/context/context.go:332:func1() [D] Session ID: ac96f9afed63d6a1 2021/02/09 18:31:25 ...s/context/context.go:333:func1() [D] CSRF Token: W_geL2ni2PCH9O52p3lulOgVJNx6MTYxMjk5MzQ4NTE0N9IxMzB0Nw 2021/02/09 18:31:27 Completed POST /myuser/testrepo.git/git-receive-pack 200 OK in 2.047183554s ```
Author
Owner

@bagasme commented on GitHub (Feb 10, 2021):

@jackm You may try to refresh the web interface

@bagasme commented on GitHub (Feb 10, 2021): @jackm You may try to refresh the web interface
Author
Owner

@zeripath commented on GitHub (Feb 10, 2021):

remote: Gitea: Internal Server Error
remote: invalid character '<' looking for beginning of value

This implies that the hooks in your gitea repositories are not able to communicate with the running gitea server.

So...

You likely need to refresh the hooks in the web interface. And you should check that the LOCAL_ROOT_URL is set up in such a way that hooks running on your server can communicate with the running Gitea web service.

@zeripath commented on GitHub (Feb 10, 2021): ``` remote: Gitea: Internal Server Error remote: invalid character '<' looking for beginning of value ``` This implies that the hooks in your gitea repositories are not able to communicate with the running gitea server. So... You likely need to refresh the hooks in the web interface. And you should check that the LOCAL_ROOT_URL is set up in such a way that hooks running on your server can communicate with the running Gitea web service.
Author
Owner

@6543 commented on GitHub (Feb 10, 2021):

@jackm do you have installed gitea from the official alpine repos?

@6543 commented on GitHub (Feb 10, 2021): @jackm do you have installed gitea from the official alpine repos?
Author
Owner

@jackm commented on GitHub (Feb 10, 2021):

@zeripath I have already tried running the "Resynchronize pre-receive, update and post-receive hooks of all repositories." maintenance operation and it made no difference. I haven't moved any file locations that Gitea would use anyways.
In my Gitea ini config, LOCAL_ROOT_URL is not explicitly set so it is the default value.

@6543 Gitea package was installed from the "edge" Alpine repository.

"server" section in my Gitea ini config:

[server]
STATIC_ROOT_PATH = /usr/share/webapps/gitea
APP_DATA_PATH    = /var/lib/gitea/data
LFS_START_SERVER = true
LFS_JWT_SECRET   = xxxxxxxxxxxxxxxxxx
DOMAIN           = git.example.com
HTTP_PORT        = 443
ROOT_URL         = https://git.example.com/
DISABLE_SSH      = true ; Disable SSH feature until firewall rules are created
SSH_PORT         = 22
@jackm commented on GitHub (Feb 10, 2021): @zeripath I have already tried running the "Resynchronize pre-receive, update and post-receive hooks of all repositories." maintenance operation and it made no difference. I haven't moved any file locations that Gitea would use anyways. In my Gitea ini config, `LOCAL_ROOT_URL` is not explicitly set so it is the default value. @6543 Gitea package was installed from the "edge" Alpine repository. "server" section in my Gitea ini config: ``` [server] STATIC_ROOT_PATH = /usr/share/webapps/gitea APP_DATA_PATH = /var/lib/gitea/data LFS_START_SERVER = true LFS_JWT_SECRET = xxxxxxxxxxxxxxxxxx DOMAIN = git.example.com HTTP_PORT = 443 ROOT_URL = https://git.example.com/ DISABLE_SSH = true ; Disable SSH feature until firewall rules are created SSH_PORT = 22 ```
Author
Owner

@jackm commented on GitHub (Feb 10, 2021):

I think I have fixed it by setting LOCAL_ROOT_URL to http://0.0.0.0:443/.

The strange thing is that according to the Configuration Cheat Sheet the default value for LOCAL_ROOT_URL is %(PROTOCOL)s://%(HTTP_ADDR)s:%(HTTP_PORT)s/ which when looking at the rest of my server config values should also end up being http://0.0.0.0:443/, but omitting LOCAL_ROOT_URL in my config produces the error shown in my first post.

@jackm commented on GitHub (Feb 10, 2021): I think I have fixed it by setting `LOCAL_ROOT_URL` to `http://0.0.0.0:443/`. The strange thing is that according to the [Configuration Cheat Sheet](https://docs.gitea.io/en-us/config-cheat-sheet/#server-server) the default value for `LOCAL_ROOT_URL` is `%(PROTOCOL)s://%(HTTP_ADDR)s:%(HTTP_PORT)s/` which when looking at the rest of my server config values should also end up being `http://0.0.0.0:443/`, but omitting `LOCAL_ROOT_URL` in my config produces the error shown in my first post.
Author
Owner

@6543 commented on GitHub (Feb 10, 2021):

@jackm do you use a reverse proxy?

@6543 commented on GitHub (Feb 10, 2021): @jackm do you use a reverse proxy?
Author
Owner

@jackm commented on GitHub (Feb 10, 2021):

Yes the Gitea server is sitting behind a reverse proxy (HAProxy).

@jackm commented on GitHub (Feb 10, 2021): Yes the Gitea server is sitting behind a reverse proxy (HAProxy).
Author
Owner

@6543 commented on GitHub (Feb 10, 2021):

strange ... but god to know,
I may add LOCAL_ROOT_URL to default config in alpine ...

@6543 commented on GitHub (Feb 10, 2021): strange ... but god to know, I may add LOCAL_ROOT_URL to default config in alpine ...
Author
Owner

@jackm commented on GitHub (Feb 10, 2021):

Why would the default value for LOCAL_ROOT_URL act differently than if I set it explicitly? According to the documentation the default value is the same value that I set it to, yet behaviour is different.

@jackm commented on GitHub (Feb 10, 2021): Why would the default value for LOCAL_ROOT_URL act differently than if I set it explicitly? According to the documentation the default value _is_ the same value that I set it to, yet behaviour is different.
Author
Owner

@zeripath commented on GitHub (Feb 10, 2021):

@6543 there is something going weird with that package - the pre-receive hook will have exited with a non-zero exit code and git should not have updated any references. Similarly - gitea serv should have also returned non-zero and hence git should not have been running at all.

Something is very odd here.

@jackm I don't know, I suspect that what you think is the default LOCAL_ROOT_URL for at least one of gitea serv/pre-receive/post-receive is not what you think it is.

@zeripath commented on GitHub (Feb 10, 2021): @6543 there is something going weird with that package - the pre-receive hook will have exited with a non-zero exit code and git should not have updated any references. Similarly - gitea serv should have also returned non-zero and hence git should not have been running at all. Something is very odd here. @jackm I don't know, I suspect that what you think is the default LOCAL_ROOT_URL for at least one of gitea serv/pre-receive/post-receive is not what you think it is.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: github-starred/gitea#6836