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

custom gitlab still no syncing #165

Closed
bash-stack opened this issue May 19, 2020 · 15 comments
Closed

custom gitlab still no syncing #165

bash-stack opened this issue May 19, 2020 · 15 comments
Labels
question Further information is requested

Comments

@bash-stack
Copy link
Contributor

bash-stack commented May 19, 2020

#158 followup ...

the first entry is https://username:token , worked ,
custom gitlab entries get stuck ( and yes bin/console messenger:consume async is running )

stuck

Logs:

{"time":"2020-05-19T19:23:34.667Z","severity":"INFO","duration":234.94,"db":21.03,"view":213.91,"status":200,"method":"GET","path":"/api/v4/projects","params":[{"key":"simple","value":"true"},{"key":"order_by","value":"last_activity_at"},{"key":"owned","value":"true"}],"host":"somegitlab.tld","remote_ip":"0.0.0.0, 0.0.0.0","ua":"php-gitlab-api (http://github.com/m4tthumphrey/php-gitlab-api)","route":"/api/:version/projects","user_id":23,"username":"someuser","queue_duration":21.02,"gitaly_calls":1,"gitaly_duration":4.54,"correlation_id":"U7pPs8VDRH5"}
{"time":"2020-05-19T19:23:34.853Z","severity":"INFO","duration":149.55,"db":12.67,"view":136.88000000000002,"status":200,"method":"GET","path":"/api/v4/projects","params":[{"key":"membership","value":"false"},{"key":"order_by","value":"last_activity_at"},{"key":"owned","value":"true"},{"key":"page","value":"2"},{"key":"per_page","value":"20"},{"key":"simple","value":"true"},{"key":"sort","value":"desc"},{"key":"starred","value":"false"},{"key":"statistics","value":"false"},{"key":"with_custom_attributes","value":"false"},{"key":"with_issues_enabled","value":"false"},{"key":"with_merge_requests_enabled","value":"false"}],"host":"somegitlab.tld","remote_ip":"0.0.0.0, 0.0.0.0","ua":"php-gitlab-api (http://github.com/m4tthumphrey/php-gitlab-api)","route":"/api/:version/projects","user_id":23,"username":"someuser","queue_duration":23.96,"gitaly_calls":2,"gitaly_duration":12.32,"correlation_id":"ppcecS9JOB3"}
Started GET "/api/v4/projects?simple=true&order_by=last_activity_at&owned=true" for 0.0.0.0 at 2020-05-19 21:23:34 +0200
Started GET "/api/v4/projects?membership=false&order_by=last_activity_at&owned=true&page=2&per_page=20&simple=true&sort=desc&starred=false&statistics=false&with_custom_attributes=false&with_issues_enabled=false&with_merge_requests_enabled=false" for 0.0.0.0 at 2020-05-19 21:23:34 +0200
Started GET "/api/v4/projects?simple=true&order_by=last_activity_at&membership=true" for 0.0.0.0 at 2020-05-19 21:23:34 +0200
0.0.0.0 - - [19/May/2020:21:23:34 +0200] "GET /api/v4/projects?simple=true&order_by=last_activity_at&owned=true HTTP/2.0" 200 2347 "" "php-gitlab-api (http://github.com/m4tthumphrey/php-gitlab-api)"
0.0.0.0 - - [19/May/2020:21:23:34 +0200] "GET /api/v4/projects?membership=false&order_by=last_activity_at&owned=true&page=2&per_page=20&simple=true&sort=desc&starred=false&statistics=false&with_custom_attributes=false&with_issues_enabled=false&with_merge_requests_enabled=false HTTP/2.0" 200 1786 "" "php-gitlab-api (http://github.com/m4tthumphrey/php-gitlab-api)"
{"time":"2020-05-19T19:23:35.043Z","severity":"INFO","duration":167.44,"db":12.04,"view":155.4,"status":200,"method":"GET","path":"/api/v4/projects","params":[{"key":"simple","value":"true"},{"key":"order_by","value":"last_activity_at"},{"key":"membership","value":"true"}],"host":"somegitlab.tld","remote_ip":"0.0.0.0, 0.0.0.0","ua":"php-gitlab-api (http://github.com/m4tthumphrey/php-gitlab-api)","route":"/api/:version/projects","user_id":23,"username":"someuser","queue_duration":13.93,"gitaly_calls":1,"gitaly_duration":4.41,"correlation_id":"d4nM4bsioW2"}
{"time":"2020-05-19T19:23:35.476Z","severity":"INFO","duration":398.42,"db":10.77,"view":387.65000000000003,"status":200,"method":"GET","path":"/api/v4/projects","params":[{"key":"membership","value":"true"},{"key":"order_by","value":"last_activity_at"},{"key":"owned","value":"false"},{"key":"page","value":"2"},{"key":"per_page","value":"20"},{"key":"simple","value":"true"},{"key":"sort","value":"desc"},{"key":"starred","value":"false"},{"key":"statistics","value":"false"},{"key":"with_custom_attributes","value":"false"},{"key":"with_issues_enabled","value":"false"},{"key":"with_merge_requests_enabled","value":"false"}],"host":"somegitlab.tld","remote_ip":"0.0.0.0, 0.0.0.0","ua":"php-gitlab-api (http://github.com/m4tthumphrey/php-gitlab-api)","route":"/api/:version/projects","user_id":23,"username":"someuser","queue_duration":26.82,"gitaly_calls":2,"gitaly_duration":10.08,"correlation_id":"Bm2ICu7Fht7"}
Started GET "/api/v4/projects?membership=true&order_by=last_activity_at&owned=false&page=2&per_page=20&simple=true&sort=desc&starred=false&statistics=false&with_custom_attributes=false&with_issues_enabled=false&with_merge_requests_enabled=false" for 0.0.0.0 at 2020-05-19 21:23:35 +0200
0.0.0.0 - - [19/May/2020:21:23:35 +0200] "GET /api/v4/projects?simple=true&order_by=last_activity_at&membership=true HTTP/2.0" 200 2630 "" "php-gitlab-api (http://github.com/m4tthumphrey/php-gitlab-api)"
0.0.0.0 - - [19/May/2020:21:23:35 +0200] "GET /api/v4/projects?membership=true&order_by=last_activity_at&owned=false&page=2&per_page=20&simple=true&sort=desc&starred=false&statistics=false&with_custom_attributes=false&with_issues_enabled=false&with_merge_requests_enabled=false HTTP/2.0" 200 2304 "" "php-gitlab-api (http://github.com/m4tthumphrey/php-gitlab-api)"
{"time":"2020-05-19T19:23:36.869Z","severity":"INFO","duration":16.15,"db":3.11,"view":13.04,"status":200,"method":"GET","path":"/api/v4/projects/162/hooks","params":[],"host":"somegitlab.tld","remote_ip":"0.0.0.0, 0.0.0.0","ua":"php-gitlab-api (http://github.com/m4tthumphrey/php-gitlab-api)","route":"/api/:version/projects/:id/hooks","user_id":23,"username":"someuser","queue_duration":12.03,"correlation_id":"juHkkUtLjS8"}
{"time":"2020-05-19T19:23:36.936Z","severity":"INFO","duration":32.77,"db":5.28,"view":27.490000000000002,"status":201,"method":"POST","path":"/api/v4/projects/162/hooks","params":[{"key":"push_events","value":"1"},{"key":"tag_push_events","value":"1"},{"key":"url","value":"https://repman.some.where.else/hook/82d60d69-edb7-434b-8f35-d60fb5326e85"}],"host":"somegitlab.tld","remote_ip":"0.0.0.0, 0.0.0.0","ua":"php-gitlab-api (http://github.com/m4tthumphrey/php-gitlab-api)","route":"/api/:version/projects/:id/hooks","user_id":23,"username":"someuser","queue_duration":13.79,"correlation_id":"g7KNez7wdk3"}
Started GET "/api/v4/projects/162/hooks" for 0.0.0.0 at 2020-05-19 21:23:36 +0200
Started POST "/api/v4/projects/162/hooks" for 0.0.0.0 at 2020-05-19 21:23:36 +0200
0.0.0.0 - - [19/May/2020:21:23:36 +0200] "GET /api/v4/projects/162/hooks HTTP/2.0" 200 2 "" "php-gitlab-api (http://github.com/m4tthumphrey/php-gitlab-api)"
0.0.0.0 - - [19/May/2020:21:23:36 +0200] "POST /api/v4/projects/162/hooks HTTP/2.0" 201 492 "" "php-gitlab-api (http://github.com/m4tthumphrey/php-gitlab-api)"

@akondas
Copy link
Member

akondas commented May 20, 2020

Next things you can check:

  • Failed message queue: bin/console messenger:failed:show
  • Message consumer logs var/log/consumer.log
  • Supervisor logs /var/log/supervisor/message-consumer_00-stderr ...

@akondas akondas added the question Further information is requested label May 20, 2020
@bash-stack
Copy link
Contributor Author

bash-stack commented May 20, 2020

Next things you can check:

hit:

  • Failed message queue: bin/console messenger:failed:show

52 Buddy\Repman\Message\Organization\SynchronizePackage 2020-05-19 20:46:11 Too few arguments to function Buddy\Repman\Service\PackageSynchronizer\ComposerPackageSynchronizer::__construct(), 4 passed in /var/www/repman/var/cache/local/ContainerX8StnRW/Buddy_Repman_KernelLocalContainer.php on line 1690 and exactly 5 expected
41 Buddy\Repman\Message\Organization\SynchronizePackage 2020-05-19 20:41:25 Too few arguments to function Buddy\Repman\Service\PackageSynchronizer\ComposerPackageSynchronizer::__construct(), 4 passed in /var/www/repman/var/cache/local/ContainerX8StnRW/Buddy_Repman_KernelLocalContainer.php on line 1690 and exactly 5 expected
64 Buddy\Repman\Message\Organization\SynchronizePackage 2020-05-19 21:25:43 Too few arguments to function Buddy\Repman\Service\PackageSynchronizer\ComposerPackageSynchronizer::__construct(), 4 passed in /var/www/repman/var/cache/local/ContainerX8StnRW/Buddy_Repman_KernelLocalContainer.php on line 1690 and exactly 5 expected
69 Buddy\Repman\Message\Organization\SynchronizePackage 2020-05-19 21:38:02 Too few arguments to function Buddy\Repman\Service\PackageSynchronizer\ComposerPackageSynchronizer::__construct(), 4 passed in /var/www/repman/var/cache/local/ContainerX8StnRW/Buddy_Repman_KernelLocalContainer.php on line 1690 and exactly 5 expected
75 Buddy\Repman\Message\Organization\SynchronizePackage 2020-05-19 21:48:15 Too few arguments to function Buddy\Repman\Service\PackageSynchronizer\ComposerPackageSynchronizer::__construct(), 4 passed in /var/www/repman/var/cache/local/ContainerX8StnRW/Buddy_Repman_KernelLocalContainer.php on line 1690 and exactly 5 expected
46 Buddy\Repman\Message\Organization\SynchronizePackage 2020-05-19 20:41:41 Too few arguments to function Buddy\Repman\Service\PackageSynchronizer\ComposerPackageSynchronizer::__construct(), 4 passed in /var/www/repman/var/cache/local/ContainerX8StnRW/Buddy_Repman_KernelLocalContainer.php on line 1690 and exactly 5 expected
58 Buddy\Repman\Message\Organization\SynchronizePackage 2020-05-19 20:49:54 Too few arguments to function Buddy\Repman\Service\PackageSynchronizer\ComposerPackageSynchronizer::__construct(), 4 passed in /var/www/repman/var/cache/local/ContainerX8StnRW/Buddy_Repman_KernelLocalContainer.php on line 1690 and exactly 5 expected
81 Buddy\Repman\Message\Organization\SynchronizePackage 2020-05-19 21:52:20 Too few arguments to function Buddy\Repman\Service\PackageSynchronizer\ComposerPackageSynchronizer::__construct(), 4 passed in /var/www/repman/var/cache/local/ContainerX8StnRW/Buddy_Repman_KernelLocalContainer.php on line 1690 and exactly 5 expected

