Project

Profile

Help

Issue #890

closed

uploaded puppet module gets wrong metadata

Added by mhrivnak about 9 years ago. Updated about 5 years ago.

Status:
CLOSED - CURRENTRELEASE
Priority:
Urgent
Assignee:
Start date:
Due date:
Estimated time:
Severity:
2. Medium
Version:
2.6.0
Platform Release:
2.6.2
OS:
Triaged:
Yes
Groomed:
No
Sprint Candidate:
No
Tags:
Pulp 2
Sprint:
Quarter:

Description

Reproducer steps:

0) Perform a fresh install EL6

1) download the file:

wget https://forgeapi.puppetlabs.com/v3/files/deric-accounts-1.1.2.tar.gz

2) Rename the deric-accounts-1.1.2.tar.gz file to be foo-bar-1.1.2.tar.gz

cp deric-accounts-1.1.2.tar.gz foo-bar-1.1.2.tar.gz

3) create an empty puppet repo:

pulp-admin -u admin -p admin puppet repo create --repo-id zoo-puppet

4) upload the puppet module using the new name.

pulp-admin -u admin -p admin puppet repo uploads upload --file ./foo-bar-1.1.2.tar.gz --repo-id zoo-puppet

4) list the metadata of the modules:

[bmbouter@server pulp]$ pulp-admin -u admin -p admin puppet repo modules --repo-id zoo-puppet

5) You will see the name is 'stdlib', but the expected name is 'accounts' Also the author will be 'puppetlabs', but the expected author is 'deric'.

Actions #1

Updated by bmbouter about 9 years ago

  • Status changed from NEW to ASSIGNED
  • Assignee set to bmbouter
Actions #2

Updated by ipanova@redhat.com almost 9 years ago

I also was not able to reproduce this with successful upload. Looking at the description of the bug, seems like that the upload has to fail in order to make this situation with wrong metadata happen.

Actions #3

Updated by bmbouter almost 9 years ago

  • Description updated (diff)
Actions #4

Updated by bmbouter almost 9 years ago

  • Status changed from ASSIGNED to POST

Added by bmbouter almost 9 years ago

Revision f8157372 | View on GitHub

Updates metadata.json search to look in first top-level folder

The implementation was using a depth-first-search which did not traverse in the same order on all platforms. Some Puppet modules contain other modules as dependencies, and the DFS implementation could incorrectly find the wrong one. This uses a very dumb approach which looks for metadata.json in the top level folder of the the tar.gz uploaded Puppet module. This is based on the Puppet packaging guidelines 0.

https://pulp.plan.io/issues/890 closes #890

Actions #5

Updated by bmbouter almost 9 years ago

  • Status changed from POST to MODIFIED
  • % Done changed from 0 to 100
Actions #6

Updated by dkliban@redhat.com almost 9 years ago

  • Status changed from MODIFIED to 5
Actions #8

Updated by pthomas@redhat.com almost 9 years ago

  • Status changed from 5 to 6

Verified

[root@ibm-x3550m3-13 ~]# rpm -qa pulp-server
pulp-server-2.6.2-0.2.beta.el6.noarch
[root@ibm-x3550m3-13 ~]# 
[root@ibm-x3550m3-13 ~]# wget https://forgeapi.puppetlabs.com/v3/files/deric-accounts-1.1.2.tar.gz
--2015-05-24 21:11:31--  https://forgeapi.puppetlabs.com/v3/files/deric-accounts-1.1.2.tar.gz
Resolving forgeapi.puppetlabs.com... 23.236.57.230
Connecting to forgeapi.puppetlabs.com|23.236.57.230|:443... connected.
HTTP request sent, awaiting response... 200 OK
Length: unspecified [application/octet-stream]
Saving to: “deric-accounts-1.1.2.tar.gz”

    [  <=>                                  ] 130,058      527K/s   in 0.2s    

2015-05-24 21:11:33 (527 KB/s) - “deric-accounts-1.1.2.tar.gz” saved [130058]

