Skip to content

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

Closed
@masche842

Description

@masche842
  • 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

Metadata

Metadata

Assignees

No one assigned

    Labels

    topic/repo-migrationMigrate repos from other platforms to Gitea, or from Gitea to themtype/bug

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions