Harbor: Gitlab pull based replicate not working

Created on 28 Mar 2020  Â·  9Comments  Â·  Source: goharbor/harbor

I install harbor on my k8s cluster with helm. Everything is working but except GitLab replication.

Helm version

➜ helm ls                                       
NAME    NAMESPACE   REVISION    UPDATED                                 STATUS      CHART           APP VERSION
harbor  harbor      1           2020-03-21 22:38:12.424080404 +0300 +03 deployed    harbor-1.3.1    1.10.1     

There are a harbor core pod logs

2020/03/27 18:54:01.885 [D] [server.go:2774]  |   192.168.0.22| 200 |   8.232985ms|   match| PUT      /api/replication/policies/1   r:/api/replication/policies/:id([0-9]+)
2020-03-27T18:54:01Z [DEBUG] [/core/filter/sessionchecker.go:22]: Mark the request as no-session
2020-03-27T18:54:01Z [DEBUG] [/core/filter/security.go:232]: OIDC CLI modifier only handles request by docker CLI or helm CLI
2020-03-27T18:54:01Z [DEBUG] [/core/filter/security.go:462]: got user information from session
2020-03-27T18:54:01Z [DEBUG] [/core/filter/security.go:468]: using local database project manager
2020-03-27T18:54:01Z [DEBUG] [/core/filter/security.go:470]: creating local database security context...
2020/03/27 18:54:01.985 [D] [server.go:2774]  |   192.168.0.22| 200 |   3.520464ms|   match| GET      /api/replication/policies   r:/api/replication/policies
2020-03-27T18:54:04Z [DEBUG] [/core/filter/sessionchecker.go:22]: Mark the request as no-session
2020-03-27T18:54:04Z [DEBUG] [/core/filter/security.go:232]: OIDC CLI modifier only handles request by docker CLI or helm CLI
2020-03-27T18:54:04Z [DEBUG] [/core/filter/security.go:462]: got user information from session
2020-03-27T18:54:04Z [DEBUG] [/core/filter/security.go:468]: using local database project manager
2020-03-27T18:54:04Z [DEBUG] [/core/filter/security.go:470]: creating local database security context...
2020/03/27 18:54:04.027 [D] [server.go:2774]  |   192.168.0.22| 200 |   5.238648ms|   match| GET      /api/replication/executions   r:/api/replication/executions
2020-03-27T18:54:04Z [DEBUG] [/core/filter/sessionchecker.go:22]: Mark the request as no-session
2020-03-27T18:54:04Z [DEBUG] [/core/filter/security.go:232]: OIDC CLI modifier only handles request by docker CLI or helm CLI
2020-03-27T18:54:04Z [DEBUG] [/core/filter/security.go:462]: got user information from session
2020-03-27T18:54:04Z [DEBUG] [/core/filter/security.go:468]: using local database project manager
2020-03-27T18:54:04Z [DEBUG] [/core/filter/security.go:470]: creating local database security context...
2020/03/27 18:54:04.626 [D] [server.go:2774]  |   192.168.0.22| 200 |   3.798905ms|   match| GET      /api/replication/executions   r:/api/replication/executions
2020-03-27T18:54:07Z [DEBUG] [/core/filter/sessionchecker.go:22]: Mark the request as no-session
2020-03-27T18:54:07Z [DEBUG] [/core/filter/security.go:232]: OIDC CLI modifier only handles request by docker CLI or helm CLI
2020-03-27T18:54:07Z [DEBUG] [/core/filter/security.go:462]: got user information from session
2020-03-27T18:54:07Z [DEBUG] [/core/filter/security.go:468]: using local database project manager
2020-03-27T18:54:07Z [DEBUG] [/core/filter/security.go:470]: creating local database security context...
2020-03-27T18:54:07Z [DEBUG] [/replication/operation/controller.go:253]: an execution record for replication based on the policy 1 created: 7
2020-03-27T18:54:07Z [DEBUG] [/replication/operation/controller.go:87]: waiting for the available replicator ...
2020-03-27T18:54:07Z [DEBUG] [/replication/operation/controller.go:89]: got an available replicator, starting the replication ...
2020/03/27 18:54:07.798 [D] [server.go:2774]  |   192.168.0.22| 201 |    5.99593ms|   match| POST     /api/replication/executions   r:/api/replication/executions
2020-03-27T18:54:07Z [DEBUG] [/core/filter/sessionchecker.go:22]: Mark the request as no-session
2020-03-27T18:54:07Z [DEBUG] [/core/filter/security.go:232]: OIDC CLI modifier only handles request by docker CLI or helm CLI
2020-03-27T18:54:07Z [DEBUG] [/core/filter/security.go:462]: got user information from session
2020-03-27T18:54:07Z [DEBUG] [/core/filter/security.go:468]: using local database project manager
2020-03-27T18:54:07Z [DEBUG] [/core/filter/security.go:470]: creating local database security context...
2020/03/27 18:54:07.907 [D] [server.go:2774]  |   192.168.0.22| 200 |   4.147938ms|   match| GET      /api/replication/executions   r:/api/replication/executions
2020-03-27T18:54:07Z [DEBUG] [/core/filter/security.go:232]: OIDC CLI modifier only handles request by docker CLI or helm CLI
2020-03-27T18:54:07Z [DEBUG] [/core/filter/security.go:459]: can not get user information from session
2020-03-27T18:54:07Z [DEBUG] [/core/filter/security.go:514]: user information is nil
2020-03-27T18:54:07Z [DEBUG] [/core/filter/security.go:528]: using local database project manager
2020-03-27T18:54:07Z [DEBUG] [/core/filter/security.go:530]: creating local database security context...
2020/03/27 18:54:07.924 [D] [server.go:2774]  |    192.168.0.1| 200 |     939.51µs|   match| GET      /api/ping   r:/api/ping
2020-03-27T18:54:08Z [DEBUG] [/replication/operation/flow/stage.go:55]: replication flow initialization completed
panic: runtime error: index out of range

