Comments (9)
Hello,
harbor_db=> \d repository
Table "public.repository"
Column | Type | Collation | Nullable | Default
---------------+-----------------------------+-----------+----------+---------------------------------------------------
repository_id | integer | | not null | nextval('repository_repository_id_seq'::regclass)
name | character varying(255) | | not null |
project_id | integer | | not null |
description | text | | |
pull_count | integer | | not null | 0
star_count | integer | | not null | 0
creation_time | timestamp without time zone | | | CURRENT_TIMESTAMP
update_time | timestamp without time zone | | | CURRENT_TIMESTAMP
Indexes:
"repository_pkey" PRIMARY KEY, btree (repository_id)
"repository_name_key" UNIQUE CONSTRAINT, btree (name)
Triggers:
repository_update_time_at_modtime BEFORE UPDATE ON repository FOR EACH ROW EXECUTE FUNCTION update_update_time_at_column()
It is same.
The issue arises when we have a repo name "go_user_task" and rename to "go-user-task".
Also i saw a similar post #19468.
For Harbor v2.8.4 version
Thank You,
Ayush
from harbor.
Hello,
In Postgresql query we could see it is listing both "go_user_task" and "go-user-task"
May be postgresql is failed differentiate between "_" and "-"
harbor_db=> select * from repository where name LIKE 'components/go-user%';
repository_id | name | project_id | description | pull_count | star_count | creation_time | update_time
---------------+--------------------------+------------+-------------+------------+------------+----------------------------+----------------------------
1870 | components/go-user-task | 464 | | 45 | 0 | 2024-01-19 11:45:21.786858 | 2024-01-28 00:40:34.245535
1929 | components/go-user-task | 464 | | 23 | 0 | 2024-01-25 12:58:28.767893 | 2024-01-30 16:17:49.893138
(2 rows)
select * from repository where name LIKE 'components/go_user%';
repository_id | name | project_id | description | pull_count | star_count | creation_time | update_time
---------------+--------------------------+------------+-------------+------------+------------+----------------------------+----------------------------
1866 | components/go_user_task | 464 | | 41 | 0 | 2024-01-16 15:57:26.64285 | 2024-01-30 15:46:25.162086
1870 | components/go-user-task | 464 | | 45 | 0 | 2024-01-19 11:45:21.786858 | 2024-01-28 00:40:34.245535
1929 | components/go-user-task | 464 | | 23 | 0 | 2024-01-25 12:58:28.767893 | 2024-01-30 16:17:49.893138
1930 | components/go_user_task | 464 | | 1 | 0 | 2024-01-25 14:42:32.075659 | 2024-01-30 16:46:40.25571
(4 rows)
from harbor.
Nah, it's do differentiate -
and _
.
Could you describe your repository
table to determin if there's any UNIQUE CONSTRAINT
psql
\c registry
\d repository
It should looks like this
Indexes:
"repository_pkey" PRIMARY KEY, btree (repository_id)
"repository_name_key" UNIQUE CONSTRAINT, btree (name)
from harbor.
Could you describe how do you exactly rename repo name from "go_user_task" to "go-user-task".
from harbor.
Hello,
We accidently use the repo name "go-user-task" instead of "go_user_task", then tag and push the image.
So i am just guessing it could be because of "_"/ "-". But i am not sure, why it is showing two repo with same name in UI and backend as well. And when we try to delete it then it says "repo not exist"
Thanks,
Ayush
from harbor.
@AyushCloud could you please provide us with steps how you end up with two components/go_admin_task
repositories as you posted in this following image:
I tried the following steps intending to reproduce this scenario:
- docker tag alpine:2.6 /components/go-user-task:2.6
- docker tag alpine:2.6 /components/go_user_task:2.6
- docker push /components/go-user-task:2.6
- docker push /components/go_user_task:2.6
but there are two repositories with different name, such as components/go-user-task
and components/go_user_task
. And they are different names, not the same records occurs two times.
from harbor.
Hello,
Even i tried to reproduce, but it is now showing any duplicate repo.
select * from repository where name LIKE 'components/go_admin%';
repository_id | name | project_id | description | pull_count | star_count | creation_time | update_time
---------------+--------------------------+------------+-------------+------------+------------+----------------------------+----------------------------
1866 | components/go_admin_task | 464 | | 41 | 0 | 2024-01-16 15:57:26.64285 | 2024-01-30 15:46:25.162086
1870 | components/go-admin-task | 464 | | 45 | 0 | 2024-01-19 11:45:21.786858 | 2024-01-28 00:40:34.245535
1929 | components/go-admin-task | 464 | | 23 | 0 | 2024-01-25 12:58:28.767893 | 2024-01-30 16:17:49.893138
1930 | components/go_admin_task | 464 | | 1 | 0 | 2024-01-25 14:42:32.075659 | 2024-01-30 16:46:40.25571
Based on the time stamp, i could say that, on 25th January we did an upgrade to v2.8.4.
So i believe the repo already exist and post upgrade showing duplicate repo.
Thanks,
Ayush
from harbor.
please follow this workaround:
closing it now.
from harbor.
Regarding: Duplicate Repository
I encountered the same issue after upgrading from Harbor version v2.8.2-d4c34dcc to v2.8.4-ad3e767d regarding image repository management.
Before the upgrade, I had several images pushed with different repository names, some containing underscores ('_') and hyphens ('-'). For instance, repositories like go_admin_task/image:1.0, go-admin-task/image:1.0, before-upgrade:1.0, and before_upgrade:2.0 were present.
After the upgrade, I noticed that images from repositories with names differing only in the use of underscores or hyphens were unexpectedly deleted. Specifically, repositories with names like go_admin_task/image:1.0 and go-admin-task/image:1.0, as well as before-upgrade:1.0 and before_upgrade:2.0, were affected. Interestingly, repositories without such naming discrepancies, like temp_admin/image:1.0 and temp_admin/image:2.0, remained intact.
Furthermore, attempts to push images to repositories containing underscores or hyphens post-upgrade resulted in the creation of duplicate repositories. This behavior was not observed prior to the upgrade.
I believe this issue warrants attention from the Harbor community as it impacts repository management consistency and may lead to unintended data loss or duplication. Any assistance or insights into resolving this matter would be greatly appreciated.
Thank you
Sunil
from harbor.
Related Issues (20)
- Tag immutability of helm charts HOT 3
- Reuploading a deleted image fails with a 404 error HOT 1
- LDAP users cannot login to harbor site, TLS confidentiality required HOT 2
- Large Garbage Collections Slow and Can Easily Fail Indefinitely HOT 2
- Replication between two harbor fails (UNAUTHORIZED error) HOT 3
- I can not login to registery by self sign certificate HOT 3
- Docker login error: Error response from daemon: Get "https://harbor.com.vn/v2/": EOF HOT 7
- Getting unauthorized: unauthorized to access repository : HOT 1
- GC causes outage on production Harbor deployment HOT 2
- tag deleteion performance is poor HOT 4
- Label Replication Feature Available or Not ? HOT 4
- Misleasing info text on replication bandwidth limit
- Error response from daemon: Get "https://<harbor-url>/v2/" : x509: certificate signed by unknown authority HOT 1
- In clean up we have facing issue in harbor
- In job service dashboard we have facing issue. HOT 1
- Conformance test issue -- discovery test GET request to missing manifest should yield 200
- Conformance test issue -- Teardown Delete created manifest & associated tags
- Regarding Duplicate Repositories HOT 4
- Database 2.9 or newer is missing contrib package HOT 2
- Automatically logging in using docker cli results in "unauthorized" error HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from harbor.