Can't clone repository over ssh #2375

Closed
opened 2025-11-02 04:34:11 -06:00 by GiteaMirror · 10 comments
Owner

Originally created by @mfigrs on GitHub (Oct 3, 2018).

  • Gitea version (or commit ref): 38d8b8c built with: bindata, sqlite
  • Git version: 2.15.2
  • Operating system: Synology DSM 6.1
  • 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

First of all, I am a newbie to Git stuff. I don't even know how to get to the "Log gist", nor what it is.

Anyway, I am running a plain Git server on a Synology DiskStation. It works well, however I thought that some form of a GUI would be nice, and installed Gitea via Docker. It runs using MariaDB10 as the database.

To be exact: Git server is a native Synology app and runs directly on the server. Gitea and MariaDB both run in Docker, and Gitea seems to have its own Git server, separate from the Synology one.

I am now trying to import my existing repo from the Synology Git server into Gitea via ssh. First, I was getting a message "You are not allowed to import local repositories.", but I fixed it by editing the app.ini. Now I am getting this error: "The local path is invalid. It does not exist or is not a directory." This is nonsense. I used EXACTLY the same ssh path on a Win10 GitGUI client, and my repo was imported in a blink of an eye. For some reason Gitea doesn't like it. How do I fix this? How do I investigate what's the problem?

I could not reproduce this problem on try.gitea.io, because it gave me the "local repositories" error.

Please help!

