push error: remote: Unable to contact gitea: Post "http://localhost:10080 #5093

Closed
opened 2025-11-02 06:14:14 -06:00 by GiteaMirror · 5 comments
Owner

Originally created by @a1pages on GitHub (Mar 21, 2020).

  • Gitea version (or commit ref): 1.12.0+dev
  • Git version: 2.24.1
  • Operating system: CentOS 7.7
  • 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

use docker
docker version: 19.03.5
new system
docker run -d --name=gitea -p 10022:22 -p 10080:3000 -v /data/gitea:/data gitea/gitea:latest
```bash
app.ini
[server]
APP_DATA_PATH    = /data/gitea
SSH_DOMAIN       = localhost
HTTP_PORT        = 10080
ROOT_URL         = http://192.168.1.16:10080/
DISABLE_SSH      = true
SSH_PORT         = 22
SSH_LISTEN_PORT  = 22
LFS_START_SERVER = true
LFS_CONTENT_PATH = /data/git/lfs
DOMAIN           = localhost
LFS_JWT_SECRET   = V7nMxFMqK8VhmErOiSqKdrVGwM8ZLdbFfGWGNLuYS5g
OFFLINE_MODE     = false

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

create new project
http://192.168.1.16:10080/p1/go-gitea.git

git clone http://192.168.1.16:10080/p1/go-gitea.git
echo "xx" >> go-gite/README.md
git add -A
git commit -m "M README.md"
git push origin master

error

Username for 'http://192.168.1.16:10080': x
Password for 'http://xuan@192.168.1.16:10080': 
Counting objects: 8, done.
Delta compression using up to 4 threads.
Compressing objects: 100% (2/2), done.
Writing objects: 100% (6/6), 471 bytes | 0 bytes/s, done.
Total 6 (delta 0), reused 0 (delta 0)
remote: Gitea: Internal Server Error
remote: Unable to contact gitea: Post "http://localhost:10080/api/internal/hook/pre-receive/p1/go-gitea": dial tcp 127.0.0.1:10080: connect: connection refused
To http://192.168.1.16:10080/p1/go-gitea.git
 ! [remote rejected] master -> master (pre-receive hook declined)
error: failed to push some refs to 'http://192.168.1.16:10080/p1/go-gitea.git'

...

Screenshots

Originally created by @a1pages on GitHub (Mar 21, 2020). <!-- NOTE: If your issue is a security concern, please send an email to security@gitea.io instead of opening a public issue --> <!-- 1. Please speak English, this is the language all maintainers can speak and write. 2. Please ask questions or configuration/deploy problems on our Discord server (https://discord.gg/gitea) 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): 1.12.0+dev - Git version: 2.24.1 - Operating system: CentOS 7.7 - Database (use `[x]`): - [ ] PostgreSQL - [ ] MySQL - [ ] MSSQL - [x] SQLite - Can you reproduce the bug at https://try.gitea.io: - [ ] Yes (provide example URL) - [x] No - [ ] Not relevant - Log gist: ## Description ```bash use docker docker version: 19.03.5 new system ``` ```bash docker run -d --name=gitea -p 10022:22 -p 10080:3000 -v /data/gitea:/data gitea/gitea:latest ```bash app.ini [server] APP_DATA_PATH = /data/gitea SSH_DOMAIN = localhost HTTP_PORT = 10080 ROOT_URL = http://192.168.1.16:10080/ DISABLE_SSH = true SSH_PORT = 22 SSH_LISTEN_PORT = 22 LFS_START_SERVER = true LFS_CONTENT_PATH = /data/git/lfs DOMAIN = localhost LFS_JWT_SECRET = V7nMxFMqK8VhmErOiSqKdrVGwM8ZLdbFfGWGNLuYS5g OFFLINE_MODE = false [database] PATH = /data/gitea/gitea.db DB_TYPE = sqlite3 HOST = localhost:3306 NAME = gitea USER = root ``` create new project http://192.168.1.16:10080/p1/go-gitea.git ```bash git clone http://192.168.1.16:10080/p1/go-gitea.git echo "xx" >> go-gite/README.md git add -A git commit -m "M README.md" git push origin master ``` ### error ```bash Username for 'http://192.168.1.16:10080': x Password for 'http://xuan@192.168.1.16:10080': Counting objects: 8, done. Delta compression using up to 4 threads. Compressing objects: 100% (2/2), done. Writing objects: 100% (6/6), 471 bytes | 0 bytes/s, done. Total 6 (delta 0), reused 0 (delta 0) remote: Gitea: Internal Server Error remote: Unable to contact gitea: Post "http://localhost:10080/api/internal/hook/pre-receive/p1/go-gitea": dial tcp 127.0.0.1:10080: connect: connection refused To http://192.168.1.16:10080/p1/go-gitea.git ! [remote rejected] master -> master (pre-receive hook declined) error: failed to push some refs to 'http://192.168.1.16:10080/p1/go-gitea.git' ``` ... ## Screenshots <!-- **If this issue involves the Web Interface, please include a screenshot** -->
GiteaMirror added the type/questionissue/stale labels 2025-11-02 06:14:14 -06:00
Author
Owner