@akondas
Copy link
Member

akondas commented May 20, 2020

Looks like you need to clear cache (bin/console cache:clear). You probably did the code update without clearing your cache afterwards.

Next you can run: bin/console messenger:failed:retry to retry failed messages.

Tip: if you do manual update please check ansible/deploy.yml for list of steps you need to do:

  • composer install
  • clear cache
  • run migrations
  • restart consumers

(it is for now, but it can always change)

@bash-stack
Copy link
Contributor Author

now it fails with

Error: No driver found to handle VCS repository https://somegitlab.tld:8888/mygroup/myproject

@akondas
Copy link
Member

akondas commented May 21, 2020

What is the type of package? Because authorization for this type of files is set only for packages added by the oauth integration. Otherwise, you need to either add the repman's ssh key to your gitlab instance and use the git repository link, or use the token link as you wrote earlier.

@bash-stack
Copy link
Contributor Author

oauth ( clicking through → organization → add package → gitlab → "repository/path" )

@nickygerritsen
Copy link
Contributor

So this might be related, but when I use a custom GitLab host and add a repository, I get that the bin/console messenger:consume async command asks for a username/password for my custom gitlab URL (and indeed the UI shows the above message).

Screenshot of the messenger:consume with -vv:

image

My guess: the git clone doesn't use the correct authentication?

