[Pulp-list] Create distribution issues

Heide, Todd Todd.Heide at sccompanies.com
Wed May 6 19:06:49 UTC 2020


Hi, thanks for the reply. I think my issue runs deeper. I found that the GUI is missing all the css. When I try to run the scripts that are on those pages that are linked, it errors, and then kicks me out.  This is an issue that happened from the very beginning, so tried the httpie commands instead listed in my first email.  I do see the created repos under /pulp/content/ and under each is PULP_MANIFEST. 

Here is what happens, running as root,

# source base.sh
Setting environment variables for default hostname/port for the API and the Content app
[root at s_scripts]# source publication.sh
Create a task to create a publication.
parse error: Invalid numeric literal at line 1, column 8
Polling the task until it has reached a final state.
parse error: Invalid numeric literal at line 1, column 8
parse error: Invalid numeric literal at line 1, column 8

I originally tried the repo.sh script to create the first repo, and it failed. I modded it to randomly create a name, still failed, though it did create a random name.  No matter which one I tried, it comes up the same error.

source base.sh
Setting environment variables for default hostname/port for the API and the Content app
[root at aecdas-pulp3test _scripts]# source centos7_os_x64.sh
Creating a new repository named gialy.
parse error: Invalid numeric literal at line 1, column 8
Inspecting Repository.
HTTP/1.1 404 Not Found
Connection: close
Content-Length: 77
Content-Type: text/html
Date: Wed, 06 May 2020 18:49:01 GMT
Server: gunicorn/20.0.4
X-Frame-Options: SAMEORIGIN

<h1>Not Found</h1><p>The requested resource was not found on this server.</p>

I started on this page  https://pulp-file.readthedocs.io/en/latest/workflows/scripting.html

So I created a new file called correctness_check.sh and pasted everything in from the second script off that page, and same results. 

  source correctness_check.sh
Setting environment variables for default hostname/port for the API and the Content app
Creating a new repository named foo.
parse error: Invalid numeric literal at line 1, column 8
Inspecting Repository.
HTTP/1.1 404 Not Found
Connection: close
Content-Length: 77
Content-Type: text/html
Date: Wed, 06 May 2020 18:55:30 GMT
Server: gunicorn/20.0.4
X-Frame-Options: SAMEORIGIN

<h1>Not Found</h1><p>The requested resource was not found on this server.</p>

Creating a remote that points to an external source of files.
HTTP/1.1 404 Not Found
Connection: close
Content-Length: 77
Content-Type: text/html
Date: Wed, 06 May 2020 18:55:31 GMT
Server: gunicorn/20.0.4
X-Frame-Options: SAMEORIGIN

<h1>Not Found</h1><p>The requested resource was not found on this server.</p>

Export an environment variable for the new remote URI.
parse error: Invalid numeric literal at line 1, column 8
Inspecting new Remote.
HTTP/1.1 404 Not Found
Connection: close
Content-Length: 77
Content-Type: text/html
Date: Wed, 06 May 2020 18:55:31 GMT
Server: gunicorn/20.0.4
X-Frame-Options: SAMEORIGIN

<h1>Not Found</h1><p>The requested resource was not found on this server.</p>

Create a task to sync the repository using the remote.

http: error: InvalidURL: Failed to parse: localhost:24817sync
Polling the task until it has reached a final state.
parse error: Invalid numeric literal at line 1, column 8
parse error: Invalid numeric literal at line 1, column 8

It all goes back to that first parsing error. So I am not sure what is going on, but following the Ansible Install should have a working system, but with missing CSS for the GUI, and these parsing errors, I am not sure what is going on. 


Here is one of the repo scripts I created and ran that built and published the repos based on examples from the link in my previous email.

#!/bin/bash

# Create a Repository

http POST :24817/pulp/api/v3/repositories/file/file/ name=Centos7-os-x86_64

export REPO_HREF=$(http :24817/pulp/api/v3/repositories/file/file/ | jq -r '.results[] | select(.name == "Centos7-os-x86_64") | .pulp_href')

# Create an FileRemote to sync roles from Centos
http POST :24817/pulp/api/v3/remotes/file/file/ name='Centos7-os' url='http://mirror.centos.org/centos/7/os/x86_64/'
export REMOTE_HREF=$(http :24817/pulp/api/v3/remotes/file/file/ | jq -r '.results[] | select(.name == "Centos7-os") | .pulp_href')

# Sync the repo with the remote
http POST ':24817'$REPO_HREF'sync/' remote=$REMOTE_HREF
sleep 3  # wait for the sync to happen

# Create a Publication
http POST :24817/pulp/api/v3/publications/file/file/ repository=$REPO_HREF
export PUBLICATION_HREF=$(http :24817/pulp/api/v3/publications/file/file/ | jq -r '.results[0] | .pulp_href')

#Publish
http POST :24817/pulp/api/v3/distributions/file/file/ name='base' base_path='Centos7' publication=$PUBLICATION_HREF



From: Dennis Kliban <dkliban at redhat.com> 
Sent: Wednesday, May 6, 2020 12:00 PM
To: Heide, Todd <Todd.Heide at sccompanies.com>
Cc: Pulp-list at redhat.com
Subject: Re: [Pulp-list] Create distribution issues

[EXTERNAL] This message originated outside of the organization. Use caution when opening files or following links in this email!
On Tue, May 5, 2020 at 10:40 AM Heide, Todd <mailto:Todd.Heide at sccompanies.com> wrote:
New install of 3.3.0 and I can create the repo, 

# http POST http://localhost:24817/pulp/api/v3/repositories/file/file/ name=foo
HTTP/1.1 201 Created
Allow: GET, POST, HEAD, OPTIONS
Connection: close
Content-Length: 376
Content-Type: application/json
Date: Tue, 05 May 2020 14:04:24 GMT
Location: /pulp/api/v3/repositories/file/file/7885baed-b707-4002-b1e1-a98924e39ee5/
Server: gunicorn/20.0.4
Vary: Accept, Cookie
X-Frame-Options: SAMEORIGIN

{
    "description": null,
    "latest_version_href": "/pulp/api/v3/repositories/file/file/7885baed-b707-4002-b1e1-a98924e39ee5/versions/0/",
    "name": "foo",
    "pulp_created": "2020-05-05T14:04:24.441705Z",
    "pulp_href": "/pulp/api/v3/repositories/file/file/7885baed-b707-4002-b1e1-a98924e39ee5/",
    "versions_href": "/pulp/api/v3/repositories/file/file/7885baed-b707-4002-b1e1-a98924e39ee5/versions/"
}

Export the repo
# export REPO_HREF=$(http :24817/pulp/api/v3/repositories/file/file/ | jq -r '.results[] | select(.name == "foo") | .pulp_href')

But when I try to make the distribution it errors 404

# http POST :24817/pulp/api/v3/distributions/file/file/ name='baz' base_path='mypath' repository=$REPO_HREF``
HTTP/1.1 400 Bad Request
Allow: GET, POST, HEAD, OPTIONS
Connection: close
Content-Length: 35
Content-Type: application/json
Date: Tue, 05 May 2020 14:05:41 GMT
Server: gunicorn/20.0.4
Vary: Accept, Cookie
X-Frame-Options: SAMEORIGIN

{
    "repository": [
        "Unexpected field"
    ]
}

FileDsitribution requires a publication not a repository. Instructions for that are here: https://pulp-file.readthedocs.io/en/latest/workflows/publish-host.html#publish-and-host
 
Did something get missed during the install?   I also tried manual distribution, fails at AnsibleRemote
http POST :24817/pulp/api/v3/remotes/ansible/ansible/ name=bar url='https://galaxy.ansible.com/api/v1/roles/?/?
> namespace__name=elastic'
HTTP/1.1 404 Not Found
Connection: close
Content-Length: 77
Content-Type: text/html
Date: Tue, 05 May 2020 14:23:20 GMT
Server: gunicorn/20.0.4
X-Frame-Options: SAMEORIGIN

<h1>Not Found</h1><p>The requested resource was not found on this server.</p>

# http POST :24817/pulp/api/v3/distributions/file/file/ name='baz' base_path='dev' repository_version=REPO_VERSION_HREF
HTTP/1.1 400 Bad Request
Allow: GET, POST, HEAD, OPTIONS
Connection: close
Content-Length: 43
Content-Type: application/json
Date: Tue, 05 May 2020 14:24:42 GMT
Server: gunicorn/20.0.4
Vary: Accept, Cookie
X-Frame-Options: SAMEORIGIN

{
    "repository_version": [
        "Unexpected field"
    ]
}

The only one that seemed to have done anything is manual distribution. 

# http POST :24817/pulp/api/v3/distributions/file/file/ name='baz' base_path='bar' publication=$PUBLICATION_HREF
HTTP/1.1 202 Accepted
Allow: GET, POST, HEAD, OPTIONS
Connection: close
Content-Length: 67
Content-Type: application/json
Date: Tue, 05 May 2020 14:35:20 GMT
Server: gunicorn/20.0.4
Vary: Accept, Cookie
X-Frame-Options: SAMEORIGIN

{
    "task": "/pulp/api/v3/tasks/4c752d6b-9102-4105-b84c-7b523439914a/"
}


So out of the three on this page, https://docs.pulpproject.org/workflows/exposing-content.html the only one to work is manual distribution of a publication. I can view and download from the web page.   Did I miss a plugin or a configuration somewhere? 

A File repository version contains all the files. However, File publications always include a manifest file that lists all the files and checksums for those files. The manifest is generated only when a publication is created from a repository version. 

RPM repositories work the same way and always require generating a publication first also. 

 

_______________________________________________
Pulp-list mailing list
mailto:Pulp-list at redhat.com
https://www.redhat.com/mailman/listinfo/pulp-list




More information about the Pulp-list mailing list