[root@ibm-x3550m3-13 ~]# ls
anaconda-ks.cfg  deric-accounts-1.1.2.tar.gz  install.log.syslog  RECIPE.TXT
certs            install.log                  NETBOOT_METHOD.TXT
[root@ibm-x3550m3-13 ~]# wget https://forgeapi.puppetlabs.com/v3/files/deric-accounts-1.1.2.tar.gzcp deric-accounts-1.1.2.tar.gz foo-bar-1.1.2.tar.gz
--2015-05-24 21:12:31--  https://forgeapi.puppetlabs.com/v3/files/deric-accounts-1.1.2.tar.gzcp
Resolving forgeapi.puppetlabs.com... 23.236.57.230
Connecting to forgeapi.puppetlabs.com|23.236.57.230|:443... connected.
HTTP request sent, awaiting response... 404 Not Found
2015-05-24 21:12:31 ERROR 404: Not Found.

--2015-05-24 21:12:31--  http://deric-accounts-1.1.2.tar.gz/
Resolving deric-accounts-1.1.2.tar.gz... failed: Name or service not known.
wget: unable to resolve host address “deric-accounts-1.1.2.tar.gz”
--2015-05-24 21:12:31--  http://foo-bar-1.1.2.tar.gz/
Resolving foo-bar-1.1.2.tar.gz... failed: Name or service not known.
wget: unable to resolve host address “foo-bar-1.1.2.tar.gz”
[root@ibm-x3550m3-13 ~]# ls
anaconda-ks.cfg  deric-accounts-1.1.2.tar.gz  install.log.syslog  RECIPE.TXT
certs            install.log                  NETBOOT_METHOD.TXT
[root@ibm-x3550m3-13 ~]# 
[root@ibm-x3550m3-13 ~]# 
[root@ibm-x3550m3-13 ~]# 
[root@ibm-x3550m3-13 ~]# cp deric-accounts-1.1.2.tar.gz foo-bar-1.1.2.tar.gz
[root@ibm-x3550m3-13 ~]# pulp-admin -u admin -p admin puppet repo create --repo-id zoo-puppet
Successfully created repository [zoo-puppet]

[root@ibm-x3550m3-13 ~]# 
[root@ibm-x3550m3-13 ~]# pulp-admin -u admin -p admin puppet repo uploads upload --file ./foo-bar-1.1.2.tar.gz --repo-id zoo-puppet
+----------------------------------------------------------------------+
                              Unit Upload
+----------------------------------------------------------------------+

Extracting necessary metadata for each request...
[==================================================] 100%
Analyzing: foo-bar-1.1.2.tar.gz
... completed

Creating upload requests on the server...
[==================================================] 100%
Initializing: foo-bar-1.1.2.tar.gz
... completed

Starting upload of selected units. If this process is stopped through ctrl+c,
the uploads will be paused and may be resumed later using the resume command or
cancelled entirely using the cancel command.

Uploading: foo-bar-1.1.2.tar.gz
[==================================================] 100%
130058/130058 bytes
... completed

Importing into the repository...
This command may be exited via ctrl+c without affecting the request.

[\]
Running...

Task Succeeded

Deleting the upload request...
... completed

[root@ibm-x3550m3-13 ~]# pulp-admin -u admin -p admin puppet repo modules --repo-id zoo-puppet
Name:          accounts
Version:       1.1.2
Author:        deric
Checksum:      454a70d5ea9ebe31b39f8afdac95b06cfcba4975825f6d17e14772ea41233a94
Checksum Type: sha256
Dependencies:  
  Name:                puppetlabs/stdlib
  Version Requirement: >= 4.2.0
Description:   Simple user management with hiera support.
License:       Apache-2.0
Project Page:  https://github.com/deric/puppet-accounts
Source:        https://github.com/deric/puppet-accounts
Summary:       Module for managing user accounts and groups.
Tag List:      None

[root@ibm-x3550m3-13 ~]# 
Actions #9

Updated by amacdona@redhat.com over 8 years ago

  • Status changed from 6 to CLOSED - CURRENTRELEASE
Actions #11

Updated by bmbouter about 5 years ago

  • Tags Pulp 2 added

Also available in: Atom PDF