Skip to content
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

Migration from local path fails with "migrate from '' is not allowed: unknown hostname" #14700

Closed
2 of 6 tasks
masche842 opened this issue Feb 16, 2021 · 4 comments · Fixed by #14925
Closed
2 of 6 tasks
Labels
topic/repo-migration Migrate repos from other platforms to Gitea, or from Gitea to them type/bug
Milestone

Comments

@masche842
Copy link

masche842 commented Feb 16, 2021

  • Gitea version: 1.13.2
  • Git version: 2.26.2
  • Operating system:
    Ubuntu 16.04.6 LTS,
    Docker image gitea/gitea:1
  • Database (use [x]):
    • PostgreSQL
    • MySQL
    • MSSQL
    • SQLite
  • Can you reproduce the bug at https://try.gitea.io:
    • Yes (provide example URL)
    • No
  • Logs:
    [loads of SQL log entries]
    2021/02/16 17:35:06 modules/task/task.go:51:handle() [E] Run task failed: migrate from '' is not allowed: unknown hostname

Description

In recent gitea versions importing from local files fails with the error "modules/task/task.go:51:handle() [E] Run task failed: migrate from '' is not allowed: unknown hostname".
This appears to be an artifact of #13610 which attempts to verify IP address range even for local files.
Consequently setting [migrations]ALLOW_LOCALNETWORKS = true works as a fairly non-obvious workaround

@masche842 masche842 changed the title Migration from local path fails with migrate from '' is not allowed: unknown hostname" Migration from local path fails with "migrate from '' is not allowed: unknown hostname" Feb 16, 2021
@zeripath
Copy link
Contributor

zeripath commented Feb 16, 2021

See:

https://docs.gitea.io/en-us/config-cheat-sheet/#migrations-migrations

in particular:

ALLOW_LOCALNETWORKS: false: Allow private addresses defined by RFC 1918, RFC 1122, RFC 4632 and RFC 4291

In the [migrations] section in app.ini set:

ALLOW_LOCALNETWORKS=true

@lunny
Copy link
Member

lunny commented Feb 17, 2021

I don't think this is resolved. The problem is the form file:///home/git/repository/a.git is not supported.

@zeripath
Copy link
Contributor

Ok well that's slightly different from what the report initially stated. I'll reopen.

@zeripath zeripath reopened this Feb 17, 2021
@zeripath zeripath added type/bug topic/repo-migration Migrate repos from other platforms to Gitea, or from Gitea to them labels Feb 28, 2021
@zeripath zeripath added this to the 1.14.1 milestone Mar 3, 2021
zeripath added a commit to zeripath/gitea that referenced this issue Mar 7, 2021
PR go-gitea#13610 unfortunately disabled importing repositories from local paths.
This PR restores this functionality.

Fix go-gitea#14700

Signed-off-by: Andrew Thornton <art27@cantab.net>
@zeripath zeripath modified the milestones: 1.14.1, 1.14.0 Mar 7, 2021
@zeripath
Copy link
Contributor

zeripath commented Mar 7, 2021

I understand now! Sorry it took me so long to get what the problem was.

zeripath added a commit that referenced this issue Mar 8, 2021
PR #13610 unfortunately disabled importing repositories from local paths.
This PR restores this functionality.

Fix #14700

Signed-off-by: Andrew Thornton <art27@cantab.net>
zeripath added a commit to zeripath/gitea that referenced this issue Mar 8, 2021
…gitea#14925)

Backport go-gitea#14925

PR go-gitea#13610 unfortunately disabled importing repositories from local paths.
This PR restores this functionality.

Fix go-gitea#14700

Signed-off-by: Andrew Thornton <art27@cantab.net>
6543 pushed a commit that referenced this issue Mar 8, 2021
…4927)

Backport #14925

PR #13610 unfortunately disabled importing repositories from local paths.
This PR restores this functionality.

Fix #14700

Signed-off-by: Andrew Thornton <art27@cantab.net>
@go-gitea go-gitea locked and limited conversation to collaborators May 13, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
topic/repo-migration Migrate repos from other platforms to Gitea, or from Gitea to them type/bug
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants