Re: [Pulp-list] Create distribution issues

2020-05-06 Thread Heide, Todd
Reading backwards in the link that was posted in the reply, Under User setup, 
does Pulpcore and pulp-file need to be installed on the same box that pulp 
installer was run on? Maybe that is what I am missing. 

From: Dennis Kliban  
Sent: Wednesday, May 6, 2020 12:00 PM
To: Heide, Todd 
Cc: Pulp-list@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.he...@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

Not FoundThe requested resource was not found on this server.

# 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@redhat.com
https://www.redhat.com/mailman/listinfo/pulp-list

___
Pulp-list mailing list
Pulp-list@redhat.com
https://www.redhat.com/mailman/listinfo/pulp-list

Re: [Pulp-list] Create distribution issues

2020-05-06 Thread Heide, Todd
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@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@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

Not FoundThe requested resource was not found on this server.

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

Not FoundThe requested resource was not found on this server.

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

Not FoundThe requested resource was not found on this server.

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

Not FoundThe requested resource was not found on this server.

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  
Sent: Wednesday, May 6, 2020 12:00 PM
To: Heide, Todd 
Cc: Pulp-list@redhat.com
Subject: Re: [Pulp-list] Create distribution issues

[EXTERNAL] This message originated outside of the organiz

Re: [Pulp-list] Create distribution issues

2020-05-06 Thread Dennis Kliban
On Tue, May 5, 2020 at 10:40 AM Heide, Todd 
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
>
> Not FoundThe requested resource was not found on this
> server.
>
> # 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
> Pulp-list@redhat.com
> https://www.redhat.com/mailman/listinfo/pulp-list
>
>
___
Pulp-list mailing list
Pulp-list@redhat.com
https://www.redhat.com/mailman/listinfo/pulp-list