@zeripath commented on GitHub (Mar 21, 2020):

Your config is incorrect.

You are publishing the local docker container port 3000 as port on the host 10080.

Therefore you need to set your LOCAL_ROOT_URL=http://localhost:3000.

You should leave HTTP_PORT=3000

You should also set SSH_PORT=10022

@zeripath commented on GitHub (Mar 21, 2020): Your config is incorrect. You are publishing the local docker container port 3000 as port on the host 10080. Therefore you need to set your `LOCAL_ROOT_URL=http://localhost:3000`. You should leave `HTTP_PORT=3000` You should also set `SSH_PORT=10022`
Author
Owner

@zeripath commented on GitHub (Mar 21, 2020):

Please see: https://docs.gitea.io/en-us/config-cheat-sheet/

@zeripath commented on GitHub (Mar 21, 2020): Please see: https://docs.gitea.io/en-us/config-cheat-sheet/
Author
Owner

@stale[bot] commented on GitHub (May 20, 2020):

This issue has been automatically marked as stale because it has not had recent activity. I am here to help clear issues left open even if solved or waiting for more insight. This issue will be closed if no further activity occurs during the next 2 weeks. If the issue is still valid just add a comment to keep it alive. Thank you for your contributions.

@stale[bot] commented on GitHub (May 20, 2020): This issue has been automatically marked as stale because it has not had recent activity. I am here to help clear issues left open even if solved or waiting for more insight. This issue will be closed if no further activity occurs during the next 2 weeks. If the issue is still valid just add a comment to keep it alive. Thank you for your contributions.
Author
Owner

@stale[bot] commented on GitHub (Jun 3, 2020):

This issue has been automatically closed because of inactivity. You can re-open it if needed.

@stale[bot] commented on GitHub (Jun 3, 2020): This issue has been automatically closed because of inactivity. You can re-open it if needed.
Author
Owner

@zepc007 commented on GitHub (Jun 5, 2020):

Your config is incorrect.

You are publishing the local docker container port 3000 as port on the host 10080.

Therefore you need to set your LOCAL_ROOT_URL=http://localhost:3000.

You should leave HTTP_PORT=3000

You should also set SSH_PORT=10022

Fixed my problem

@zepc007 commented on GitHub (Jun 5, 2020): > Your config is incorrect. > > You are publishing the local docker container port 3000 as port on the host 10080. > > Therefore you need to set your `LOCAL_ROOT_URL=http://localhost:3000`. > > You should leave `HTTP_PORT=3000` > > You should also set `SSH_PORT=10022` Fixed my problem
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: github-starred/gitea#5093