Note: This bug is displayed in read-only format because the product is no longer active in Red Hat Bugzilla.

Bug 1946303

Summary: [Assisted-4.7] POST /clusters/{cluster_id}/downloads/image fails to create image (full or minimal). The image was not found (perhaps it expired) - please generate the image and try again
Product: OpenShift Container Platform Reporter: mlammon
Component: assisted-installerAssignee: Nick Carboni <ncarboni>
assisted-installer sub component: assisted-service QA Contact: mlammon
Status: CLOSED NOTABUG Docs Contact:
Severity: unspecified    
Priority: unspecified CC: alazar, aos-bugs, gharden, skramlin
Version: 4.7   
Target Milestone: ---   
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2021-04-06 13:38:30 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:

Description mlammon 2021-04-05 18:13:54 UTC
Description of problem:
POST /clusters/{cluster_id}/downloads/image fails to create image (full or minimal). The image was not found (perhaps it expired) - please generate the image and try again

Version-Release number of selected component (if applicable):
{
    "release_tag": "v1.0.18.1",
    "versions": {
        "assisted-service": "quay.io/app-sre/assisted-service:fcf7264",
        "openshift4-assisted-installer-agent-rhel8": "registry-proxy.engineering.redhat.com/rh-osbs/openshift4-assisted-installer-agent-rhel8:v1.0.0-26",
        "openshift4-assisted-installer-reporter-rhel8": "registry-proxy.engineering.redhat.com/rh-osbs/openshift4-assisted-installer-reporter-rhel8:v1.0.0-28",
        "openshift4-assisted-installer-rhel8": "registry-proxy.engineering.redhat.com/rh-osbs/openshift4-assisted-installer-rhel8:v1.0.0-27"
    }
}

How reproducible:
100%

Steps to Reproduce:
1. Started creating cluster with UI on stage , Next to Bare Metal Discovery (get {cluster_id})
2. Refresh Token
3. Look for {cluster_id} to exist just to validate -> http://api.stage.openshift.com/api/assisted-install/v1/clusters/ (optional)
4. POST  http://api.stage.openshift.com/api/assisted-install/v1/clusters/{cluster_id}/downloads/image

Actual results:

{"code":"404","href":"","id":404,"kind":"Error","reason":"The image was not found (perhaps it expired) - please generate the image and try again"}

Expected results:

Expect 200OK and image generate, ready for GET image
Expect to see event image started to download

Additional info:

If we create the ISO via UI, we can then trigger the download from the API

GET POST  http://api.stage.openshift.com/api/assisted-install/v1/clusters/{cluster_id}/downloads/image

Comment 1 Nick Carboni 2021-04-06 12:44:35 UTC
This works fine for me.

Steps:
1. Create cluster in UI
2. Generate image:
curl \
    --header "Content-Type: application/json" \
    --header "Authorization: Bearer $(ocm token)" \
    --request POST \
    --data @generate-image-data \
    "https://api.stage.openshift.com/api/assisted-install/v1/clusters/8b9e6a04-2879-43ca-944a-323900806b07/downloads/image"
generate-image-data:
{"ssh_public_key":"ssh-rsa .... ncarboni"}
3. Download image
curl \
    --header "Authorization: Bearer $(ocm token)" \
    "https://api.stage.openshift.com/api/assisted-install/v1/clusters/8b9e6a04-2879-43ca-944a-323900806b07/downloads/image" > 8b9e6a04-2879-43ca-944a-323900806b07-discovery.iso

Can you check to see if you can still reproduce this?

Comment 2 mlammon 2021-04-06 13:38:30 UTC
This was environment issue on my part that I did not pick up on yesterday.  
I was using POSTMAN vs. CURL to produce and POSTMAN was sending incorrect 
POST followed immediately by GET so effectively I was seeing the message 
from GET.   Closing this bug.