@nickygerritsen
Copy link
Contributor

nickygerritsen commented May 27, 2020

Did some debugging and it turns out Composer uses the VcsRepository::getDriver and loops over drivers. It then comes to the GitDriver and asks for a username/password.

First of all I think the last two arguments of https://github.com/repman-io/repman/blob/master/src/Service/PackageSynchronizer/ComposerPackageSynchronizer.php#L121 need to be swapped? Although Composer itself in their Gitlab driver also uses this order 🤔 .

But even with that it doesn't work. Composer uses the GitDriver to fetch the data. I tried updating ComposerPackageSynchronizer::createConfig to also add gitlab-domains and gitlab-token to force it to use the GitLab API to fetch data but couldn't get that to work either, since it seems to not be able to authenticate then either.

@karniv00l
Copy link
Contributor

Hi @nickygerritsen,

is this on your local machine? Would you try reproducing that using docker?

@nickygerritsen
Copy link
Contributor

It is on my machine with a clone from master without Docker.
Can I easily run master in Docker? Since the releases don't have the latest code yet.

@karniv00l
Copy link
Contributor

Sure, just create docker-compose.override.yml file containing:

version: '3.4'

services:
  app:
    image: repman:beta
    build: .

  consumer:
    image: repman:beta
    build: .

  cron:
    image: repman:beta
    build: .

And run docker-compose up --build

although you could start with removing your GitLab token (Profile -> Unlink GitLab) and trying again?

@nickygerritsen
Copy link
Contributor

Just tried Docker, that gives the same issue indeed.

@nickygerritsen
Copy link
Contributor

See the PR I just created, that seems to fix it for me at least.

@akondas
Copy link
Member

akondas commented May 27, 2020

@bash-stack please try to update (#179) and check if this fix helps

@akondas akondas reopened this May 27, 2020
@akondas
Copy link
Member

akondas commented Jun 26, 2020

@bash-stack do you think we can close this issue now?

@akondas akondas closed this as completed Sep 3, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
question Further information is requested
Projects
None yet
Development

No branches or pull requests

4 participants