OpenNebula / one

The open source Cloud & Edge Computing Platform bringing real freedom to your Enterprise Cloud 🚀
http://opennebula.io
Apache License 2.0
1.23k stars 478 forks source link

curl can not resolve HTTP-based marketplace hostname because of missing trailing '/' in the endpoint #6619

Open mkutouski opened 3 months ago

mkutouski commented 3 months ago

Description If the value for the ENDPOINT attribute is defined as "https://private-marketplace.domain.org" i.e. without trailing '/' then the image can't be downloaded:

Tue Jun 11 11:50:28 2024 [Z0][ImM][I]: cp: Downloading image https://private-marketplace.domain.orgappliance/695ab19e-23dc-11ef-a2b8-59beec9fdf86/download/0 to the image repository
Tue Jun 11 11:50:28 2024 [Z0][ImM][E]: Error copying image in the datastore: INFO: cp: Downloading image https://private-marketplace.domain.orgappliance/695ab19e-23dc-11ef-a2b8-59beec9fdf86/download/0 to the image repository ERROR: cp: Command "set -e -o pipefail; /var/lib/one/remotes/datastore/fs/../downloader.sh   'https://private-marketplace.domain.orgappliance/695ab19e-23dc-11ef-a2b8-59beec9fdf86/download/0' '/var/lib/one//datastores/1/4e08c47dbd4a14fe1b47ff55c73a5f47'" failed: curl: (6) Could not resolve host: private-marketplace.domain.orgappliance curl: (6) Could not resolve host: private-marketplace.domain.orgappliance curl: (6) Could not resolve host: private-marketplace.domain.orgappliance curl: (6) Could not resolve host: private-marketplace.domain.orgappliance Error copying Error copying https://private-marketplace.domain.orgappliance/695ab19e-23dc-11ef-a2b8-59beec9fdf86/download/0 to /var/lib/one//datastores/1/4e08c47dbd4a14fe1b47ff55c73a5f47

But with

ENDPOINT="https://private-marketplace.domain.org/"

it works, i.e. the appliance can be downloaded/exported.

To Reproduce Define a configuration file for the private marketplace:

cat << EOF > private-marketplace.conf  
NAME        = "Private Marketplace"
MARKET_MAD  = one
ENDPOINT    = "https://private-marketplace.domain.org"
DESCRIPTION = "Company's Private Marketplace"
EOF

Create a marketplace from that configuration file:

onemarket create private-marketplace.conf

Check if the private marketplace has been created:

onemarket list

Try to export an appliance from that private marketplace:

onemarketapp export <app_id> <name> -d <DS_ID>

Check the status of the appliance and oned.log for errors.

Expected behavior The appliance from HTTP-based private marketplace should be exported without any errors.

Details

Progress Status