Project

Profile

Help

Issue #2769

closed

Relative paths are not checked for collisions

Added by Ichimonji10 over 7 years ago. Updated over 5 years ago.

Status:
CLOSED - CURRENTRELEASE
Priority:
High
Sprint/Milestone:
-
Start date:
Due date:
Estimated time:
Severity:
3. High
Version - OSTree:
Platform Release:
2.14.0
Target Release - OSTree:
OS:
Triaged:
Yes
Groomed:
No
Sprint Candidate:
No
Tags:
Pulp 2
Sprint:
Sprint 20
Quarter:

Description

An OSTree distributor may be given a relative_path option. All relative paths among all OSTree distributors must be unique. For example, if an OSTree distributor has a relative path of: foo/bar, then the following relative paths are valid:

  • abc/def (unique)
  • ghi/jkl/mno (relative paths aren't restricted to two segments)

And the following relative paths are invalid:

  • foo/bar (identical to an existing relative path)
  • foo/bar/biz (has the same prefix as an existing relative path)
  • /foo/bar (prefixing a slash doesn't change the semantics of the path)

This behaviour has been enforced since Pulp 2.8.3. The work was tracked in Pulp issue #1106 . As of last night's Pulp 2.14 nightly build, the behaviour is no longer enforced. AFAICT, this is a regression.

I could find no messages of interest in journalctl's output.

This issue is present on all 2.14 nightly builds. Here's the relevant packages installed on Fedora 24:

# rpm -qa | grep -i pulp | sort
pulp-admin-client-2.14.0-0.1.alpha.git.18832.aaaae1e.fc24.noarch
pulp-docker-admin-extensions-2.5.0-0.1.alpha.git.268.50ca9b6.fc24.noarch
pulp-docker-plugins-2.5.0-0.1.alpha.git.268.50ca9b6.fc24.noarch
pulp-ostree-admin-extensions-1.3.0-0.1.alpha.git.191.ad58669.fc24.noarch
pulp-ostree-plugins-1.3.0-0.1.alpha.git.191.ad58669.fc24.noarch
pulp-puppet-admin-extensions-2.14.0-0.1.alpha.git.373.251928b.fc24.noarch
pulp-puppet-plugins-2.14.0-0.1.alpha.git.373.251928b.fc24.noarch
pulp-python-admin-extensions-2.1.0-0.1.alpha.git.166.6ad0f43.fc24.noarch
pulp-python-plugins-2.1.0-0.1.alpha.git.166.6ad0f43.fc24.noarch
pulp-rpm-admin-extensions-2.14.0-0.1.alpha.git.833.a2a7e39.fc24.noarch
pulp-rpm-plugins-2.14.0-0.1.alpha.git.833.a2a7e39.fc24.noarch
pulp-selinux-2.14.0-0.1.alpha.git.18832.aaaae1e.fc24.noarch
pulp-server-2.14.0-0.1.alpha.git.18832.aaaae1e.fc24.noarch
python-kombu-3.0.33-6.pulp.fc24.noarch
python-pulp-bindings-2.14.0-0.1.alpha.git.18832.aaaae1e.fc24.noarch
python-pulp-client-lib-2.14.0-0.1.alpha.git.18832.aaaae1e.fc24.noarch
python-pulp-common-2.14.0-0.1.alpha.git.18832.aaaae1e.fc24.noarch
python-pulp-docker-common-2.5.0-0.1.alpha.git.268.50ca9b6.fc24.noarch
python-pulp-oid_validation-2.14.0-0.1.alpha.git.18832.aaaae1e.fc24.noarch
python-pulp-ostree-common-1.3.0-0.1.alpha.git.191.ad58669.fc24.noarch
python-pulp-puppet-common-2.14.0-0.1.alpha.git.373.251928b.fc24.noarch
python-pulp-python-common-2.1.0-0.1.alpha.git.166.6ad0f43.fc24.noarch
python-pulp-repoauth-2.14.0-0.1.alpha.git.18832.aaaae1e.fc24.noarch
python-pulp-rpm-common-2.14.0-0.1.alpha.git.833.a2a7e39.fc24.noarch
python-pulp-streamer-2.14.0-0.1.alpha.git.18832.aaaae1e.fc24.noarch
Actions #1

Updated by ttereshc over 7 years ago

  • Priority changed from Normal to High
  • Sprint/Milestone set to 39
  • Severity changed from 2. Medium to 3. High
Actions #2

Updated by ttereshc over 7 years ago

  • Triaged changed from No to Yes
Actions #3

Updated by Ichimonji10 over 7 years ago

  • Description updated (diff)

Added by jortel@redhat.com over 7 years ago

Revision bd2223f2 | View on GitHub

support passing the field name to get_repo_distributors_by_relative_url().

Actions #4

Updated by Ichimonji10 over 7 years ago

Tests are in place for this issue. See CreateDistributorsTestCase and UpdateDistributorsTestCase in pulp_smash.tests.ostree.api_v2.test_crud (source code)

Actions #5

Updated by ipanova@redhat.com over 7 years ago

  • Status changed from NEW to ASSIGNED
  • Assignee set to ipanova@redhat.com

Added by jortel@redhat.com over 7 years ago

Revision c1dc2a91 | View on GitHub

Fix relative path checking. closes #2769.

Actions #7

Updated by jortel@redhat.com over 7 years ago

  • Status changed from POST to MODIFIED
Actions #8

Updated by bmbouter over 7 years ago

I manually associated the second commit from core. Without all commits being associated a downstream cherry pick of this issue would be DOA.

Actions #10

Updated by pcreech over 7 years ago

  • Platform Release set to 2.14.0
Actions #11

Updated by pcreech over 7 years ago

  • Status changed from MODIFIED to 5
Actions #12

Updated by kdelee@redhat.com over 7 years ago

Fix verified as a part of 2.14 beta Test Day.

The user is not allowed to create two ostree repos with conflicting relative-paths.

[root@fedora25base ~]# rpm -qa | grep pulp
python-pulp-bindings-2.14.0-0.1.beta.fc25.noarch
pulp-ostree-admin-extensions-1.3.0-0.3.rc.git.1.3a770cd.fc25.noarch
python-pulp-docker-common-3.0.0-0.1.beta.fc25.noarch
pulp-deb-plugins-1.5.2-0.2.beta.fc25.noarch
python-pulp-deb-common-1.5.2-0.2.beta.fc25.noarch
pulp-puppet-admin-extensions-2.14.0-0.3.rc.git.1.12bf98c.fc25.noarch
python-pulp-rpm-common-2.14.0-0.1.beta.fc25.noarch
python-pulp-python-common-2.0.1-0.1.beta.fc25.noarch
pulp-selinux-2.14.0-0.3.rc.git.1.b8a44dd.fc25.noarch
pulp-deb-admin-extensions-1.5.2-0.2.beta.fc25.noarch
python-pulp-repoauth-2.14.0-0.1.beta.fc25.noarch
pulp-puppet-plugins-2.14.0-0.3.rc.git.1.12bf98c.fc25.noarch
pulp-rpm-admin-extensions-2.14.0-0.3.rc.git.1.5746bbf.fc25.noarch
python-pulp-oid_validation-2.14.0-0.1.beta.fc25.noarch
pulp-admin-client-2.14.0-0.3.rc.git.1.b8a44dd.fc25.noarch
pulp-python-plugins-2.0.1-0.3.rc.git.1.1d5b1c8.fc25.noarch
python-pulp-client-lib-2.14.0-0.1.beta.fc25.noarch
python-pulp-streamer-2.14.0-0.1.beta.fc25.noarch
pulp-docker-plugins-3.0.0-0.3.rc.git.1.5149268.fc25.noarch
python-pulp-common-2.14.0-0.1.beta.fc25.noarch
pulp-ostree-plugins-1.3.0-0.3.rc.git.1.3a770cd.fc25.noarch
python-pulp-puppet-common-2.14.0-0.1.beta.fc25.noarch
python-pulp-ostree-common-1.3.0-0.1.beta.fc25.noarch
pulp-server-2.14.0-0.3.rc.git.1.b8a44dd.fc25.noarch
pulp-docker-admin-extensions-3.0.0-0.3.rc.git.1.5149268.fc25.noarch
pulp-python-admin-extensions-2.0.1-0.3.rc.git.1.1d5b1c8.fc25.noarch
pulp-rpm-plugins-2.14.0-0.3.rc.git.1.5746bbf.fc25.noarch

[root@fedora25base ~]# cat /etc/redhat-release 
Fedora release 25 (Twenty Five)
 pulp-admin login -u admin -p admin
Successfully logged in. Session certificate will expire at Aug 15 18:27:01 2017
GMT.

[root@fedora25base ~]# pulp-admin -vvvv ostree repo create --repo-id testpaths --relative-path collision/boom
2017-08-08 14:27:04,116 - DEBUG - sending POST request to /pulp/api/v2/repositories/
2017-08-08 14:27:04,494 - INFO - POST request to /pulp/api/v2/repositories/ with parameters {"display_name": null, "description": null, "distributors": [{"distributor_id": "ostree_web_distributor_name_cli", "auto_publish": true, "distributor_config": {"relative_path": "collision/boom"}, "distributor_type_id": "ostree_web_distributor"}], "notes": {"_repo-type": "OSTREE"}, "importer_type_id": "ostree_web_importer", "importer_config": {"feed": null, "ssl_ca_cert": null, "ssl_client_cert": null, "proxy_host": null, "ssl_validation": null, "proxy_password": null, "proxy_port": null, "proxy_username": null, "validate": null, "ssl_client_key": null}, "id": "testpaths"}
2017-08-08 14:27:04,501 - INFO - Response status : 201 

2017-08-08 14:27:04,501 - INFO - Response body :
 {
  "scratchpad": {}, 
  "display_name": null, 
  "description": null, 
  "last_unit_added": null, 
  "notes": {
    "_repo-type": "OSTREE"
  }, 
  "last_unit_removed": null, 
  "content_unit_counts": {}, 
  "_ns": "repos", 
  "_id": {
    "$oid": "598a02780d1a720908a88c6a"
  }, 
  "id": "testpaths", 
  "_href": "/pulp/api/v2/repositories/testpaths/"
}

Repository [testpaths] successfully created

[root@fedora25base ~]# pulp-admin -vvvv ostree repo create --repo-id testpaths2 --relative-path collision/boom
2017-08-08 14:27:12,804 - DEBUG - sending POST request to /pulp/api/v2/repositories/
2017-08-08 14:27:13,025 - INFO - POST request to /pulp/api/v2/repositories/ with parameters {"display_name": null, "description": null, "distributors": [{"distributor_id": "ostree_web_distributor_name_cli", "auto_publish": true, "distributor_config": {"relative_path": "collision/boom"}, "distributor_type_id": "ostree_web_distributor"}], "notes": {"_repo-type": "OSTREE"}, "importer_type_id": "ostree_web_importer", "importer_config": {"feed": null, "ssl_ca_cert": null, "ssl_client_cert": null, "proxy_host": null, "ssl_validation": null, "proxy_password": null, "proxy_port": null, "proxy_username": null, "validate": null, "ssl_client_key": null}, "id": "testpaths2"}
2017-08-08 14:27:13,025 - INFO - Response status : 400 

2017-08-08 14:27:13,026 - INFO - Response body :
 {
  "exception": null, 
  "args": [
    "Relative path [collision/boom] for repository [testpaths2] conflicts with relative path [collision/boom] for repository [testpaths]"
  ], 
  "_href": "/pulp/api/v2/repositories/", 
  "traceback": null, 
  "error_message": "Relative path [collision/boom] for repository [testpaths2] conflicts with relative path [collision/boom] for repository [testpaths]", 
  "http_request_method": "POST", 
  "http_status": 400, 
  "error": {
    "code": "PLP0000", 
    "data": {}, 
    "description": "Relative path [collision/boom] for repository [testpaths2] conflicts with relative path [collision/boom] for repository [testpaths]", 
    "sub_errors": []
  }
}

2017-08-08 14:27:13,029 - ERROR - Exception occurred:
        href:      /pulp/api/v2/repositories/
        method:    POST
        status:    400
        error:     Relative path [collision/boom] for repository [testpaths2] conflicts with relative path [collision/boom] for repository [testpaths]
        traceback: None
        data:      {u'args': [u'Relative path [collision/boom] for repository [testpaths2] conflicts with relative path [collision/boom] for repository [testpaths]'], u'error': {u'code': u'PLP0000', u'data': {}, u'description': u'Relative path [collision/boom] for repository [testpaths2] conflicts with relative path [collision/boom] for repository [testpaths]', u'sub_errors': []}}

Relative path [collision/boom] for repository [testpaths2] conflicts with
relative path [collision/boom] for repository [testpaths]
Actions #13

Updated by pcreech over 7 years ago

  • Status changed from 5 to CLOSED - CURRENTRELEASE
Actions #14

Updated by bmbouter over 6 years ago

  • Sprint set to Sprint 20
Actions #15

Updated by bmbouter over 6 years ago

  • Sprint/Milestone deleted (39)
Actions #16

Updated by bmbouter over 5 years ago

  • Tags Pulp 2 added

Also available in: Atom PDF