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

Cannot migrate LOCAL repo using API #4387

Closed
2 of 7 tasks
Lord0 opened this issue Apr 6, 2017 · 3 comments
Closed
2 of 7 tasks

Cannot migrate LOCAL repo using API #4387

Lord0 opened this issue Apr 6, 2017 · 3 comments

Comments

@Lord0
Copy link

Lord0 commented Apr 6, 2017

  • Gogs version (or commit ref): 0.10.31.0327 / 0.11 RC
  • Git version: 2.2.2
  • Operating system: RHEL 5.5!
  • Database (use [x]):
    • PostgreSQL
    • MySQL
    • MSSQL
    • SQLite
  • Can you reproduce the bug at https://try.gogs.io:
    • Yes (provide example URL)
    • No
    • Not relevant
  • Log gist (usually found in log/gogs.log):

2017/04/06 15:26:29 [TRACE] Custom path: /opt/gogs/custom
2017/04/06 15:26:29 [TRACE] Log path: /opt/gogs/log
2017/04/06 15:26:29 [TRACE] Log Mode: File (Trace)
2017/04/06 15:26:29 [ INFO] S3 Gogs 0.10.31.0327 / 0.11 RC
[Macaron] 2017-04-06 15:27:17: Started POST /api/v1/repos/migrate for 10.6.62.84
[Macaron] 2017-04-06 15:27:17: Completed POST /api/v1/repos/migrate 422 Unprocessable Entity in 72.154ms
] Session Service Enabled
2017/04/06 15:26:29 [ INFO] Git Version: 2.2.2
2017/04/06 15:26:30 [ INFO] SQLite3 Supported
2017/04/06 15:26:30 [ INFO] Run Mode: Production
2017/04/06 15:26:30 [ INFO] SSH server started on 0.0.0.0:2222
2017/04/06 15:26:30 [TRACE] SSH server cipher list: [aes128-ctr aes192-ctr aes256-ctr aes128-gcm@openssh.com arcfour256 arcfour128]
2017/04/06 15:26:30 [TRACE] Doing: CheckRepoStats
2017/04/06 15:26:30 [ INFO] Listen: http://0.0.0.0:3000
2017/04/06 15:27:17 [TRACE] Session ID: 5743419870af5d12

Description

I cannot migrate a "local" repo, based on local path, using the api.

API call:

curl -u administrator --request POST --url http://localhost:3000/api/v1/repos/migrate --header 'content-type: application/json' --data '{"clone_addr": "/home/git/my-repo.git", "uid": 1, "repo_name": "new-repo"}'

At this point I am prompted for and enter my password.

API Call Response:

{"message":"You are not allowed to import local repositories.","url":"https://github.com/gogits/go-gogs-client/wiki"}

However, according to the docs here:
https://github.com/gogits/go-gogs-client/wiki/Repositories#migrate

I should be able to migrate local repos by passing their path?

Note: other API calls, e.g. search, complete as expected.

Thanks in advance

@unknwon
Copy link
Member

unknwon commented Apr 6, 2017

Hi, you can only migrate local repo as admin by default, otherwise given permission by admin.

@unknwon unknwon closed this as completed Apr 6, 2017
@Lord0
Copy link
Author

Lord0 commented Apr 7, 2017

Just adding this for other users...

The user WAS admin/had admin rights.

The issue was that ENABLE_LOCAL_PATH_MIGRATION had not been set in config file (/gogs/custom/conf/app.ini)

@generatz
Copy link

generatz commented Aug 7, 2017

It would be great if the warning message could mention ENABLE_LOCAL_PATH_MIGRATION.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Mar 18, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants