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

Duplicates in repository #19468

Closed
nevlkv opened this issue Oct 18, 2023 · 4 comments
Closed

Duplicates in repository #19468

nevlkv opened this issue Oct 18, 2023 · 4 comments
Labels
needs/triage triage issue before assigning Stale

Comments

@nevlkv
Copy link

nevlkv commented Oct 18, 2023

Repository names identic

image

registry=# select * from repository where name ILIKE 'ugc/notifications-producer-cli';
 repository_id |              name              | project_id | description | pull_count | star_count |       creation_time        |        update_time         
---------------+--------------------------------+------------+-------------+------------+------------+----------------------------+----------------------------
        110498 | ugc/notifications-producer-cli |         80 |             |         51 |          0 | 2023-06-09 06:58:45.735555 | 2023-09-10 12:45:17.833493
        123525 | ugc/notifications-producer-cli |         80 |             |        286 |          0 | 2023-09-11 05:39:43.378043 | 2023-10-17 23:18:13.397831
(2 rows)

registry=# insert into repository(name,project_id) values('ugc/notifications-producer-cli',80);
ERROR:  duplicate key value violates unique constraint "repository_name_key"
DETAIL:  Key (name)=(ugc/notifications-producer-cli) already exists.
registry=# \d+ repository;
                                                                   Table "public.repository"
    Column     |            Type             | Collation | Nullable |                      Default                      | Storage  | Stats target | Description 
---------------+-----------------------------+-----------+----------+---------------------------------------------------+----------+--------------+-------------
 repository_id | integer                     |           | not null | nextval('repository_repository_id_seq'::regclass) | plain    |              | 
 name          | character varying(255)      |           | not null |                                                   | extended |              | 
 project_id    | integer                     |           | not null |                                                   | plain    |              | 
 description   | text                        |           |          |                                                   | extended |              | 
 pull_count    | integer                     |           | not null | 0                                                 | plain    |              | 
 star_count    | integer                     |           | not null | 0                                                 | plain    |              | 
 creation_time | timestamp without time zone |           |          | CURRENT_TIMESTAMP                                 | plain    |              | 
 update_time   | timestamp without time zone |           |          | CURRENT_TIMESTAMP                                 | plain    |              | 
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()
Access method: heap


  • harbor version: 2.8.4
@stonezdj
Copy link
Contributor

It seems the unique constraint doesn't work.
Please refer the workaround #17544 (comment)

@MinerYang MinerYang added the needs/triage triage issue before assigning label Oct 23, 2023
@MinerYang
Copy link
Contributor

MinerYang commented Oct 23, 2023

Have you done any upgrade between create these two repository? if any upgrade happened, form which version to current one?

Copy link

This issue is being marked stale due to a period of inactivity. If this issue is still relevant, please comment or remove the stale label. Otherwise, this issue will close in 30 days.

@github-actions github-actions bot added the Stale label Dec 22, 2023
Copy link

This issue was closed because it has been stalled for 30 days with no activity. If this issue is still relevant, please re-open a new issue.

@github-actions github-actions bot closed this as not planned Won't fix, can't repro, duplicate, stale Jan 21, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
needs/triage triage issue before assigning Stale
Projects
None yet
Development

No branches or pull requests

3 participants