500 error after migrating project from GitLab #7878

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

Originally created by @wusikijeronii on GitHub (Sep 22, 2021).

Gitea Version

1.5.3

Git Version

No response

Operating System

Docker image

How are you running Gitea?

I used docker image

Database

PostgreSQL

Can you reproduce the bug on the Gitea demo site?

No

Log Gist

No response

Description

When I migrate a project from self hosted GitLab, opening created project, I see 500 error in web browser.
Some lines from the log:

gitea | 2021/09/22 08:09:44 Started GET /wj/cddr3 for 172.16.0.29:0
gitea | 2021/09/22 08:09:44 ...ers/web/repo/view.go:623:Home() [E] models.GetMigratingTask: task is not exist [id: 0, repo_id: 77, type: 0]
gitea | 2021/09/22 08:09:44 Completed GET /wj/cddr3 500 Internal Server Error in 21.252254ms

Discussion link is here .

Screenshots

No response

Originally created by @wusikijeronii on GitHub (Sep 22, 2021). ### Gitea Version 1.5.3 ### Git Version _No response_ ### Operating System Docker image ### How are you running Gitea? I used docker image ### Database PostgreSQL ### Can you reproduce the bug on the Gitea demo site? No ### Log Gist _No response_ ### Description When I migrate a project from self hosted GitLab, opening created project, I see 500 error in web browser. Some lines from the log: > gitea | 2021/09/22 08:09:44 Started GET /wj/cddr3 for 172.16.0.29:0 gitea | 2021/09/22 08:09:44 ...ers/web/repo/view.go:623:Home() [E] models.GetMigratingTask: task is not exist [id: 0, repo_id: 77, type: 0] gitea | 2021/09/22 08:09:44 Completed GET /wj/cddr3 500 Internal Server Error in 21.252254ms Discussion link is [here](https://discourse.gitea.io/t/cant-migrate-project-from-gitlab/3801) . ### Screenshots _No response_
Author
Owner

@99rgosse commented on GitHub (Sep 22, 2021):

In your discussion, you're trying to import a Git from a file, not from the Gitlab API (Gitea importation pass through gitlab api, thus adding the api/v4/ in the path...)
Configure your app.ini to allow local migration
[migrations] ;; Allow private addresses defined by RFC 1918, RFC 1122, RFC 4632 and RFC 4291 (false by default) ALLOW_LOCALNETWORKS = true

Then retry importation with your self hosted gitlab API.

@99rgosse commented on GitHub (Sep 22, 2021): In your discussion, you're trying to import a Git from a file, not from the Gitlab API (Gitea importation pass through gitlab api, thus adding the api/v4/ in the path...) Configure your app.ini to allow local migration `[migrations] ;; Allow private addresses defined by RFC 1918, RFC 1122, RFC 4632 and RFC 4291 (false by default) ALLOW_LOCALNETWORKS = true` Then retry importation with your self hosted gitlab API.
Author
Owner

@wusikijeronii commented on GitHub (Sep 22, 2021):

In your discussion, you're trying to import a Git from a file, not from the Gitlab API (Gitea importation pass through gitlab api, thus adding the api/v4/ in the path...)
Configure your app.ini to allow local migration
[migrations] ;; Allow private addresses defined by RFC 1918, RFC 1122, RFC 4632 and RFC 4291 (false by default) ALLOW_LOCALNETWORKS = true

Then retry importation with your self hosted gitlab API.