Originally created by @mfigrs on GitHub (Oct 3, 2018). <!-- 1. Please speak English, this is the language all of us can speak and write. 2. Please ask questions or configuration/deploy problems on our Discord server (https://discord.gg/NsatcWJ) 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): 38d8b8c built with: bindata, sqlite - Git version: 2.15.2 - Operating system: Synology DSM 6.1 - Database (use `[x]`): - [ ] PostgreSQL - [x] MySQL - [ ] MSSQL - [ ] SQLite - Can you reproduce the bug at https://try.gitea.io: - [ ] Yes (provide example URL) - [x] No - [ ] Not relevant - Log gist: ## Description First of all, I am a newbie to Git stuff. I don't even know how to get to the "Log gist", nor what it is. Anyway, I am running a plain Git server on a Synology DiskStation. It works well, however I thought that some form of a GUI would be nice, and installed Gitea via Docker. It runs using MariaDB10 as the database. To be exact: Git server is a native Synology app and runs directly on the server. Gitea and MariaDB both run in Docker, and Gitea seems to have its own Git server, separate from the Synology one. I am now trying to import my existing repo from the Synology Git server into Gitea via ssh. First, I was getting a message "You are not allowed to import local repositories.", but I fixed it by editing the app.ini. Now I am getting this error: "The local path is invalid. It does not exist or is not a directory." This is nonsense. I used EXACTLY the same ssh path on a Win10 GitGUI client, and my repo was imported in a blink of an eye. For some reason Gitea doesn't like it. How do I fix this? How do I investigate what's the problem? I could not reproduce this problem on try.gitea.io, because it gave me the "local repositories" error. Please help!
GiteaMirror added the type/questionissue/stale labels 2025-11-02 04:34:11 -06:00
Author
Owner

@lunny commented on GitHub (Oct 5, 2018):

Import from local repositories is a different feature from SSH clone/push.

@lunny commented on GitHub (Oct 5, 2018): Import from local repositories is a different feature from SSH clone/push.
Author
Owner

@mfigrs commented on GitHub (Oct 6, 2018):

Import from local repositories is a different feature from SSH clone/push.

Can you explain a bit more? This is all greek to me...

Anyway, I was able to log into bash of the Docker-Git. I issued the same "git clone ssh://..." command I tried with Gitea, and it worked!

Still, somehow Gitea doesn't see the repo, even though its own git does see it. Gitea continues to throw the above error when I try the clone.

@mfigrs commented on GitHub (Oct 6, 2018): > Import from local repositories is a different feature from SSH clone/push. Can you explain a bit more? This is all greek to me... Anyway, I was able to log into bash of the Docker-Git. I issued the same "`git clone ssh://...`" command I tried with Gitea, and it worked! Still, somehow Gitea doesn't see the repo, even though its own git does see it. Gitea continues to throw the above error when I try the clone.
Author
Owner

@mbruckner commented on GitHub (Oct 8, 2018):

@mfigrs Unless you have a lot of repositories, I'd recreate the repositories in gitea, set them up as remote on your locale machine and push them. I've recently transferred five repositories that way and it took about ten minutes.

@mbruckner commented on GitHub (Oct 8, 2018): @mfigrs Unless you have a lot of repositories, I'd recreate the repositories in gitea, set them up as remote on your locale machine and push them. I've recently transferred five repositories that way and it took about ten minutes.
Author
Owner

@stale[bot] commented on GitHub (Jan 7, 2019):

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs during the next 2 weeks. Thank you for your contributions.

@stale[bot] commented on GitHub (Jan 7, 2019): This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs during the next 2 weeks. Thank you for your contributions.
Author
Owner

@techknowlogick commented on GitHub (Jan 7, 2019):

Please review the IMPORT_LOCAL_PATHS option in https://docs.gitea.io/en-us/config-cheat-sheet/ and if you have more support needs, please feel free to open a post in the forum.

@techknowlogick commented on GitHub (Jan 7, 2019): Please review the `IMPORT_LOCAL_PATHS` option in https://docs.gitea.io/en-us/config-cheat-sheet/ and if you have more support needs, please feel free to open a post in the [forum](https://discourse.gitea.io/).
Author
Owner

@mfigrs commented on GitHub (Jan 7, 2019):

Setting IMPORT_LOCAL_PATHS to true in app.ini is what allowed me to switch from:
"You are not allowed to import local repositories." error to:
"The local path is invalid. It does not exist or is not a directory." error.

I need a solution to get rid of the second error message - this is a Gitea bug...

@mfigrs commented on GitHub (Jan 7, 2019): Setting `IMPORT_LOCAL_PATHS` to `true` in app.ini is what allowed me to switch **from**: "You are not allowed to import local repositories." error **to**: "The local path is invalid. It does not exist or is not a directory." error. I need a solution to get rid of the second error message - this is a Gitea bug...
Author
Owner

@techknowlogick commented on GitHub (Jan 7, 2019):

Reviewing the ticket again, as Gitea is running in docker it wouldn't have access to your repos via a local path unless you volume mounted them. Are you able to either volume mount the local paths into docker, or put an HTTP URL for migrating instead?

@techknowlogick commented on GitHub (Jan 7, 2019): Reviewing the ticket again, as Gitea is running in docker it wouldn't have access to your repos via a local path unless you volume mounted them. Are you able to either volume mount the local paths into docker, or put an HTTP URL for migrating instead?
Author
Owner

@mfigrs commented on GitHub (Jan 15, 2019):

Reviewing the ticket again, as Gitea is running in docker it wouldn't have access to your repos via a local path unless you volume mounted them. Are you able to either volume mount the local paths into docker, or put an HTTP URL for migrating instead?

Unless I am mistaken, the gitea docker container contains a git server. I've connected to that server (inside gitea container) and issued a pull command with ssh path, and it worked! However, when I paste the IDENTICAL path in gitea - it doesn't work. I may be confusing things because it's all new to me, but IMHO this is a gitea bug.

@mfigrs commented on GitHub (Jan 15, 2019): > Reviewing the ticket again, as Gitea is running in docker it wouldn't have access to your repos via a local path unless you volume mounted them. Are you able to either volume mount the local paths into docker, or put an HTTP URL for migrating instead? Unless I am mistaken, the gitea docker container contains a git server. I've connected to that server (inside gitea container) and issued a pull command with ssh path, and it worked! However, when I paste the IDENTICAL path in gitea - it doesn't work. I may be confusing things because it's all new to me, but IMHO this is a gitea bug.
Author
Owner

@Mpic commented on GitHub (Feb 27, 2020):

Reviewing the ticket again, as Gitea is running in docker it wouldn't have access to your repos via a local path unless you volume mounted them. Are you able to either volume mount the local paths into docker, or put an HTTP URL for migrating instead?

Even after mounting the local repo in Docker, Gitea cannot seem to find it...

I mounted the local repo volume on /Projects/ in gitea docker (so in root folder), I can confirm it is present and accessible via internal docker bash.
In Gitea web interface, I tried to migrate from /Projects/repo.git but I get The local path is invalid. It does not exist or is not a directory.

I also tried mounting the Projects volume inside /data/gitea/Projects/ in case Gitea does not search from root but from its GITEA_CUSTOM folder (specified when launching the docker image), same thing.

@Mpic commented on GitHub (Feb 27, 2020): > > > Reviewing the ticket again, as Gitea is running in docker it wouldn't have access to your repos via a local path unless you volume mounted them. Are you able to either volume mount the local paths into docker, or put an HTTP URL for migrating instead? Even after mounting the local repo in Docker, Gitea cannot seem to find it... I mounted the local repo volume on `/Projects/` in gitea docker (so in root folder), I can confirm it is present and accessible via internal docker bash. In Gitea web interface, I tried to migrate from `/Projects/repo.git` but I get `The local path is invalid. It does not exist or is not a directory.` I also tried mounting the `Projects` volume inside `/data/gitea/Projects/` in case Gitea does not search from root but from its `GITEA_CUSTOM` folder (specified when launching the docker image), same thing.
Author
Owner

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

Setting IMPORT_LOCAL_PATHS to true in app.ini is what allowed me to switch from:
"You are not allowed to import local repositories." error to:
"The local path is invalid. It does not exist or is not a directory." error.

I need a solution to get rid of the second error message - this is a Gitea bug...

Most of you, like me, wrong place Good Luck : )
Config Cheat Sheet - Docs

IMPORT_LOCAL_PATHS: false: Set to false to prevent all users (including admin) from importing local path on server.

@SailHe commented on GitHub (Mar 21, 2020): > > > Setting `IMPORT_LOCAL_PATHS` to `true` in app.ini is what allowed me to switch **from**: > "You are not allowed to import local repositories." error **to**: > "The local path is invalid. It does not exist or is not a directory." error. > > I need a solution to get rid of the second error message - this is a Gitea bug... **Most of you, like me, wrong place** Good Luck : ) [Config Cheat Sheet - Docs](https://docs.gitea.io/en-us/config-cheat-sheet/#security-security) > `IMPORT_LOCAL_PATHS`: **false**: Set to `false` to prevent all users (including admin) from importing local path on server.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: github-starred/gitea#2375