Skip to content

finaly fix gitlab migration with subdir 2.0 #13646

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

Merged
merged 4 commits into from
Nov 19, 2020

Conversation

@6543 6543 modified the milestones: 1.13.0, 1.14.0 Nov 19, 2020
@6543 6543 added backport/v1.13 type/bug topic/repo-migration Migrate repos from other platforms to Gitea, or from Gitea to them skip-changelog This PR is irrelevant for the (next) changelog, for example bug fixes for unreleased features. labels Nov 19, 2020
@6543
Copy link
Member Author

6543 commented Nov 19, 2020

collected error logs:

  • fix approval_state: 404
Migrate repository from https://gitlab.alpinelinux.org/6543/aports failed: GET https://gitlab.alpinelinux.org/api/v4/projects/281/merge_requests/2/approval_state: 404 {error: 404 Not Found}
Migrate repository from https://framagit.org/framasoft/peertube/PeerTube.git failed: GET https://framagit.org/api/v4/projects/18854/merge_requests/32/approval_state: 404 {error: 404 Not Found}

@GiteaBot GiteaBot added the lgtm/need 2 This PR needs two approvals by maintainers to be considered for merging. label Nov 19, 2020
@codecov-io
Copy link

Codecov Report

Merging #13646 (d9c445d) into master (64bd5f4) will decrease coverage by 0.00%.
The diff coverage is 0.00%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master   #13646      +/-   ##
==========================================
- Coverage   42.20%   42.19%   -0.01%     
==========================================
  Files         697      697              
  Lines       76577    76577              
==========================================
- Hits        32317    32313       -4     
- Misses      38962    38964       +2     
- Partials     5298     5300       +2     
Impacted Files Coverage Δ
modules/migrations/gitlab.go 0.99% <0.00%> (ø)
modules/git/utils.go 73.77% <0.00%> (-3.28%) ⬇️
modules/log/event.go 59.90% <0.00%> (-1.89%) ⬇️
modules/queue/workerpool.go 60.00% <0.00%> (-0.82%) ⬇️
models/gpg_key.go 53.33% <0.00%> (-0.58%) ⬇️
modules/git/repo.go 45.17% <0.00%> (-0.51%) ⬇️
modules/indexer/stats/db.go 52.17% <0.00%> (ø)
services/pull/pull.go 41.27% <0.00%> (+0.49%) ⬆️
models/error.go 36.75% <0.00%> (+0.49%) ⬆️
routers/repo/view.go 38.11% <0.00%> (+0.64%) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 64bd5f4...0105005. Read the comment docs.

@6543 6543 marked this pull request as ready for review November 19, 2020 20:46
@6543
Copy link
Member Author

6543 commented Nov 19, 2020

@pat-s I hope with THIS final one you can migrate

@GiteaBot GiteaBot added lgtm/need 1 This PR needs approval from one additional maintainer to be merged. and removed lgtm/need 2 This PR needs two approvals by maintainers to be considered for merging. labels Nov 19, 2020
@GiteaBot GiteaBot added lgtm/done This PR has enough approvals to get merged. There are no important open reservations anymore. and removed lgtm/need 1 This PR needs approval from one additional maintainer to be merged. labels Nov 19, 2020
@6543
Copy link
Member Author

6543 commented Nov 19, 2020

🚀

@lafriks lafriks merged commit 24b3b21 into go-gitea:master Nov 19, 2020
@lafriks lafriks deleted the just-make-migration-work!!! branch November 19, 2020 23:18
@jolheiser
Copy link
Member

Please packbort 🙃

@techknowlogick
Copy link
Member

lets wait to backport until we can confirm that it works on @pat-s' gitlab install

@pat-s
Copy link
Member

pat-s commented Nov 20, 2020

We're getting there but are not quite there yet for me

Migrating from http://DOMAIN/gitlab/patrick/test.git failed.

GET https://DOMAIN/gitlab/api/v4/projects/patrick/test: 404 {error: 404 Not Found}

The GET request seems ok now. Token was set - any idea? Internal rewriting issues of the GL install?

@6543
Copy link
Member Author

6543 commented Nov 20, 2020

Did you set the subdir in gitlab or have you setup rewrite rouls via reverse proxy?

@pat-s
Copy link
Member

pat-s commented Nov 21, 2020

Did you set the subdir in gitlab

Yes - this is required when running GL in a subpath according to the docs. It also won't work without it.