Also tried. I also tried to bind domain with GitLab (my.domain/gitlab/*). Same problem.

@wusikijeronii commented on GitHub (Sep 22, 2021): > In your discussion, you're trying to import a Git from a file, not from the Gitlab API (Gitea importation pass through gitlab api, thus adding the api/v4/ in the path...) > Configure your app.ini to allow local migration > `[migrations] ;; Allow private addresses defined by RFC 1918, RFC 1122, RFC 4632 and RFC 4291 (false by default) ALLOW_LOCALNETWORKS = true` > > Then retry importation with your self hosted gitlab API. Also tried. I also tried to bind domain with GitLab (my.domain/gitlab/*). Same problem.
Author
Owner

@99rgosse commented on GitHub (Sep 22, 2021):

Also tried. I also tried to bind domain with GitLab (my.domain/gitlab/*). Same problem.

Please set your app.ini to dev mode + [log] to file with debug and retry an importation, then
paste the logs so that we can see where the importation fail

@99rgosse commented on GitHub (Sep 22, 2021): > Also tried. I also tried to bind domain with GitLab (my.domain/gitlab/*). Same problem. Please set your app.ini to dev mode + [log] to file with debug and retry an importation, then paste the logs so that we can see where the importation fail
Author
Owner

@wusikijeronii commented on GitHub (Sep 22, 2021):

Also tried. I also tried to bind domain with GitLab (my.domain/gitlab/*). Same problem.

Please set your app.ini to dev mode + [log] to file with debug and retry an importation, then
paste the logs so that we can see where the importation fail

I don't know how to configure logging into dev mode but I changed info level to debug.
Log (from creating to get request):

gitea | 2021/09/22 18:29:58 Completed POST /repo/migrate 302 Found in 158.271964ms
gitea | 2021/09/22 18:29:58 Started GET /wj/Test3 for 172.16.0.29:0
gitea | 2021/09/22 18:29:58 ...s/context/context.go:740:1() [D] Session ID: 51af886c4f962929
gitea | 2021/09/22 18:29:58 ...s/context/context.go:741:1() [D] CSRF Token: hTrGUzkClmnbcaMcwHq023DJmtw6MTYzMjMyNDM1OTU1MDcwNDUzNQ
gitea | 2021/09/22 18:29:58 ...s/context/context.go:185:HTML() [D] Template: repo/migrate/migrating
gitea | 2021/09/22 18:29:58 Completed GET /wj/Test3 200 OK in 21.761914ms
gitea | 2021/09/22 18:29:58 Started GET /avatar/af312e366617779e2a017ddebbf14e9a?size=96 for 172.16.0.29:0
gitea | 2021/09/22 18:29:58 ...s/context/context.go:740:1() [D] Session ID: 51af886c4f962929
gitea | 2021/09/22 18:29:58 ...s/context/context.go:741:1() [D] CSRF Token: hTrGUzkClmnbcaMcwHq023DJmtw6MTYzMjMyNDM1OTU1MDcwNDUzNQ
gitea | 2021/09/22 18:29:58 Completed GET /avatar/af312e366617779e2a017ddebbf14e9a?size=96 302 Found in 4.582322ms
gitea | 2021/09/22 18:29:59 Started GET /user/task/81?_csrf=hTrGUzkClmnbcaMcwHq023DJmtw6MTYzMjMyNDM1OTU1MDcwNDUzNQ for 172.16.0.29:0
gitea | 2021/09/22 18:29:59 ...s/context/context.go:740:1() [D] Session ID: 51af886c4f962929
gitea | 2021/09/22 18:29:59 ...s/context/context.go:741:1() [D] CSRF Token: hTrGUzkClmnbcaMcwHq023DJmtw6MTYzMjMyNDM1OTU1MDcwNDUzNQ
gitea | 2021/09/22 18:29:59 Completed GET /user/task/81?_csrf=hTrGUzkClmnbcaMcwHq023DJmtw6MTYzMjMyNDM1OTU1MDcwNDUzNQ 200 OK in 4.99329ms
gitea | 2021/09/22 18:29:59 modules/task/task.go:54:handle() [E] Run task failed: GET https://homedatasrv.ru/gitlab/api/v4/projects/root/test: 404 {message: 404 Project Not Found}
gitea | 2021/09/22 18:30:01 Started GET /user/task/81?_csrf=hTrGUzkClmnbcaMcwHq023DJmtw6MTYzMjMyNDM1OTU1MDcwNDUzNQ for 172.16.0.29:0
gitea | 2021/09/22 18:30:01 ...s/context/context.go:740:1() [D] Session ID: 51af886c4f962929
gitea | 2021/09/22 18:30:01 ...s/context/context.go:741:1() [D] CSRF Token: hTrGUzkClmnbcaMcwHq023DJmtw6MTYzMjMyNDM1OTU1MDcwNDUzNQ
gitea | 2021/09/22 18:30:01 Completed GET /user/task/81?_csrf=hTrGUzkClmnbcaMcwHq023DJmtw6MTYzMjMyNDM1OTU1MDcwNDUzNQ 200 OK in 5.06571ms
gitea | 2021/09/22 18:30:09 Started GET /api/v1/notifications/new for 172.16.0.29:0
gitea | 2021/09/22 18:30:09 Started GET /api/v1/user/stopwatches for 172.16.0.29:0
gitea | 2021/09/22 18:30:09 Completed GET /api/v1/notifications/new 200 OK in 4.772598ms
gitea | 2021/09/22 18:30:09 Completed GET /api/v1/user/stopwatches 200 OK in 4.122164ms
gitea | 2021/09/22 18:30:20 Started GET /api/v1/user/stopwatches for 172.16.0.29:0
gitea | 2021/09/22 18:30:20 Started GET /api/v1/notifications/new for 172.16.0.29:0
gitea | 2021/09/22 18:30:20 Completed GET /api/v1/user/stopwatches 200 OK in 3.747234ms
gitea | 2021/09/22 18:30:20 Completed GET /api/v1/notifications/new 200 OK in 4.244495ms
gitea | 2021/09/22 18:30:31 Started GET /api/v1/user/stopwatches for 172.16.0.29:0
gitea | 2021/09/22 18:30:31 Completed GET /api/v1/user/stopwatches 200 OK in 4.264009ms
gitea | 2021/09/22 18:30:41 Started GET /api/v1/notifications/new for 172.16.0.29:0
gitea | 2021/09/22 18:30:41 Completed GET /api/v1/notifications/new 200 OK in 4.237108ms
gitea | 2021/09/22 18:30:42 Started GET /api/v1/user/stopwatches for 172.16.0.29:0
gitea | 2021/09/22 18:30:42 Completed GET /api/v1/user/stopwatches 200 OK in 3.657997ms
gitea | 2021/09/22 18:30:49 Started GET /wj/Test3 for 172.16.0.29:0
gitea | 2021/09/22 18:30:49 ...s/context/context.go:740:1() [D] Session ID: 51af886c4f962929
gitea | 2021/09/22 18:30:49 ...s/context/context.go:741:1() [D] CSRF Token: hTrGUzkClmnbcaMcwHq023DJmtw6MTYzMjMyNDM1OTU1MDcwNDUzNQ
gitea | 2021/09/22 18:30:49 ...ers/web/repo/view.go:623:Home() [E] models.GetMigratingTask: task is not exist [id: 0, repo_id: 82, type: 0]
gitea | 2021/09/22 18:30:49 ...s/context/context.go:185:HTML() [D] Template: status/500
gitea | 2021/09/22 18:30:49 Completed GET /wj/Test3 500 Internal Server Error in 22.167512ms

app.ini

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

[repository]
ROOT = /data/git/repositories

[repository.local]
LOCAL_COPY_PATH = /data/gitea/tmp/local-repo

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

[server]
APP_DATA_PATH    = /data/gitea
DOMAIN           = git.homedatasrv.ru
SSH_DOMAIN       = git.homedatasrv.ru
HTTP_PORT        = 3000
ROOT_URL         = http://git.homedatasrv.ru/
LOCAL_ROOT_URL   = http://file/
DISABLE_SSH      = false
SSH_PORT         = 22
SSH_LISTEN_PORT  = 22
LFS_START_SERVER = true
LFS_CONTENT_PATH = /data/git/lfs
LFS_JWT_SECRET   = 1bmqEfFlGLi_YvY5XlWOetAKGnl3NelSAiEV2oXGVNg
OFFLINE_MODE     = false

[database]
PATH     = /data/gitea/gitea.db
DB_TYPE  = postgres
HOST     = db:5432
NAME     = gitea
USER     = gitea
PASSWD   = gitea
LOG_SQL  = false
SCHEMA   =
SSL_MODE = disable
CHARSET  = utf8

[indexer]
ISSUE_INDEXER_PATH = /data/gitea/indexers/issues.bleve

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

[picture]
AVATAR_UPLOAD_PATH            = /data/gitea/avatars
root@homesrv1:~/gitea# cat data/gitea/conf/app.ini
APP_NAME = Gitea: Git with a cup of tea
RUN_MODE = prod
RUN_USER = git

[repository]
ROOT = /data/git/repositories

[repository.local]
LOCAL_COPY_PATH = /data/gitea/tmp/local-repo

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

[server]
APP_DATA_PATH    = /data/gitea                                                     DOMAIN           = git.homedatasrv.ru
SSH_DOMAIN       = git.homedatasrv.ru
HTTP_PORT        = 3000
ROOT_URL         = http://git.homedatasrv.ru/                                      LOCAL_ROOT_URL   = http://file/
DISABLE_SSH      = false
SSH_PORT         = 22
SSH_LISTEN_PORT  = 22
LFS_START_SERVER = true
LFS_CONTENT_PATH = /data/git/lfs
LFS_JWT_SECRET   = 1bmqEfFlGLi_YvY5XlWOetAKGnl3NelSAiEV2oXGVNg
OFFLINE_MODE     = false

[database]
PATH     = /data/gitea/gitea.db
DB_TYPE  = postgres
HOST     = db:5432
NAME     = gitea
USER     = gitea
PASSWD   = gitea
LOG_SQL  = false
SCHEMA   =
SSL_MODE = disable
CHARSET  = utf8

[indexer]
ISSUE_INDEXER_PATH = /data/gitea/indexers/issues.bleve

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

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

[attachment]
PATH = /data/gitea/attachments

[log]
MODE      = console
LEVEL     = debug
ROUTER    = console
ROOT_PATH = /data/gitea/log

[security]
INSTALL_LOCK                  = true
SECRET_KEY                    = RUaoJDuxDyNi2vZgPRzuv3Q2LaTJQC04XEKZ1AXooCKIuoJXV00hQA9HwrpN7E7K
REVERSE_PROXY_LIMIT           = 1
REVERSE_PROXY_TRUSTED_PROXIES = *
INTERNAL_TOKEN                = eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJuYmYiOjE2MzIyNDM2NzJ9.rdWKPA4L7CYvZdvQBgF2N5uQ4e9vaZqM_bPiVHSZGSM
PASSWORD_HASH_ALGO            = pbkdf2
IMPORT_LOCAL_PATHS            = true

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

[mailer]
ENABLED = false

[openid]
ENABLE_OPENID_SIGNIN = true
ENABLE_OPENID_SIGNUP = true

[migrations]
ALLOW_LOCALNETWORKS  = true

How to setup logs as dev mode. I've read page from docs about logs.

About line:

LOCAL_ROOT_URL = http://file/

When I goggled some solutions for the problem I've found this issue about problem with unix:// url. I thought like file:// it is the solution for me too. But it didn't help.

@wusikijeronii commented on GitHub (Sep 22, 2021): > > Also tried. I also tried to bind domain with GitLab (my.domain/gitlab/*). Same problem. > > Please set your app.ini to dev mode + [log] to file with debug and retry an importation, then > paste the logs so that we can see where the importation fail I don't know how to configure logging into dev mode but I changed info level to debug. Log (from creating to get request): > gitea | 2021/09/22 18:29:58 Completed POST /repo/migrate 302 Found in 158.271964ms gitea | 2021/09/22 18:29:58 Started GET /wj/Test3 for 172.16.0.29:0 gitea | 2021/09/22 18:29:58 ...s/context/context.go:740:1() [D] Session ID: 51af886c4f962929 gitea | 2021/09/22 18:29:58 ...s/context/context.go:741:1() [D] CSRF Token: hTrGUzkClmnbcaMcwHq023DJmtw6MTYzMjMyNDM1OTU1MDcwNDUzNQ gitea | 2021/09/22 18:29:58 ...s/context/context.go:185:HTML() [D] Template: repo/migrate/migrating gitea | 2021/09/22 18:29:58 Completed GET /wj/Test3 200 OK in 21.761914ms gitea | 2021/09/22 18:29:58 Started GET /avatar/af312e366617779e2a017ddebbf14e9a?size=96 for 172.16.0.29:0 gitea | 2021/09/22 18:29:58 ...s/context/context.go:740:1() [D] Session ID: 51af886c4f962929 gitea | 2021/09/22 18:29:58 ...s/context/context.go:741:1() [D] CSRF Token: hTrGUzkClmnbcaMcwHq023DJmtw6MTYzMjMyNDM1OTU1MDcwNDUzNQ gitea | 2021/09/22 18:29:58 Completed GET /avatar/af312e366617779e2a017ddebbf14e9a?size=96 302 Found in 4.582322ms gitea | 2021/09/22 18:29:59 Started GET /user/task/81?_csrf=hTrGUzkClmnbcaMcwHq023DJmtw6MTYzMjMyNDM1OTU1MDcwNDUzNQ for 172.16.0.29:0 gitea | 2021/09/22 18:29:59 ...s/context/context.go:740:1() [D] Session ID: 51af886c4f962929 gitea | 2021/09/22 18:29:59 ...s/context/context.go:741:1() [D] CSRF Token: hTrGUzkClmnbcaMcwHq023DJmtw6MTYzMjMyNDM1OTU1MDcwNDUzNQ gitea | 2021/09/22 18:29:59 Completed GET /user/task/81?_csrf=hTrGUzkClmnbcaMcwHq023DJmtw6MTYzMjMyNDM1OTU1MDcwNDUzNQ 200 OK in 4.99329ms gitea | 2021/09/22 18:29:59 modules/task/task.go:54:handle() [E] Run task failed: GET https://homedatasrv.ru/gitlab/api/v4/projects/root/test: 404 {message: 404 Project Not Found} gitea | 2021/09/22 18:30:01 Started GET /user/task/81?_csrf=hTrGUzkClmnbcaMcwHq023DJmtw6MTYzMjMyNDM1OTU1MDcwNDUzNQ for 172.16.0.29:0 gitea | 2021/09/22 18:30:01 ...s/context/context.go:740:1() [D] Session ID: 51af886c4f962929 gitea | 2021/09/22 18:30:01 ...s/context/context.go:741:1() [D] CSRF Token: hTrGUzkClmnbcaMcwHq023DJmtw6MTYzMjMyNDM1OTU1MDcwNDUzNQ gitea | 2021/09/22 18:30:01 Completed GET /user/task/81?_csrf=hTrGUzkClmnbcaMcwHq023DJmtw6MTYzMjMyNDM1OTU1MDcwNDUzNQ 200 OK in 5.06571ms gitea | 2021/09/22 18:30:09 Started GET /api/v1/notifications/new for 172.16.0.29:0 gitea | 2021/09/22 18:30:09 Started GET /api/v1/user/stopwatches for 172.16.0.29:0 gitea | 2021/09/22 18:30:09 Completed GET /api/v1/notifications/new 200 OK in 4.772598ms gitea | 2021/09/22 18:30:09 Completed GET /api/v1/user/stopwatches 200 OK in 4.122164ms gitea | 2021/09/22 18:30:20 Started GET /api/v1/user/stopwatches for 172.16.0.29:0 gitea | 2021/09/22 18:30:20 Started GET /api/v1/notifications/new for 172.16.0.29:0 gitea | 2021/09/22 18:30:20 Completed GET /api/v1/user/stopwatches 200 OK in 3.747234ms gitea | 2021/09/22 18:30:20 Completed GET /api/v1/notifications/new 200 OK in 4.244495ms gitea | 2021/09/22 18:30:31 Started GET /api/v1/user/stopwatches for 172.16.0.29:0 gitea | 2021/09/22 18:30:31 Completed GET /api/v1/user/stopwatches 200 OK in 4.264009ms gitea | 2021/09/22 18:30:41 Started GET /api/v1/notifications/new for 172.16.0.29:0 gitea | 2021/09/22 18:30:41 Completed GET /api/v1/notifications/new 200 OK in 4.237108ms gitea | 2021/09/22 18:30:42 Started GET /api/v1/user/stopwatches for 172.16.0.29:0 gitea | 2021/09/22 18:30:42 Completed GET /api/v1/user/stopwatches 200 OK in 3.657997ms gitea | 2021/09/22 18:30:49 Started GET /wj/Test3 for 172.16.0.29:0 gitea | 2021/09/22 18:30:49 ...s/context/context.go:740:1() [D] Session ID: 51af886c4f962929 gitea | 2021/09/22 18:30:49 ...s/context/context.go:741:1() [D] CSRF Token: hTrGUzkClmnbcaMcwHq023DJmtw6MTYzMjMyNDM1OTU1MDcwNDUzNQ gitea | 2021/09/22 18:30:49 ...ers/web/repo/view.go:623:Home() [E] models.GetMigratingTask: task is not exist [id: 0, repo_id: 82, type: 0] gitea | 2021/09/22 18:30:49 ...s/context/context.go:185:HTML() [D] Template: status/500 gitea | 2021/09/22 18:30:49 Completed GET /wj/Test3 500 Internal Server Error in 22.167512ms app.ini ``` APP_NAME = Gitea: Git with a cup of tea RUN_MODE = prod RUN_USER = git [repository] ROOT = /data/git/repositories [repository.local] LOCAL_COPY_PATH = /data/gitea/tmp/local-repo [repository.upload] TEMP_PATH = /data/gitea/uploads [server] APP_DATA_PATH = /data/gitea DOMAIN = git.homedatasrv.ru SSH_DOMAIN = git.homedatasrv.ru HTTP_PORT = 3000 ROOT_URL = http://git.homedatasrv.ru/ LOCAL_ROOT_URL = http://file/ DISABLE_SSH = false SSH_PORT = 22 SSH_LISTEN_PORT = 22 LFS_START_SERVER = true LFS_CONTENT_PATH = /data/git/lfs LFS_JWT_SECRET = 1bmqEfFlGLi_YvY5XlWOetAKGnl3NelSAiEV2oXGVNg OFFLINE_MODE = false [database] PATH = /data/gitea/gitea.db DB_TYPE = postgres HOST = db:5432 NAME = gitea USER = gitea PASSWD = gitea LOG_SQL = false SCHEMA = SSL_MODE = disable CHARSET = utf8 [indexer] ISSUE_INDEXER_PATH = /data/gitea/indexers/issues.bleve [session] PROVIDER_CONFIG = /data/gitea/sessions PROVIDER = file [picture] AVATAR_UPLOAD_PATH = /data/gitea/avatars root@homesrv1:~/gitea# cat data/gitea/conf/app.ini APP_NAME = Gitea: Git with a cup of tea RUN_MODE = prod RUN_USER = git [repository] ROOT = /data/git/repositories [repository.local] LOCAL_COPY_PATH = /data/gitea/tmp/local-repo [repository.upload] TEMP_PATH = /data/gitea/uploads [server] APP_DATA_PATH = /data/gitea DOMAIN = git.homedatasrv.ru SSH_DOMAIN = git.homedatasrv.ru HTTP_PORT = 3000 ROOT_URL = http://git.homedatasrv.ru/ LOCAL_ROOT_URL = http://file/ DISABLE_SSH = false SSH_PORT = 22 SSH_LISTEN_PORT = 22 LFS_START_SERVER = true LFS_CONTENT_PATH = /data/git/lfs LFS_JWT_SECRET = 1bmqEfFlGLi_YvY5XlWOetAKGnl3NelSAiEV2oXGVNg OFFLINE_MODE = false [database] PATH = /data/gitea/gitea.db DB_TYPE = postgres HOST = db:5432 NAME = gitea USER = gitea PASSWD = gitea LOG_SQL = false SCHEMA = SSL_MODE = disable CHARSET = utf8 [indexer] ISSUE_INDEXER_PATH = /data/gitea/indexers/issues.bleve [session] PROVIDER_CONFIG = /data/gitea/sessions PROVIDER = file [picture] AVATAR_UPLOAD_PATH = /data/gitea/avatars REPOSITORY_AVATAR_UPLOAD_PATH = /data/gitea/repo-avatars DISABLE_GRAVATAR = false ENABLE_FEDERATED_AVATAR = true [attachment] PATH = /data/gitea/attachments [log] MODE = console LEVEL = debug ROUTER = console ROOT_PATH = /data/gitea/log [security] INSTALL_LOCK = true SECRET_KEY = RUaoJDuxDyNi2vZgPRzuv3Q2LaTJQC04XEKZ1AXooCKIuoJXV00hQA9HwrpN7E7K REVERSE_PROXY_LIMIT = 1 REVERSE_PROXY_TRUSTED_PROXIES = * INTERNAL_TOKEN = eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJuYmYiOjE2MzIyNDM2NzJ9.rdWKPA4L7CYvZdvQBgF2N5uQ4e9vaZqM_bPiVHSZGSM PASSWORD_HASH_ALGO = pbkdf2 IMPORT_LOCAL_PATHS = true [service] DISABLE_REGISTRATION = true REQUIRE_SIGNIN_VIEW = false REGISTER_EMAIL_CONFIRM = false ENABLE_NOTIFY_MAIL = false ALLOW_ONLY_EXTERNAL_REGISTRATION = false ENABLE_CAPTCHA = false DEFAULT_KEEP_EMAIL_PRIVATE = false DEFAULT_ALLOW_CREATE_ORGANIZATION = true DEFAULT_ENABLE_TIMETRACKING = true NO_REPLY_ADDRESS = noreply.localhost [mailer] ENABLED = false [openid] ENABLE_OPENID_SIGNIN = true ENABLE_OPENID_SIGNUP = true [migrations] ALLOW_LOCALNETWORKS = true ``` How to setup logs as dev mode. I've read page from docs about logs. About line: > LOCAL_ROOT_URL = http://file/ When I goggled some solutions for the problem I've found this issue about problem with `unix://` url. I thought like `file://` it is the solution for me too. But it didn't help.
Author
Owner

@99rgosse commented on GitHub (Sep 22, 2021):

Okay, so this is indeed a bug 👍

your project URL doesn't exist or redirect badly - Error 404 (maybe your token is not okay ? the url works well without the project )

gitea | 2021/09/22 18:29:59 modules/task/task.go:54:handle() [E] Run task failed: GET https://homedatasrv.ru/gitlab/api/v4/projects/root/test: 404 {message: 404 Project Not Found}

This make Gitea fails, but instead of deleting the repo, it creates it, leading to Error 500, I could reproduce this on 1.16-dev with a false url.
The project imported should be deleted, it contains nothing
EDIT: This doesn't happen on a regular Git Migration, the repo is deleted automatically.
Edit2 : False project generated on try.gitea : https://try.gitea.io/99rgosse/gitlab_to_gitea222

Otherwise, I looked at your app.ini :
The local root in the cheat says :
sheet LOCAL_ROOT_URL: %(PROTOCOL)s://%(HTTP_ADDR)s:%(HTTP_PORT)s/: Local (DMZ) URL for Gitea workers (such as SSH update) accessing web service. In most cases you do not need to change the default value. Alter it only if your SSH server node is not the same as HTTP node. Do not set this variable if PROTOCOL is set to unix.
So I'm not sure what you are trying to achieve there ?

@99rgosse commented on GitHub (Sep 22, 2021): Okay, so this is indeed a bug 👍 your project URL doesn't exist or redirect badly - Error 404 (maybe your token is not okay ? the url works well without the project ) `gitea | 2021/09/22 18:29:59 modules/task/task.go:54:handle() [E] Run task failed: GET https://homedatasrv.ru/gitlab/api/v4/projects/root/test: 404 {message: 404 Project Not Found}` This make Gitea fails, but instead of deleting the repo, it creates it, leading to Error 500, I could reproduce this on 1.16-dev with a false url. The project imported should be deleted, it contains nothing EDIT: This doesn't happen on a regular Git Migration, the repo is deleted automatically. Edit2 : False project generated on try.gitea : https://try.gitea.io/99rgosse/gitlab_to_gitea222 Otherwise, I looked at your app.ini : The [local root in the cheat says](https://docs.gitea.io/en-us/config-cheat-sheet/#server-server) : `sheet LOCAL_ROOT_URL: %(PROTOCOL)s://%(HTTP_ADDR)s:%(HTTP_PORT)s/: Local (DMZ) URL for Gitea workers (such as SSH update) accessing web service. In most cases you do not need to change the default value. Alter it only if your SSH server node is not the same as HTTP node. Do not set this variable if PROTOCOL is set to unix.` So I'm not sure what you are trying to achieve there ?
Author
Owner

@wusikijeronii commented on GitHub (Sep 22, 2021):

Okay, so this is indeed a bug 👍

your project URL doesn't exist or redirect badly - Error 404 (maybe your token is not okay ? the url works well without the project )

gitea | 2021/09/22 18:29:59 modules/task/task.go:54:handle() [E] Run task failed: GET https://homedatasrv.ru/gitlab/api/v4/projects/root/test: 404 {message: 404 Project Not Found}

This make Gitea fails, but instead of deleting the repo, it creates it, leading to Error 500, I could reproduce this on 1.16-dev with a false url.
The project imported should be deleted, it contains nothing

Otherwise, I looked at your app.ini :
The local root in the cheat says :
sheet LOCAL_ROOT_URL: %(PROTOCOL)s://%(HTTP_ADDR)s:%(HTTP_PORT)s/: Local (DMZ) URL for Gitea workers (such as SSH update) accessing web service. In most cases you do not need to change the default value. Alter it only if your SSH server node is not the same as HTTP node. Do not set this variable if PROTOCOL is set to unix.
So I'm not sure what you are trying to achieve there ?

Forget. Just I hoped it will help me. I set LOCAL_ROOT_URL to default value.

Yes, ../api/v4 is a available. It returns JSON result. I also tried to use id (in according to that JSON) instead of root/test. But even when url written in the log is available, in the log I see same error.

I don't use up-to-date GitLab. I am using ce: 12.6.0.

@wusikijeronii commented on GitHub (Sep 22, 2021): > Okay, so this is indeed a bug 👍 > > your project URL doesn't exist or redirect badly - Error 404 (maybe your token is not okay ? the url works well without the project ) > > `gitea | 2021/09/22 18:29:59 modules/task/task.go:54:handle() [E] Run task failed: GET https://homedatasrv.ru/gitlab/api/v4/projects/root/test: 404 {message: 404 Project Not Found}` > > This make Gitea fails, but instead of deleting the repo, it creates it, leading to Error 500, I could reproduce this on 1.16-dev with a false url. > The project imported should be deleted, it contains nothing > > Otherwise, I looked at your app.ini : > The [local root in the cheat says](https://docs.gitea.io/en-us/config-cheat-sheet/#server-server) : > `sheet LOCAL_ROOT_URL: %(PROTOCOL)s://%(HTTP_ADDR)s:%(HTTP_PORT)s/: Local (DMZ) URL for Gitea workers (such as SSH update) accessing web service. In most cases you do not need to change the default value. Alter it only if your SSH server node is not the same as HTTP node. Do not set this variable if PROTOCOL is set to unix.` > So I'm not sure what you are trying to achieve there ? Forget. Just I hoped it will help me. I set `LOCAL_ROOT_URL` to default value. Yes, ../api/v4 is a available. It returns JSON result. I also tried to use id (in according to that JSON) instead of root/test. But even when url written in the log is available, in the log I see same error. I don't use up-to-date GitLab. I am using ce: 12.6.0.
Author
Owner

@99rgosse commented on GitHub (Sep 22, 2021):

Yes, ../api/v4 is a available. It returns JSON result. I also tried to use id (in according to that JSON) instead of root/test. But even when url written in the log is available, in the log I see same error.
I don't use up-to-date GitLab. I am using ce: 12.6.0.

Are you using the correct URL ? The one obtained with clone ?
image

@99rgosse commented on GitHub (Sep 22, 2021): > Yes, ../api/v4 is a available. It returns JSON result. I also tried to use id (in according to that JSON) instead of root/test. But even when url written in the log is available, in the log I see same error. > I don't use up-to-date GitLab. I am using ce: 12.6.0. Are you using the correct URL ? The one obtained with clone ? ![image](https://user-images.githubusercontent.com/61579380/134380912-a38d92e3-637c-4bec-9b07-77e020b086de.png)
Author
Owner

@wusikijeronii commented on GitHub (Sep 22, 2021):

Yes, ../api/v4 is a available. It returns JSON result. I also tried to use id (in according to that JSON) instead of root/test. But even when url written in the log is available, in the log I see same error.
I don't use up-to-date GitLab. I am using ce: 12.6.0.

Are you using the correct URL ? The one obtained with clone ?
image

Yes. Check it out. For now my GitLab is empty. (Just for test for migrating some project)

Login: gitea

Password: gitea@12345

URL: https://homedatasrv.ru/gitlab/gitea/giteatest

Just replace http to https in clone suggested url 'cos http is disabled in the using web server.

@wusikijeronii commented on GitHub (Sep 22, 2021): > > Yes, ../api/v4 is a available. It returns JSON result. I also tried to use id (in according to that JSON) instead of root/test. But even when url written in the log is available, in the log I see same error. > > I don't use up-to-date GitLab. I am using ce: 12.6.0. > > Are you using the correct URL ? The one obtained with clone ? > ![image](https://user-images.githubusercontent.com/61579380/134380912-a38d92e3-637c-4bec-9b07-77e020b086de.png) Yes. Check it out. For now my GitLab is empty. (Just for test for migrating some project) Login: gitea Password: gitea@12345 URL: https://homedatasrv.ru/gitlab/gitea/giteatest Just replace http to https in clone suggested url 'cos http is disabled in the using web server.
Author
Owner

@wusikijeronii commented on GitHub (Sep 22, 2021):

Sorry for wasting your time. But I forget one thing. Private projects. And now in logs I see requests. But to http. So I will try to open http.
No, I've set redirect http to https before. I am trying to set https in the GitLab

@wusikijeronii commented on GitHub (Sep 22, 2021): Sorry for wasting your time. But I forget one thing. Private projects. And now in logs I see requests. But to http. So I will try to open http. No, I've set redirect http to https before. I am trying to set https in the GitLab
Author
Owner

@wusikijeronii commented on GitHub (Sep 22, 2021):

Now it works. But why it doesn't work if GitLab set up as http? Web server must redirect http requests to https. And other resources work fine

@wusikijeronii commented on GitHub (Sep 22, 2021): Now it works. But why it doesn't work if GitLab set up as http? Web server must redirect http requests to https. And other resources work fine
Author
Owner

@ksurl commented on GitHub (Sep 23, 2021):

sorry to bump closed issue. I had the same thing happen with creating a mirror from github repo. it now is a dangling repo in my server and gets 500 error when I click on it, so I can't get to the settings to delete it. same error, task is not exist. I just want to delete it. I was able to create a new repo mirror with a new name on the gitea repo.

@ksurl commented on GitHub (Sep 23, 2021): sorry to bump closed issue. I had the same thing happen with creating a mirror from github repo. it now is a dangling repo in my server and gets 500 error when I click on it, so I can't get to the settings to delete it. same error, task is not exist. I just want to delete it. I was able to create a new repo mirror with a new name on the gitea repo.
Author
Owner

@99rgosse commented on GitHub (Sep 23, 2021):

Now it works. But why it doesn't work if GitLab set up as http? Web server must redirect http requests to https. And other resources work fine

This can be a proxy redirection not working fine between your Gitlab and the base WebServer...

@ksurl I think we should open a new bug issue for this, concerning Gitlab/Github and not a "normal" url...

@99rgosse commented on GitHub (Sep 23, 2021): > Now it works. But why it doesn't work if GitLab set up as http? Web server must redirect http requests to https. And other resources work fine This can be a proxy redirection not working fine between your Gitlab and the base WebServer... @ksurl I think we should open a new bug issue for this, concerning Gitlab/Github and not a "normal" url...
Author
Owner

@ksurl commented on GitHub (Sep 23, 2021):

I was able to clean it up by running the delete repositories missing git files job

@ksurl commented on GitHub (Sep 23, 2021): I was able to clean it up by running the delete repositories missing git files job
Author
Owner

@wusikijeronii commented on GitHub (Sep 23, 2021):

sorry to bump closed issue. I had the same thing happen with creating a mirror from github repo. it now is a dangling repo in my server and gets 500 error when I click on it, so I can't get to the settings to delete it. same error, task is not exist. I just want to delete it. I was able to create a new repo mirror with a new name on the gitea repo.

Sorry for so fast closing this issue. I have a 3 reasons for that:

  • After my tries import private projects I really feel like a dumb.
  • My problem solved
  • Yes, looks like 500 error after failure is a bug (seems in 1.5.3 only 'cos in 1.5.2 I just get a error instead of creating wrong project), but there's too extra information. I think more informative task in scrum is a better way to fix the bug.

About my question, I think I know answer. I think there's next algorithm:

  • You set request URL
  • Gitea get absolute pathes by GitLab API
  • Because these ones are absolute your requested URL doesn't matter anymore. Gitea requested only URLs get by API.
  • And what is going on when Gitea try get response of http request? Webserver returns empty body response with 302 status code (redirect)

About your question, I haven't problems with removing wrong repositories. I use control panel (admin panel) -> repositories-> and then I click to the trash icon.

@wusikijeronii commented on GitHub (Sep 23, 2021): > sorry to bump closed issue. I had the same thing happen with creating a mirror from github repo. it now is a dangling repo in my server and gets 500 error when I click on it, so I can't get to the settings to delete it. same error, task is not exist. I just want to delete it. I was able to create a new repo mirror with a new name on the gitea repo. Sorry for so fast closing this issue. I have a 3 reasons for that: * After my tries import private projects I really feel like a dumb. * My problem solved * Yes, looks like 500 error after failure is a bug (seems in 1.5.3 only 'cos in 1.5.2 I just get a error instead of creating wrong project), but there's too extra information. I think more informative task in scrum is a better way to fix the bug. About my question, I think I know answer. I think there's next algorithm: * You set request URL * Gitea get absolute pathes by GitLab API * Because these ones are absolute your requested URL doesn't matter anymore. Gitea requested only URLs get by API. * And what is going on when Gitea try get response of http request? Webserver returns empty body response with 302 status code (redirect) About your question, I haven't problems with removing wrong repositories. I use control panel (admin panel) -> repositories-> and then I click to the trash icon.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: github-starred/gitea#7878