goroutine 583 [running]:
github.com/goharbor/harbor/src/replication/adapter/gitlab.(*adapter).FetchImages(0xc0000e0910, 0xc000320390, 0x2, 0x2, 0xc0000e0910, 0x1, 0x1, 0x1, 0x2c8ec00)
    /harbor/src/replication/adapter/gitlab/adapter.go:111 +0xce2
github.com/goharbor/harbor/src/replication/operation/flow.fetchResources(0x1cca580, 0xc0000e0910, 0xc000a63b80, 0x1cca600, 0xc000842ae0, 0x0, 0x0, 0xc0004bb5c0)
    /harbor/src/replication/operation/flow/stage.go:89 +0xa1f
github.com/goharbor/harbor/src/replication/operation/flow.(*copyFlow).Run(0xc0002c5680, 0x0, 0x0, 0x18776e0, 0xc000737b01, 0xc0002c5680)
    /harbor/src/replication/operation/flow/copy.go:58 +0x61b
github.com/goharbor/harbor/src/replication/operation/flow.(*controller).Start(0x2cb2440, 0x1ca62e0, 0xc0002c5680, 0x400101, 0x10100c000032000, 0x2c93840)
    /harbor/src/replication/operation/flow/controller.go:36 +0x39
github.com/goharbor/harbor/src/replication/operation.(*controller).StartReplication.func1(0xc000381f80, 0x7, 0xc000a63b80, 0x0)
    /harbor/src/replication/operation/controller.go:95 +0x1b9
created by github.com/goharbor/harbor/src/replication/operation.(*controller).StartReplication
    /harbor/src/replication/operation/controller.go:90 +0x18a

arereplication kinbug replicatioadapters

All 9 comments

Gitlab adapter is contributed by the community.

@lxShaDoWxl

Would you please take a look at this issue? Thanks a lot!

@lxShaDoWxl

Will you keep on supporting this adapter?

Hello,

I'm facing some issue with GitLab pull-based replicate, however, pull-based replicate working with docker hub registry.

Herbor version: v1.10.2

harbor-core pod throwing below error :

core panic: runtime error: index out of range core core goroutine 609 [running]: core github.com/goharbor/harbor/src/replication/adapter/gitlab.(*adapter).FetchImages(0xc00061b810, 0xc0000e27e8, 0x1, 0x1, 0xc00061b810, 0x1, 0x1, 0x1, 0x0) core /harbor/src/replication/adapter/gitlab/adapter.go:111 +0xce2 core github.com/goharbor/harbor/src/replication/operation/flow.fetchResources(0x1cca580, 0xc00061b810, 0xc000642580, 0x1cca600, 0xc0002e8240, 0x0, 0x0, 0xc0005e7dc0) core /harbor/src/replication/operation/flow/stage.go:89 +0xa1f core github.com/goharbor/harbor/src/replication/operation/flow.(*copyFlow).Run(0xc00061b680, 0x0, 0x0, 0x18776e0, 0x1, 0xc00061b680) core /harbor/src/replication/operation/flow/copy.go:58 +0x61b core github.com/goharbor/harbor/src/replication/operation/flow.(*controller).Start(0x2cb2440, 0x1ca62e0, 0xc00061b680, 0x457040, 0xc000661140, 0xc0005e7ef8) core /harbor/src/replication/operation/flow/controller.go:36 +0x39 core github.com/goharbor/harbor/src/replication/operation.(*controller).StartReplication.func1(0xc00041e100, 0x27, 0xc000642580, 0x0) core /harbor/src/replication/operation/controller.go:95 +0x1b9 core created by github.com/goharbor/harbor/src/replication/operation.(*controller).StartReplication core /harbor/src/replication/operation/controller.go:90 +0x18a

@lxShaDoWxl

Did you get my message? Will you continue to support this adapter?

As the developer of this adapter did not respond yet, the fix of this issue may be a little slow.

from the code in
https://github.com/goharbor/harbor/blob/417e12ecaf8bedaf7ad7c624d26a189e9b28252e/src/replication/adapter/gitlab/adapter.go#L111
this is a bug, the workaround is you can leave filter name empty or use namespace/**

And this issue is not exists in 2.x

in 2.x there's a known issue #12605

Was this page helpful?
0 / 5 - 0 ratings

Related issues

reasonerjt picture reasonerjt  Â·  3Comments

andrewtchin picture andrewtchin  Â·  3Comments

xiaosadexiaohai picture xiaosadexiaohai  Â·  3Comments

cedvan picture cedvan  Â·  3Comments

protochron picture protochron  Â·  3Comments