NGINX config

   location /gitlab/ {

       client_max_body_size 0;
       gzip off;

       proxy_read_timeout      300;
       proxy_connect_timeout   300;
       proxy_redirect          off;

       proxy_http_version 1.1;

       proxy_set_header    Host                $http_host;
       proxy_set_header    X-Real-IP           $remote_addr;
       proxy_set_header    X-Forwarded-For     $proxy_add_x_forwarded_for;
       proxy_set_header    X-Forwarded-Proto   $scheme;

       proxy_pass http://localhost:8929/gitlab/;
   }

@6543
Copy link
Member Author

6543 commented Nov 21, 2020

Do you have GL log's about requests, so we can see why it returns 404

6543 added a commit to 6543-forks/gitea that referenced this pull request Nov 21, 2020
* final fix 2.0?

* ignore Approvals for pulls if not found

* CI.restart()

Co-authored-by: Lauris BH <[email protected]>
@pat-s
Copy link
Member

pat-s commented Nov 23, 2020

I don't see any errors in GL. Excerpt from production.log.
I've also looked through most other logs but might have missed some.

Started POST "/gitlab/profile/personal_access_tokens" for IPGITEA at 2020-11-23 06:36:46 +0000
Processing by Profiles::PersonalAccessTokensController#create as HTML
  Parameters: {"utf8"=>"✓", "authenticity_token"=>"[FILTERED]", "personal_access_token"=>"[FILTERED]"}
Redirected to http://DOMAIN/gitlab/profile/personal_access_tokens
Completed 302 Found in 78ms (ActiveRecord: 29.7ms | Elasticsearch: 0.0ms | Allocations: 19098)
Started GET "/gitlab/profile/personal_access_tokens" for IPGITEA at 2020-11-23 06:36:46 +0000
Processing by Profiles::PersonalAccessTokensController#index as HTML
Completed 200 OK in 108ms (Views: 77.6ms | ActiveRecord: 6.1ms | Elasticsearch: 0.0ms | Allocations: 86789)
Started GET "/gitlab/help" for 127.0.0.1 at 2020-11-23 06:37:19 +0000
Processing by HelpController#index as */*
Completed 200 OK in 576ms (Views: 567.7ms | ActiveRecord: 1.6ms | Elasticsearch: 0.0ms | Allocations: 363122)
Started GET "/gitlab/api/v4/version" for IP at 2020-11-23 06:37:51 +0000
Started GET "/gitlab/api/v4/projects/patrick/cynkra-test" for IP at 2020-11-23 06:37:52 +0000
Started GET "/gitlab/help" for 127.0.0.1 at 2020-11-23 06:38:19 +0000

I suspect it might be an issue with the GL namespace in that install. I can do

curl --include "https://DOMAIN/gitlab/api/v4/projects/3?private_token=TOKEN"
HTTP/2 200
[...]

but I fail when doing

curl --include "https://DOMAIN/gitlab/api/v4/projects/patrick/cynkra-test?private_token=TOKEN"
HTTP/2 404
[...]

#13269 seems to be related.

Using the project ID in the importer directly as suggested in #13269 does not work for me though.

@6543
Copy link
Member Author

6543 commented Nov 23, 2020

Ok in this case this patch works, and I'll backport it now - and I would try to look who is returning 404 and then why ...

6543 added a commit to 6543-forks/gitea that referenced this pull request Nov 23, 2020
* final fix 2.0?

* ignore Approvals for pulls if not found

* CI.restart()

Co-authored-by: Lauris BH <[email protected]>
@6543 6543 added the backport/done All backports for this PR have been created label Nov 23, 2020
@6543
Copy link
Member Author

6543 commented Nov 23, 2020

Backport: #13678

zeripath pushed a commit that referenced this pull request Nov 23, 2020
* final fix 2.0?

* ignore Approvals for pulls if not found

* CI.restart()

Co-authored-by: Lauris BH <[email protected]>

Co-authored-by: Lauris BH <[email protected]>
@go-gitea go-gitea locked and limited conversation to collaborators Jan 18, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
backport/done All backports for this PR have been created lgtm/done This PR has enough approvals to get merged. There are no important open reservations anymore. skip-changelog This PR is irrelevant for the (next) changelog, for example bug fixes for unreleased features. topic/repo-migration Migrate repos from other platforms to Gitea, or from Gitea to them type/bug
Projects
None yet
Development

Successfully merging this pull request may close these issues.

8 participants