Project stuck after typing wrong url in "Repo by URL"
Summary
The "Git repository URL" is disabled on https://gitlab.com/group/project/import/new, so you cannot fix the URL. If you click "Start import" you will see an ugly "Something went wrong page".
Steps to reproduce
- Create a project - choosing "Repo by URL" - use a wrong url.
- https://gitlab.com/group/project/import/new will show with the following error
The repository could not be imported.
Error importing repository https://gitlab.com/rp1/wrong-url.git into rp1/test-wrong-url - Cloning into bare repository '[REPOS PATH]/rp1/test-wrong-url.git'...
fatal: could not read Username for 'https://gitlab.com': terminal prompts disabled
- Click "Start import"
What is the current bug behavior?
- You cannot change the URL.
- Something went wrong page
What is the expected correct behavior?
- The URL field should not be disabled.
- It should try to import again (which doesn't work because the field is disabled and thus the browser doesn't send it as a POST parameter).
Relevant logs and/or screenshots
Started POST "/rp1/test-wrong-url/import" for 10.0.0.6 at 2017-02-22 08:24:39 +0000
Processing by Projects::ImportsController#create as HTML
Parameters: {"utf8"=>"✓", "authenticity_token"=>"xxx", "namespace_id"=>"rp1", "project_id"=>"test-wrong-url"}
Completed 500 Internal Server Error in 31ms (ActiveRecord: 3.5ms)
NoMethodError (undefined method `[]' for nil:NilClass):
app/controllers/projects/imports_controller.rb:14:in `create'
lib/gitlab/middleware/multipart.rb:93:in `call'
lib/gitlab/request_profiler/middleware.rb:15:in `call'
lib/gitlab/middleware/go.rb:16:in `call'
Output of checks
This bug happens on GitLab.com
Possible fixes
If the field is not disabled it would fix this issue.
However, the field is also used on the projects/new page.
It shouldn't give a problem on the projects/new page right now, because the project model will ignore it if blank.
Also, if you click "Repo by URL", type something in the field and then click "Repo by URL" again, I believe the field will get disabled when hidden.
I haven't been able to find the code that enabled and disables the project_import_url
field on projects/new
, so I am uncertain about that.